MantisBT - CMake
View Issue Details
0011503CMake(No Category)public2010-11-24 07:562011-01-12 07:53
blaudden 
Brad King 
normalmajorrandom
closedfixed 
X86_64Windows7 64bit
CMake 2.8.3 
CMake 2.8.4CMake 2.8.4 
0011503: cmake fails to remove non existent file
cmake spuriously fails to remove files which it has produced during "try compile" with error "No such file or directory". Since the file does not exist anymore, I think this should be reported as a success to remove the file.
cmake -G "Visual Studio 9 2008 Win64"
-- Check for working C compiler: cl
-- Check for working C compiler: cl -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: cl
-- Check for working CXX compiler: cl -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detected 64-bit platform.
<snip>
-- Looking for sys/types.h
CMake Error: Remove failed on file: C:/club/bzr_mysql-5.1-telco-7.0/1019/mysql-5.1.51-ndb-7.0.21-pb1019/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec.exe: System Error: No such file or directory
Looking in Source/cmCoreTryCompile.cc I see a retry loop which retries the RemoveFile() 5 time with half a second delay. Would suggest that the loop is extended to also check if file still exists.

Maybe something like below?

cmake-2.8.3$ diff -u Source/cmCoreTryCompile.cxx Source/cmCoreTryCompile.cxx.orig
--- Source/cmCoreTryCompile.cxx 2010-11-24 09:55:33.000000000 +0100
+++ Source/cmCoreTryCompile.cxx.orig 2010-11-24 09:54:38.000000000 +0100
@@ -408,7 +408,7 @@
               cmSystemTools::Delay(500);
               if(cmSystemTools::RemoveFile(fullPath.c_str()))
                 {
- removed = FileExists(fullPath.c_str());
+ removed = true;
                 }
               numAttempts++;
               }


No tags attached.
Issue History
2010-11-24 07:56blauddenNew Issue
2010-12-15 12:19David ColeAssigned To => David Cole
2010-12-15 12:19David ColeStatusnew => assigned
2010-12-15 15:04Brad KingAssigned ToDavid Cole => Brad King
2010-12-15 15:04Brad KingNote Added: 0024187
2010-12-15 15:04Brad KingStatusassigned => closed
2010-12-15 15:04Brad KingResolutionopen => fixed
2011-01-12 07:53David ColeFixed in Version => CMake 2.8.4
2011-01-12 07:53David ColeTarget Version => CMake 2.8.4
2011-01-12 07:53David ColeSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=113#r113

Notes
(0024187)
Brad King   
2010-12-15 15:04   
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=097294e6 [^]