MantisBT - CMake |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0013388 | CMake | CMake | public | 2012-07-10 04:25 | 2013-01-09 10:56 |
|
Reporter | Andreas Mohr | |
Assigned To | Brad King | |
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | x86 | OS | Linux | OS Version | RHEL5 |
Product Version | CMake 2.8.8 | |
Target Version | CMake 2.8.9 | Fixed in Version | CMake 2.8.9 | |
|
Summary | 0013388: include("${NONEXISTENT_FILE_VARIABLE}" OPTIONAL) will add bogus dir dependency, causing frequent reconfigure runs |
Description | A bogus include with an empty string (which may happen very frequently, namely whenever a user uses a variable-based include() and does not bother to set the variable)
will cause very wasteful CMake re-configure runs due to inserting a bogus directory dependency (empty file argument seems to get evaluated to the current source directory during module file lookup algorithms) for the build system to consider for CMake re-configuration evaluation. |
Steps To Reproduce | CMakeLists.txt:
#include("" OPTIONAL)
Enabling that bogus include() and generating a Ninja build tree will cause the following line in build.ninja:
# Re-run CMake if any of its inputs changed.
build build.ninja: RERUN_CMAKE | /home/amoh/Projects/cmake_tests/include_hook_bug_test /home/amoh/Projects/cmake_tests/include_hook_bug_test/CMakeLists.txt /home/amoh/Projects/cmake_tests/include_hook_bug_test/build/CMakeFiles/CMakeCCompiler.cmake /home/amoh/Projects/cmake_tests/include_hook_bug_test/build/CMakeFiles/CMakeCXXCompiler.cmake /home/amoh/Projects/cmake_tests/include_hook_bug_test/build/CMakeFiles/CMakeSystem.cmake /usr/local/share/cmake-2.8/Modules/CMakeCInformation.cmake /usr/local/share/cmake-2.8/Modules/CMakeCXXInformation.cmake /usr/local/share/cmake-2.8/Modules/CMakeCommonLanguageInclude.cmake /usr/local/share/cmake-2.8/Modules/CMakeGenericSystem.cmake /usr/local/share/cmake-2.8/Modules/CMakeSystemSpecificInformation.cmake /usr/local/share/cmake-2.8/Modules/Compiler/GNU-C.cmake /usr/local/share/cmake-2.8/Modules/Compiler/GNU-CXX.cmake /usr/local/share/cmake-2.8/Modules/Compiler/GNU.cmake /usr/local/share/cmake-2.8/Modules/Platform/Linux-GNU-C.cmake /usr/local/share/cmake-2.8/Modules/Platform/Linux-GNU-CXX.cmake /usr/local/share/cmake-2.8/Modules/Platform/Linux-GNU.cmake /usr/local/share/cmake-2.8/Modules/Platform/Linux.cmake /usr/local/share/cmake-2.8/Modules/Platform/UnixPaths.cmake CMakeCache.txt
Pay special attention to the mentioning of /home/amoh/Projects/cmake_tests/include_hook_bug_test
Now if you actually modify the "stat" status quo of this source directory (say, by editing a file in it via vim), then this will trigger - potentially VERY lengthy! - CMake re-configure runs once re-running the build (via "ninja").
Same effect with Makefile generator.
Thank you! |
Additional Information | |
Tags | No tags attached. |
Relationships | |
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2012-07-10 04:25 | Andreas Mohr | New Issue | |
2012-07-10 08:36 | Brad King | Assigned To | => Peter Kuemmel |
2012-07-10 08:36 | Brad King | Status | new => assigned |
2012-07-10 08:36 | Brad King | Summary | include("${NONEXISTENT_FILE_VARIABLE}" OPTIONAL) will add bogus dir dependency, causing frequent reconfigure runs => Ninja: include("${NONEXISTENT_FILE_VARIABLE}" OPTIONAL) will add bogus dir dependency, causing frequent reconfigure runs |
2012-07-10 10:15 | Peter Kuemmel | Note Added: 0030012 | |
2012-07-10 10:15 | Peter Kuemmel | Status | assigned => closed |
2012-07-10 10:15 | Peter Kuemmel | Resolution | open => fixed |
2012-07-10 10:21 | Andreas Mohr | Note Added: 0030013 | |
2012-07-10 10:21 | Andreas Mohr | Status | closed => feedback |
2012-07-10 10:21 | Andreas Mohr | Resolution | fixed => reopened |
2012-07-10 10:34 | Brad King | Note Added: 0030015 | |
2012-07-10 10:39 | Peter Kuemmel | Note Added: 0030016 | |
2012-07-10 10:40 | Andreas Mohr | Note Added: 0030017 | |
2012-07-10 10:40 | Andreas Mohr | Status | feedback => assigned |
2012-07-10 10:41 | Brad King | Summary | Ninja: include("${NONEXISTENT_FILE_VARIABLE}" OPTIONAL) will add bogus dir dependency, causing frequent reconfigure runs => include("${NONEXISTENT_FILE_VARIABLE}" OPTIONAL) will add bogus dir dependency, causing frequent reconfigure runs |
2012-07-10 10:43 | Brad King | Assigned To | Peter Kuemmel => Brad King |
2012-07-10 10:44 | Brad King | Note Added: 0030018 | |
2012-07-10 10:46 | Peter Kuemmel | Note Added: 0030019 | |
2012-07-10 10:52 | Peter Kuemmel | Note Edited: 0030019 | bug_revision_view_page.php?bugnote_id=30019#r740 |
2012-07-10 10:54 | Peter Kuemmel | Note Edited: 0030019 | bug_revision_view_page.php?bugnote_id=30019#r741 |
2012-07-10 10:56 | Brad King | Note Added: 0030020 | |
2012-07-10 10:59 | Peter Kuemmel | Note Added: 0030021 | |
2012-07-10 11:07 | Brad King | Note Added: 0030023 | |
2012-07-10 11:07 | Brad King | Status | assigned => resolved |
2012-07-10 11:07 | Brad King | Resolution | reopened => fixed |
2012-08-09 19:43 | David Cole | Fixed in Version | => CMake 2.8.9 |
2012-08-09 19:43 | David Cole | Target Version | => CMake 2.8.9 |
2013-01-09 10:56 | Robert Maynard | Note Added: 0032036 | |
2013-01-09 10:56 | Robert Maynard | Status | resolved => closed |
Notes |
|
(0030012)
|
Peter Kuemmel
|
2012-07-10 10:15
|
|
|
|
(0030013)
|
Andreas Mohr
|
2012-07-10 10:21
|
|
Sorry, I'm afraid due to having missed some important information in my report, the fix - while quite nice - does not fully cut it.
Problem is that the non-OPTIONAL include() case will _also_ work without erroring out, thereby adding the bogus directory dependency as well in that case.
IOW, this misbehaviour is not specific to OPTIONAL only.
Thank you very much for your lightning-fast handling of this issue! |
|
|
(0030015)
|
Brad King
|
2012-07-10 10:34
|
|
Re 0013388:0030012: I assigned this to you Peter because it appears to be Ninja-specific. A fix up in include() is not appropriate unless discussed first.
Andreas, I was not able to reproduce this with 2.8.9-rc1. Does it happen with the Makefile generator too? |
|
|
(0030016)
|
Peter Kuemmel
|
2012-07-10 10:39
|
|
I think it is a bug that empty file names without OPTIONAL are accepted. |
|
|
(0030017)
|
Andreas Mohr
|
2012-07-10 10:40
|
|
"Same effect with Makefile generator." ;-)
[ok, my initial description probably was a wee bit long] |
|
|
(0030018)
|
Brad King
|
2012-07-10 10:44
|
|
Re 0013388:0030016: Okay, it's not Ninja-specific. Sorry for the confusion. I'll take over the fix. Thanks. |
|
|
(0030019)
|
Peter Kuemmel
|
2012-07-10 10:46
(edited on: 2012-07-10 10:54) |
|
|
|
(0030020)
|
Brad King
|
2012-07-10 10:56
|
|
|
|
(0030021)
|
Peter Kuemmel
|
2012-07-10 10:59
|
|
Then please also fix the line length in 39. |
|
|
(0030023)
|
Brad King
|
2012-07-10 11:07
|
|
|
|
(0032036)
|
Robert Maynard
|
2013-01-09 10:56
|
|
Closing resolved issues that have not been updated in more than 4 months. |
|