Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 45cc58a

Browse files
committedJul 11, 2021
python version agnostic
1 parent 312a878 commit 45cc58a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed
 

‎bin/ch/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
2+
find_package (Python COMPONENTS Interpreter)
13
add_custom_target(dbg_controller_h
2-
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/jstoc.py ${CMAKE_CURRENT_SOURCE_DIR}/DbgController.js controllerScript
4+
COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/jstoc.py ${CMAKE_CURRENT_SOURCE_DIR}/DbgController.js controllerScript
35
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
46
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/jstoc.py ${CMAKE_CURRENT_SOURCE_DIR}/DbgController.js
57
)

‎build.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ CMAKE_EXPORT_COMPILE_COMMANDS="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
127127
LIBS_ONLY_BUILD=
128128
ALWAYS_YES=
129129
CCACHE_NAME=
130-
PYTHON2_BINARY=$(which python2.7 || which python2 || which python 2> /dev/null)
130+
PYTHON_BINARY=$(which python3 || which python || which python2.7 || which python2 || which python 2> /dev/null)
131131

132132
UNAME_S=`uname -s`
133133
if [[ $UNAME_S =~ 'Linux' ]]; then
@@ -538,7 +538,7 @@ export TARGET_PATH
538538

539539
if [[ $HAS_LTTNG == 1 ]]; then
540540
CHAKRACORE_ROOT=`dirname $0`
541-
"$PYTHON2_BINARY" $CHAKRACORE_ROOT/tools/lttng.py --man $CHAKRACORE_ROOT/manifests/Microsoft-Scripting-Chakra-Instrumentation.man --intermediate $TARGET_PATH/intermediate
541+
"$PYTHON_BINARY" $CHAKRACORE_ROOT/tools/lttng.py --man $CHAKRACORE_ROOT/manifests/Microsoft-Scripting-Chakra-Instrumentation.man --intermediate $TARGET_PATH/intermediate
542542
mkdir -p $TARGET_PATH/lttng
543543
(diff -q $TARGET_PATH/intermediate/lttng/jscriptEtw.h $TARGET_PATH/lttng/jscriptEtw.h && echo "jscriptEtw.h up to date; skipping") || cp $TARGET_PATH/intermediate/lttng/* $TARGET_PATH/lttng/
544544
fi
@@ -553,8 +553,8 @@ fi
553553
BUILD_DIRECTORY="${TARGET_PATH}/${BUILD_TYPE_DIR:0}"
554554
echo "Build path: ${BUILD_DIRECTORY}"
555555

556-
BUILD_RELATIVE_DIRECTORY=$("$PYTHON2_BINARY" -c "import os.path;print \
557-
os.path.relpath('${CHAKRACORE_DIR}', '$BUILD_DIRECTORY')")
556+
BUILD_RELATIVE_DIRECTORY=$("$PYTHON_BINARY" -c "from __future__ import print_function; import os.path;\
557+
print(os.path.relpath('${CHAKRACORE_DIR}', '$BUILD_DIRECTORY'))")
558558

559559
################# Write-barrier check/analyze run #################
560560
WB_FLAG=

0 commit comments

Comments
 (0)
Please sign in to comment.