From b8a93ea34826f2a42026744ac52d790895c0e580 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Wed, 13 Apr 2022 13:51:22 -0400 Subject: [PATCH] jjb: Add support for python3.10 in build scripts Change-Id: I9aae281e89602c18970d5e2d9d497a3017e14127 Signed-off-by: Michael Jeanson --- scripts/lttng-analyses/build.sh | 2 +- scripts/lttng-analyses/pylint.sh | 2 +- scripts/lttng-ivc/build.sh | 2 +- scripts/lttng-tools/build.sh | 4 ++-- scripts/lttng-tools/release.sh | 4 ++-- scripts/lttng-ust-benchmarks/build.sh | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/lttng-analyses/build.sh b/scripts/lttng-analyses/build.sh index de86ae8..8f06e69 100755 --- a/scripts/lttng-analyses/build.sh +++ b/scripts/lttng-analyses/build.sh @@ -23,7 +23,7 @@ set -exu SRCDIR="src/lttng-analyses" PYTHON3="python3" -P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])") +P3_VERSION=$($PYTHON3 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))') BABELTRACE_DIR=$WORKSPACE/deps/babeltrace/build diff --git a/scripts/lttng-analyses/pylint.sh b/scripts/lttng-analyses/pylint.sh index 426fcc4..7f3ec6e 100755 --- a/scripts/lttng-analyses/pylint.sh +++ b/scripts/lttng-analyses/pylint.sh @@ -20,7 +20,7 @@ set -exu SRCDIR="src/lttng-analyses" PYTHON3="python3" -P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])") +P3_VERSION=$($PYTHON3 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))') BABELTRACE_DIR=$WORKSPACE/deps/babeltrace/build diff --git a/scripts/lttng-ivc/build.sh b/scripts/lttng-ivc/build.sh index 08f6b9b..83cbefc 100644 --- a/scripts/lttng-ivc/build.sh +++ b/scripts/lttng-ivc/build.sh @@ -16,7 +16,7 @@ # along with this program. If not, see . PYTHON3="python3" -P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])") +P3_VERSION=$($PYTHON3 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))') # Tox does not support long path venv for whatever reason. PYENV_HOME=$(mktemp -d) diff --git a/scripts/lttng-tools/build.sh b/scripts/lttng-tools/build.sh index 9454269..b54b6fc 100755 --- a/scripts/lttng-tools/build.sh +++ b/scripts/lttng-tools/build.sh @@ -275,8 +275,8 @@ cygwin|cygwin64|msys32|msys64) PYTHON2=python2 PYTHON3=python3 - P2_VERSION=$($PYTHON2 -c "import sys;print(sys.version[:3])") - P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])") + P2_VERSION=$($PYTHON2 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))') + P3_VERSION=$($PYTHON3 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))') DEPS_PYTHON2="$WORKSPACE/deps/build/lib/python$P2_VERSION/site-packages" DEPS_PYTHON3="$WORKSPACE/deps/build/lib/python$P3_VERSION/site-packages" diff --git a/scripts/lttng-tools/release.sh b/scripts/lttng-tools/release.sh index a199494..c6e6ce2 100644 --- a/scripts/lttng-tools/release.sh +++ b/scripts/lttng-tools/release.sh @@ -128,8 +128,8 @@ PYTHON3=python3 export PYTHON="$PYTHON3" export PYTHON_CONFIG="/usr/bin/$PYTHON3-config" -P2_VERSION=$($PYTHON2 -c "import sys;print(sys.version[:3])") -P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])") +P2_VERSION=$($PYTHON2 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))') +P3_VERSION=$($PYTHON3 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))') UST_PYTHON2="$WORKSPACE/deps/build/lib/python$P2_VERSION/site-packages" UST_PYTHON3="$WORKSPACE/deps/build/lib/python$P3_VERSION/site-packages" diff --git a/scripts/lttng-ust-benchmarks/build.sh b/scripts/lttng-ust-benchmarks/build.sh index a2799b9..13e6d63 100644 --- a/scripts/lttng-ust-benchmarks/build.sh +++ b/scripts/lttng-ust-benchmarks/build.sh @@ -25,7 +25,7 @@ rm -rf "$WORKSPACE/build" mkdir -p "$WORKSPACE/build" PYTHON3=python3 -P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])") +P3_VERSION=$($PYTHON3 -c 'import sys;v = sys.version.split()[0].split("."); print("{}.{}".format(v[0], v[1]))') # liburcu URCU_INCS="$WORKSPACE/deps/liburcu/build/include/" -- 2.34.1