Skip to content

Commit 2d8cf9d

Browse files
committed
build: explicitly specify the python path
This ensures that we use python 2.7 when building LLVM. The LLVM tooling has not yet been ported to python 3, and this breaks the CI builds which are now finding python 3 via `PATH`.
1 parent de364ce commit 2d8cf9d

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

utils/build-script-impl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,10 @@ function set_build_options_for_host() {
669669
-DCOMPILER_RT_ENABLE_TVOS:BOOL=FALSE
670670
-DSANITIZER_MIN_OSX_VERSION="${cmake_osx_deployment_target}"
671671
-DLLVM_ENABLE_MODULES:BOOL="$(true_false ${LLVM_ENABLE_MODULES})"
672+
# NOTE(compnerd) this explicitly sets up the python executable
673+
# since we sometimes end up with python 3 and the tooling
674+
# currently relies on python 2.7
675+
-DPYTHON_EXECUTABLE:PATH=/usr/bin/python2.7
672676
)
673677
if [[ $(is_llvm_lto_enabled) == "TRUE" ]]; then
674678
if [[ $(cmake_needs_to_specify_standard_computed_defaults) == "TRUE" ]]; then
@@ -2558,6 +2562,21 @@ for host in "${ALL_HOSTS[@]}"; do
25582562
cmake_options+=(
25592563
-DLLDB_CODESIGN_IDENTITY=""
25602564
-DLLDB_USE_SYSTEM_DEBUGSERVER:BOOL="${LLDB_USE_SYSTEM_DEBUGSERVER}"
2565+
2566+
# NOTE(compnerd) this explicitly sets up the python
2567+
# executable since we sometimes end up with python 3 and
2568+
# the tooling currently relies on python 2.7
2569+
-DPython_ADDITIONAL_VERSIONS="2.7"
2570+
-DPYTHON_EXECUTABLE:PATH=/usr/bin/python2.7
2571+
-DPYTHON_LIBRARY="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)/System/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.tbd"
2572+
-DPYTHON_INCLUDE_DIR="$(xcrun --sdk ${xcrun_sdk_name} --show-sdk-path)/System/Library/Frameworks/Python.framework/Headers"
2573+
)
2574+
else
2575+
cmake_options+=(
2576+
# NOTE(compnerd) this explicitly sets up the python
2577+
# executable since we sometimes end up with python 3 and
2578+
# the tooling currently relies on python 2.7
2579+
-DPYTHON_EXECUTABLE:PATH=/usr/bin/python2.7
25612580
)
25622581
fi
25632582
fi

0 commit comments

Comments
 (0)