Skip to content

Commit 8969cef

Browse files
committed
Update build_python.sh to build JIT versions of Python if requested
1 parent ad17dac commit 8969cef

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/build_python.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@ py_version="${1}"
88
# By dropping everything after, and including, the last period or hyphen.
99
install_path="${py_version%[-.]*}"
1010

11-
# If python version ends with a t, then ensure Python is installed to a dir ending with a t.
11+
# Ensure the suffix letter is retained for free-threaded or JIT versions of Python.
1212
if [[ $py_version == *t ]]; then
1313
install_path+="t"
1414
fi
1515

16+
if [[ $py_version == *j ]]; then
17+
# Enable JIT mode when passed a version that ends with a "j"
18+
install_path+="j"
19+
py_version="${py_version%j}"
20+
PYTHON_CONFIGURE_OPTS+=" --enable-experimental-jit"
21+
fi
22+
1623
"${PYENV_ROOT}/plugins/python-build/bin/python-build" \
1724
"${py_version}" \
1825
"/snekbin/python/${install_path}"

0 commit comments

Comments
 (0)