MantisBT - CMake
View Issue Details
0014966CMakeCMakepublic2014-06-09 16:042015-01-05 08:38
Christopher Yeleighton 
Brad King 
normalmajoralways
closedfixed 
GNU/LinuxopenSUSE13.1
CMake 2.8.11 
CMake 3.1CMake 3.1 
0014966: cmake succeeds evaluating a script that is a directory
cmake "succeeds" evaluating a "script" that is a directory.
{ cmake -P . && echo "$?"; }
No tags attached.
Issue History
2014-06-09 16:04Christopher YeleightonNew Issue
2014-06-09 16:07David ColeNote Added: 0036139
2014-06-09 16:07David ColeNote Added: 0036140
2014-06-09 16:12Brad KingNote Added: 0036141
2014-06-09 16:25Brad KingNote Added: 0036144
2014-06-10 08:46Brad KingAssigned To => Brad King
2014-06-10 08:46Brad KingStatusnew => resolved
2014-06-10 08:46Brad KingResolutionopen => fixed
2014-06-10 08:46Brad KingFixed in Version => CMake 3.1
2014-06-10 08:46Brad KingTarget Version => CMake 3.1
2015-01-05 08:38Robert MaynardNote Added: 0037561
2015-01-05 08:38Robert MaynardStatusresolved => closed

Notes
(0036139)
David Cole   
2014-06-09 16:07   
Does not reproduce on Windows for me, using CMake 3.0.0-rc6:

    N:\...> cmake -P .
    CMake Error: cmListFileCache: error can not open file N:/...
    CMake Error: Error processing file: .

    N:\...> echo %ERRORLEVEL%
    1

    N:\...> cmake --version
    cmake version 3.0.0-rc6
(0036140)
David Cole   
2014-06-09 16:07   
Mayber try CMake 3.0.0-rc6 and see if it's fixed already on Linux, too...
(0036141)
Brad King   
2014-06-09 16:12   
I can reproduce it with 3.0.0-rc6 on Linux.

We are just using fopen directly:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmListFileLexer.in.l;hb=v3.0.0-rc6#l491 [^]

without checking the file type first. Perhaps that fails on a directory with the MS C runtime but not the GNU C runtime library.
(0036144)
Brad King   
2014-06-09 16:25   
This should fix it:

 cmake: Do not open directories as scripts
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b1c113d9 [^]
(0037561)
Robert Maynard   
2015-01-05 08:38   
Closing resolved issues that have not been updated in more than 4 months.