[cmake-developers] [CMake 0013226]: CMake doesn't call realpath(), causing it to get confused if built through symlink
Mantis Bug Tracker
mantis at public.kitware.com
Wed May 16 00:38:11 EDT 2012
The following issue has been SUBMITTED.
======================================================================
http://public.kitware.com/Bug/view.php?id=13226
======================================================================
Reported By: Stewart Smith
Assigned To:
======================================================================
Project: CMake
Issue ID: 13226
Category: CMake
Reproducibility: always
Severity: major
Priority: high
Status: new
======================================================================
Date Submitted: 2012-05-16 00:38 EDT
Last Modified: 2012-05-16 00:38 EDT
======================================================================
Summary: CMake doesn't call realpath(), causing it to get
confused if built through symlink
Description:
If you have something like this:
product (the directory)
and product-1.0 being a symlink to product
and at a later date, product-1.1 being a symlink to product
and you once built through "cd product-1.0; make" and in future "cd product-1.1;
make", then it's possible for an *in source tree* build to have the following
condition met when it shouldn't be:
IF(NOT ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
As Cmake caches things, repeated builds get the old 'product-1.0' in path in one
of the variables and the new 'product-1.1' in the other.
If the code in the CMakeLists.txt does something like overwrite a file to launch
things correctly for out-of-tree builds (as it does in the MySQL source code),
then you get a fork-bomb instead of a test-suite.
If CMake called realpath(3) on source and binary dirs when it was setting up the
variables initially, this problem would be avoided as the comparison would
always be done with the physical paths, not with what symlinks were used at any
particular time.
Steps to Reproduce:
see above.
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2012-05-16 00:38 Stewart Smith New Issue
======================================================================
More information about the cmake-developers
mailing list