MantisBT - CMake | ||||||||||
View Issue Details | ||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||
0014928 | CMake | CMake | public | 2014-05-22 15:01 | 2016-02-16 13:11 | |||||
Reporter | dirk-thomas | |||||||||
Assigned To | ||||||||||
Priority | normal | Severity | minor | Reproducibility | always | |||||
Status | closed | Resolution | fixed | |||||||
Platform | Linux | OS | Ubuntu | OS Version | 14.04 | |||||
Product Version | CMake 2.8.12.2 | |||||||||
Target Version | Fixed in Version | CMake 3.0 | ||||||||
Summary | 0014928: cmake -E create_symlink always returns code 0 even when failing to create symlink | |||||||||
Description | When invoking the command "cmake -E create_symlink old new" the return code is always 0 even when the command failed to create the symlink. | |||||||||
Steps To Reproduce | Invoke "cmake ." with the following CMakeLists.txt file in the same folder to reproduce: # create a real file set(file "${CMAKE_CURRENT_SOURCE_DIR}/test") file(WRITE "${file}" "foo") if(EXISTS "${file}" AND NOT IS_SYMLINK "${file}") message(STATUS "OK: it is a file, not a symlink") else() message(FATAL_ERROR "ups, this hould not happen") endif() # try to create a symlink execute_process( COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink" "/tmp/somewhere" "${file}" RESULT_VARIABLE rc OUTPUT_VARIABLE output ERROR_VARIABLE error ) message(STATUS "RESULT_VARIABLE ${rc}") message(STATUS "OUTPUT_VARIABLE ${output}") message(STATUS "ERROR_VARIABLE ${error}") if(EXISTS "${file}" AND IS_SYMLINK "${file}") message(STATUS "WEIRD: it is a symlink, not a file, has overwritten the existing file") elseif(NOT rc EQUAL 0) message(STATUS "OK: could not create symlink and returned error code") else() message(FATAL_ERROR "ups, this hould not happen, not creating the symlink but returning code 0 pretending it was successful") endif() | |||||||||
Additional Information | I currently manually have to check that neither a symlink nor file is present before invoking the command and check afterwards that the symlink is present. | |||||||||
Tags | No tags attached. | |||||||||
Relationships |
| |||||||||
Attached Files | ||||||||||
Issue History | ||||||||||
Date Modified | Username | Field | Change | |||||||
2014-05-22 15:01 | dirk-thomas | New Issue | ||||||||
2014-05-23 08:52 | Brad King | Note Added: 0035919 | ||||||||
2014-05-23 12:37 | dirk-thomas | Note Added: 0035923 | ||||||||
2014-05-23 12:37 | dirk-thomas | Note Edited: 0035923 | bug_revision_view_page.php?bugnote_id=35923#r1461 | |||||||
2014-05-23 13:33 | Brad King | Note Added: 0035924 | ||||||||
2014-05-23 13:34 | Brad King | Note Added: 0035925 | ||||||||
2014-05-23 13:37 | dirk-thomas | Note Added: 0035926 | ||||||||
2014-05-23 13:39 | Brad King | Relationship added | related to 0014713 | |||||||
2014-05-23 13:39 | Brad King | Status | new => resolved | |||||||
2014-05-23 13:39 | Brad King | Resolution | open => fixed | |||||||
2014-05-23 13:39 | Brad King | Fixed in Version | => CMake 3.0 | |||||||
2014-11-03 08:38 | Robert Maynard | Note Added: 0037141 | ||||||||
2014-11-03 08:38 | Robert Maynard | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|