swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.66k stars 10.38k forks source link

[SR-7320] GYB is run with python, not python2.7 #49868

Open swift-ci opened 6 years ago

swift-ci commented 6 years ago
Previous ID SR-7320
Radar None
Original Reporter sanxiyn (JIRA User)
Type Bug
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | | |Labels | Bug, CMake, StarterBug | |Assignee | None | |Priority | Medium | md5: a456e83bcda5542ee8cf2382f8fa9b21

Issue Description:

https://github.com/apple/swift/pull/1535 made GYB run with python2.7, but https://github.com/apple/swift/pull/6463 effectively reverted the change because GYB is run with PYTHON_EXECUTABLE instead of using shebang line. This causes the problem 1535 fixed to reappear.

belkadan commented 6 years ago

Sounds like the way to fix this is to change the following line in the top-level CMakeLists.txt:

find_package(PythonInterp REQUIRED)

to

find_package(PythonInterp 2.7 REQUIRED)
if(…) # check if 2.7 wasn't found
  find_package(PythonInterp 3 REQUIRED)
endif()

and then test it, because I just wrote that here without trying it myself.