[cmake-developers] [CMake 0013388]: include("${NONEXISTENT_FILE_VARIABLE}" OPTIONAL) will add bogus dir dependency, causing frequent reconfigure runs

Mantis Bug Tracker mantis at public.kitware.com
Tue Jul 10 04:25:04 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13388 
====================================================================== 
Reported By:                Andreas Mohr
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13388
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2012-07-10 03:25 CDT
Last Modified:              2012-07-10 03:25 CDT
====================================================================== 
Summary:                    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!
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-07-10 03:25 Andreas Mohr   New Issue                                    
======================================================================




More information about the cmake-developers mailing list