As per the documentation of java.nio.file.Files.isExecutable, the method can return true when passed a directory on UNIX systems. This causes the Executables.isPathValid helper to incorrectly return true when given a directory named cmake.
Replication
- Create a directory called
cmake under the current working directory
- Run
CMakeInstance.generate() in the same working directory.
- The
cmake directory will incorrectly be assumed to be a cmake executable, and CMakeInstance will attempt to execute it.
Potential fix
Add a Files.isDirectory disqualification check to the isPathValid helper.