Skip to content

Commit 3a66be9

Browse files
committed
Images should contain subdirectory for version
This is to help for the libpath problem that snekbox is experiencing because the default library search path is changed when we copy files.
1 parent 207a0b3 commit 3a66be9

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

scripts/build_python.sh

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,29 @@ shopt -s inherit_errexit
44

55
py_version="${1}"
66

7+
# Install Python interpreter under e.g. /snekbin/python/3.13/ (no patch version)
8+
# By dropping everything after, and including, the last period or hyphen.
9+
install_path="${py_version%[-.]*}"
10+
11+
# Ensure the suffix letter is retained for free-threaded or JIT versions of Python.
12+
if [[ $py_version == *t ]]; then
13+
install_path+="t"
14+
fi
15+
716
if [[ $py_version == *j ]]; then
817
# Enable JIT mode when passed a version that ends with a "j"
18+
install_path+="j"
919
py_version="${py_version%j}"
1020
PYTHON_CONFIGURE_OPTS+=" --enable-experimental-jit"
1121
fi
1222

1323
"${PYENV_ROOT}/plugins/python-build/bin/python-build" \
1424
"${py_version}" \
15-
"/snekbin/"
16-
"/snekbin/bin/python" -m pip install -U pip
25+
"/snekbin/python/${install_path}"
26+
"/snekbin/python/${install_path}/bin/python" -m pip install -U pip
1727

1828
# Clean up some unnecessary files to reduce image size bloat.
19-
find /snekbin/ -depth \
29+
find /snekbin/python/ -depth \
2030
\( \
2131
\( -type d -a \( \
2232
-name test -o -name tests -o -name idle_test \

0 commit comments

Comments
 (0)