MantisBT - CMake | ||||||||||
View Issue Details | ||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||
0014546 | CMake | CMake | public | 2013-11-06 00:33 | 2016-06-10 14:31 | |||||
Reporter | Alp Toker | |||||||||
Assigned To | Kitware Robot | |||||||||
Priority | normal | Severity | feature | Reproducibility | always | |||||
Status | closed | Resolution | moved | |||||||
Platform | OS | OS Version | ||||||||
Product Version | CMake 2.8.12 | |||||||||
Target Version | Fixed in Version | |||||||||
Summary | 0014546: CACHE variables persist through reruns | |||||||||
Description | Hello, We're using CMake in the LLVM/clang Open Source project and noticed that CACHE variables are getting persisted after regenerating makefiles (reference: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-October/032957.html [^]) This means that upstream SVN changes to any CACHE variable (such as the binary version number, default bug report URL etc.) don't take effect on developers systems. The most visible result of this is that, when the project makes a new release, existing builds continue to use the old version number taken from the cache. This happens with all other CACHE variables too. | |||||||||
Steps To Reproduce | Configure a project that has the following CACHE variable in CMakeLists.txt: set(BUG_REPORT_URL "http://llvm.org/bugstypo/" [^] CACHE STRING "Default URL where bug reports are to be submitted.") Then build the project. Then modify the URL in CMakeLists.txt, changing it from "http://llvm.org/bugstypo/" [^] to "http://llvm.org/bugs/" [^] Then rebuild the project. Problem: BUG_REPORT_URL is still "http://llvm.org/bugstypo/" [^] Expected result: BUG_REPORT_URL should have been updated to "http://llvm.org/bugs/" [^] The issue has been observed with the Makefile and Ninja generator, and presumably all other generators are affected. | |||||||||
Additional Information | I've investigated and this seems to be a bug in cmMakefile::AddCacheDefinition(), which is caching the default value for the variable even when the user hasn't overridden it on the commandline or in the CMake GUI. I'm working on a patch that teaches CMake to differentiate between the declaration, definition and default value of a CACHE variable. An additional benefit of this approach is that it adds a "Reset to default" option for CACHE variables in the CMake GUI. There should otherwise be no change in behaviour other than resolving the problem as described. Specifically, if the user defines the variable explicitly, the user definition will continue persist same as before. I'll upload the patch shortly. Please let me know if you're already aware of / working on an alternative solution to this issue. | |||||||||
Tags | No tags attached. | |||||||||
Relationships |
| |||||||||
Attached Files | wip-cmake-default-4d6b88.patch (11,899) 2013-11-11 21:38 https://public.kitware.com/Bug/file/4947/wip-cmake-default-4d6b88.patch | |||||||||
Issue History | ||||||||||
Date Modified | Username | Field | Change | |||||||
2013-11-06 00:33 | Alp Toker | New Issue | ||||||||
2013-11-06 07:57 | Brad King | Note Added: 0034403 | ||||||||
2013-11-06 07:57 | Brad King | Severity | minor => feature | |||||||
2013-11-06 07:57 | Brad King | Status | new => backlog | |||||||
2013-11-11 21:36 | Alp Toker | Note Added: 0034432 | ||||||||
2013-11-11 21:38 | Alp Toker | File Added: wip-cmake-default-4d6b88.patch | ||||||||
2013-11-11 21:52 | Alp Toker | Note Added: 0034433 | ||||||||
2013-11-12 09:17 | Brad King | Note Added: 0034435 | ||||||||
2013-11-13 17:56 | Alp Toker | Note Added: 0034451 | ||||||||
2014-02-14 15:34 | Brad King | Relationship added | related to 0014756 | |||||||
2016-06-10 14:29 | Kitware Robot | Note Added: 0042412 | ||||||||
2016-06-10 14:29 | Kitware Robot | Status | backlog => resolved | |||||||
2016-06-10 14:29 | Kitware Robot | Resolution | open => moved | |||||||
2016-06-10 14:29 | Kitware Robot | Assigned To | => Kitware Robot | |||||||
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|