View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013818CMakeModulespublic2012-12-28 15:042016-06-10 14:31
ReporterReid Kleckner 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformCygwinOSWindowsOS Version7
Product VersionCMake 2.8.10.2 
Target VersionFixed in Version 
Summary0013818: FindPythonInterp finds a cygwin symlink which can't be used with execute_process
DescriptionI'm using native Windows CMake from a Cygwin shell, so Cygwin Python is on my PATH. My /usr/bin looks like:
$ ll /usr/bin/python*
lrwxrwxrwx 1 rnk Domain Users 13 Aug 20 18:35 /usr/bin/python -> python2.6.exe
-rwxr-xr-x 1 rnk Domain Users 4622 Jun 9 2012 /usr/bin/python2.6.exe
-rwxr-xr-x 1 rnk Domain Users 1419 Jun 9 2012 /usr/bin/python2.6-config
lrwxrwxrwx 1 rnk Domain Users 16 Aug 20 18:35 /usr/bin/python-config -> python2.6-config

FindPythonInterp.cmake uses find_program() with "python" first, which succeeds.

This is a reasonable result to return, but then execute_process fails on the Cygwin symlink file. It doesn't seem reasonable for native Windows CMake to know how to follow Cygwin symlinks, so maybe find_program should fail on such symlinks, or FindPythonInterp should test that it can actually execute the python executable, and fall back to its version based queries.

As a workaround, it's pretty easy for me to point it at the right executable.
Steps To ReproduceInstall or build native Windows CMake
In a Cygwin shell, run cmake on this script:

include(FindPythonInterp)
if( NOT PYTHONINTERP_FOUND )
  message(FATAL_ERROR "can't find python")
endif ()

execute_process(
  COMMAND ${PYTHON_EXECUTABLE} -c "print \"hello\"" RESULT_VARIABLE result)
if (NOT "${result}" STREQUAL "0")
  message(FATAL_ERROR "PYTHON_EXECUTABLE failed, is it a symlink?")
endif ()
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0042186)
Kitware Robot (administrator)
2016-06-10 14:28

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2012-12-28 15:04 Reid Kleckner New Issue
2016-06-10 14:28 Kitware Robot Note Added: 0042186
2016-06-10 14:28 Kitware Robot Status new => resolved
2016-06-10 14:28 Kitware Robot Resolution open => moved
2016-06-10 14:28 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team