aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2025-10-11 02:33:38 +0100
committerGravatar Joe Banks <[email protected]>2025-10-13 01:37:47 +0100
commit8969cef61cba6b8d94167498c93fadb01f069552 (patch)
tree0f1a3c58d41b3f230b030253df812e87c62fd86a
parentReduce PID limits for test_forkbomb_resource_unavailable (diff)
Update build_python.sh to build JIT versions of Python if requested
-rwxr-xr-xscripts/build_python.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/build_python.sh b/scripts/build_python.sh
index d026eb8..7b1fce5 100755
--- a/scripts/build_python.sh
+++ b/scripts/build_python.sh
@@ -8,11 +8,18 @@ py_version="${1}"
# By dropping everything after, and including, the last period or hyphen.
install_path="${py_version%[-.]*}"
-# If python version ends with a t, then ensure Python is installed to a dir ending with a t.
+# Ensure the suffix letter is retained for free-threaded or JIT versions of Python.
if [[ $py_version == *t ]]; then
install_path+="t"
fi
+if [[ $py_version == *j ]]; then
+ # Enable JIT mode when passed a version that ends with a "j"
+ install_path+="j"
+ py_version="${py_version%j}"
+ PYTHON_CONFIGURE_OPTS+=" --enable-experimental-jit"
+fi
+
"${PYENV_ROOT}/plugins/python-build/bin/python-build" \
"${py_version}" \
"/snekbin/python/${install_path}"