View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015436CMakeCMakepublic2015-03-07 06:242015-11-02 09:13
ReporterBenjamin Schindler 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformlinuxOSgentooOS Version-
Product VersionCMake 3.1 
Target VersionCMake 3.3Fixed in VersionCMake 3.3 
Summary0015436: ninja generator breaks in symlinked directory
DescriptionI tried now cmake-3.0, 2.8.11 and 3.1 and all exhibit this issue:

I have a very simple project (helloworld would suffice) and use the ninja generator. The project fails to build with:

ninja: error: build.ninja:20: unknown build rule 'CXX_COMPILER'

Upon inspection, I noted that on the top, older generators produced this line in the ninja generator:

#############################################
# Include rules file.

include rules.ninja

This is not present in the tested versions thus leading to the described bug.
Steps To ReproduceCreate hello world project, produce ninja file and build. Should lead to:

ninja: error: build.ninja:20: unknown build rule 'CXX_COMPILER'
TagsNo tags attached.
Attached Filespatch file icon v1-0001-Ninja-Improve-internal-check-for-generating-at-the-t.patch [^] (1,665 bytes) 2015-03-09 09:29 [Show Content]

 Relationships

  Notes
(0038172)
Brad King (manager)
2015-03-07 06:39

The Ninja generator is widely used and well tested. We have not observed this issue, so please provide more detailed information about how to reproduce it.

There is a condition around generating the information here:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmLocalNinjaGenerator.cxx;hb=v3.1.3#l51 [^]

so that it is only done once by the generator for the top level directory. Somehow the check in isRootMakefile must be failing for you even for the top level:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmLocalNinjaGenerator.cxx;hb=v3.1.3#l183 [^]

Are you using symbolic links in the path anywhere?
(0038173)
Benjamin Schindler (reporter)
2015-03-07 06:55

As a matter of fact, yes, I do use symlinks. The reason is this:
I have an ssd but I don't have space for the entire home directory, so the software develpment directory symlinks into a mnt directory mounted on the ssd.
(0038174)
Benjamin Schindler (reporter)
2015-03-07 07:03

So after googling a bit, I was able to fix this by replacing the symlink by a bind-mount.
I don't know whether this is a cmake or ninja issue, but I think cmake should help a bit here. Either produce an error indicating the condition or properly support symlinks
(0038183)
Brad King (manager)
2015-03-09 09:30

Please try building CMake with the "v1-0001-Ninja-Improve-internal-check-for-generating-at-the-t.patch" applied.
(0038188)
Benjamin Schindler (reporter)
2015-03-09 13:32

I just tried and the patch seems to fix the issue
(0038189)
Brad King (manager)
2015-03-09 13:38

I've applied the patch, thanks for testing:

 Ninja: Improve internal check for generating at the top-level
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a6b09085 [^]
(0038190)
Benjamin Schindler (reporter)
2015-03-09 13:39

Thank you for the very quick support!
(0039725)
Robert Maynard (manager)
2015-11-02 09:13

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2015-03-07 06:24 Benjamin Schindler New Issue
2015-03-07 06:39 Brad King Note Added: 0038172
2015-03-07 06:55 Benjamin Schindler Note Added: 0038173
2015-03-07 07:03 Benjamin Schindler Note Added: 0038174
2015-03-09 09:29 Brad King File Added: v1-0001-Ninja-Improve-internal-check-for-generating-at-the-t.patch
2015-03-09 09:29 Brad King Target Version => CMake 3.3
2015-03-09 09:29 Brad King Summary ninja generator fails to produce include statement for rules => ninja generator breaks in symlinked directory
2015-03-09 09:30 Brad King Note Added: 0038183
2015-03-09 13:32 Benjamin Schindler Note Added: 0038188
2015-03-09 13:38 Brad King Note Added: 0038189
2015-03-09 13:38 Brad King Assigned To => Brad King
2015-03-09 13:38 Brad King Status new => resolved
2015-03-09 13:38 Brad King Resolution open => fixed
2015-03-09 13:38 Brad King Fixed in Version => CMake 3.3
2015-03-09 13:39 Benjamin Schindler Note Added: 0038190
2015-11-02 09:13 Robert Maynard Note Added: 0039725
2015-11-02 09:13 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team