[cmake-developers] [CMake 0015363]: CMake 3.1.0 with "Visual Studio 12 2013 ARM" generator for WP8.1 fails to compile simple test program if path length > 91 chars

Mantis Bug Tracker mantis at public.kitware.com
Wed Jan 21 13:45:33 EST 2015


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15363 
====================================================================== 
Reported By:                Moshe Rubin
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15363
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   high
Status:                     new
====================================================================== 
Date Submitted:             2015-01-21 13:45 EST
Last Modified:              2015-01-21 13:45 EST
====================================================================== 
Summary:                    CMake 3.1.0 with "Visual Studio 12 2013 ARM"
generator for WP8.1 fails to compile simple test program if path length > 91
chars
Description: 
When running CMake with the "Visual Studio 12 2013 ARM" generator to create a
Windows Phone 8.1 project file, the run will fail with the message:

<quote>
The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
12.0/VC/bin/x86_arm/cl.exe" is not able to compile a simple test program.
</quote>

I have been able to confirm that CMake will fail consistently if the full path
to the folder from which CMake is being run is greater than ninety (90)
characters.  If equal to, or less, than 90 characters, the run succeeds.

I have only been able to consistently reproduce this problem with the "Visual
Studio 12 2013 ARM" generator.


Steps to Reproduce: 
I attach a Windows batch file called "cmake-mantis.bat" that will reproduce the
two cases, successful and unsuccessful.  Here are the steps:

(1) Copy the Windows batch file "cmake-matis.bat" to any folder in the file
system.

(2) "cd" to above folder.

(3) To reproduce an unsuccessful run, execute the following command:

    cmake-mantis.bat bad

    In this case, the folder from where CMake is execute is:

   
%TEMP%\CMakeTest\12345678901234567890\12345678901234567890\12345678901234567890\12345678901234567890\12345678901234567890

(4) To reproduce a successful run, execute the following command:

    cmake-mantis.bat good

    In this case, the folder from which CMake is executed is:

    %TEMP%\CMakeTest

(5) The batch file leaves the try_compile build trees intact for debugging
purposes.


Additional Information: 
I added the "--trace" command line option for both the 'good' and the 'bad' runs
and have uploaded them as the files "foo.good" and "foo.bad".  Doing a diff on
them both shows the following strange phenomenon: both logs are essentially
identical (except for folder names) until foo.good:2649 and foo.bad:2650.  At
this point, inexplicably, CMAKE_C_COMPILER_WORKS is TRUE in foo.good but FALSE
in goo.bad:

Starting at line 2649 in foo.good:

<snippet>
C:/Program Files
(x86)/CMake/share/cmake-3.1/Modules/CMakeTestCCompiler.cmake(56):  if(NOT
CMAKE_C_COMPILER_WORKS )
C:/Program Files
(x86)/CMake/share/cmake-3.1/Modules/CMakeTestCCompiler.cmake(65):  else()
C:/Program Files
(x86)/CMake/share/cmake-3.1/Modules/CMakeTestCCompiler.cmake(66): 
if(C_TEST_WAS_RUN )
C:/Program Files
(x86)/CMake/share/cmake-3.1/Modules/CMakeTestCCompiler.cmake(67): 
PrintTestCompilerStatus(C  -- works )
C:/Program Files
(x86)/CMake/share/cmake-3.1/Modules/CMakeTestCompilerCommon.cmake(16): 
if(CMAKE_GENERATOR MATCHES Make )
C:/Program Files
(x86)/CMake/share/cmake-3.1/Modules/CMakeTestCompilerCommon.cmake(18):  else()
C:/Program Files
(x86)/CMake/share/cmake-3.1/Modules/CMakeTestCompilerCommon.cmake(19): 
message(STATUS Check for working ${LANG} compiler using:
${CMAKE_GENERATOR}${MSG} )
-- Check for working C compiler using: Visual Studio 12 2013 ARM -- works
</snippet>

Starting at line 2650 in foo.bad:

<snippet>
C:/Program Files
(x86)/CMake/share/cmake-3.1/Modules/CMakeTestCCompiler.cmake(56):  if(NOT
CMAKE_C_COMPILER_WORKS )
C:/Program Files
(x86)/CMake/share/cmake-3.1/Modules/CMakeTestCCompiler.cmake(57): 
PrintTestCompilerStatus(C  -- broken )
C:/Program Files
(x86)/CMake/share/cmake-3.1/Modules/CMakeTestCompilerCommon.cmake(16): 
if(CMAKE_GENERATOR MATCHES Make )
C:/Program Files
(x86)/CMake/share/cmake-3.1/Modules/CMakeTestCompilerCommon.cmake(18):  else()
C:/Program Files
(x86)/CMake/share/cmake-3.1/Modules/CMakeTestCompilerCommon.cmake(19): 
message(STATUS Check for working ${LANG} compiler using:
${CMAKE_GENERATOR}${MSG} )
-- Check for working C compiler using: Visual Studio 12 2013 ARM -- broken
</snippet>

There are no differences in the traces leading up to these points to explain the
discrepancy.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-01-21 13:45 Moshe Rubin    New Issue                                    
======================================================================



More information about the cmake-developers mailing list