View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013910CMakeCMakepublic2013-02-13 08:192013-02-16 04:07
ReporterEvgeniy Stepanov 
Assigned ToPeter Kuemmel 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionnot fixable 
Platformx86_64OSLinuxOS VersionUbuntu 12.04
Product VersionCMake 2.8.10.2 
Target VersionFixed in VersionCMake 2.8.10.2 
Summary0013910: Ninja generator initialization fails if /usr/bin/ninja is not world-readable
DescriptionCMake tests availability or Ninja by access(, R_OK). This does not make any sense - it's not going to read /usr/bin/ninja, it's going to execute it!

"--x" ninja binary results in a cryptic failure message, as shown below.
Steps To Reproduce$ ls -la /usr/bin/ninja
-rwxr-x--x 1 root root 2746829 Feb 13 16:36 /usr/bin/ninja

$ cmake -GNinja ..
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.


strace shows:
access("ninja", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/local/bin/ninja", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/sbin/ninja", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/bin/ninja", R_OK) = -1 EACCES (Permission denied)
access("/sbin/ninja", R_OK) = -1 ENOENT (No such file or directory)
access("/bin/ninja", R_OK) = -1 ENOENT (No such file or directory)
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0032307)
Peter Kuemmel (developer)
2013-02-16 04:06

Call ls /usr/bin -l , and you will see that all tools are readable by "others".
Or is it not the case on you system?

sudo chmod o+r /usr/bin/ninja fixes the issue.


This is not ninja specific. It is how SystemTools::FindProgram() works.

 Issue History
Date Modified Username Field Change
2013-02-13 08:19 Evgeniy Stepanov New Issue
2013-02-13 09:02 Brad King Assigned To => Peter Kuemmel
2013-02-13 09:02 Brad King Status new => assigned
2013-02-16 04:06 Peter Kuemmel Note Added: 0032307
2013-02-16 04:07 Peter Kuemmel Status assigned => closed
2013-02-16 04:07 Peter Kuemmel Resolution open => not fixable
2013-02-16 04:07 Peter Kuemmel Fixed in Version => CMake 2.8.10.2


Copyright © 2000 - 2018 MantisBT Team