From 8969cef61cba6b8d94167498c93fadb01f069552 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sat, 11 Oct 2025 02:33:38 +0100 Subject: Update build_python.sh to build JIT versions of Python if requested --- scripts/build_python.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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}" -- cgit v1.2.3