Skip to content

Commit 38f8ca4

Browse files
committed
Build py3.15 wheels against the manylinux python.org interpreter (not conda)
Python 3.15 is still in pre-release and its C-API/ABI is not frozen. conda-forge's python=3.15.0a* does not match the python.org alpha that the torch nightly cp315 wheels are built against, so importing torch under a conda 3.15 interpreter segfaults during module init (observed as 'python setup.py clean' crashing with SIGSEGV / exit 139 in the torchvision and torchaudio cp315 builds). For 3.15/3.15t, skip conda and build against the manylinux python.org interpreter that produced the torch wheels (/opt/python/cp315-cp315[t]). pkg-helpers already prepends that interpreter's bin to PATH via BUILD_ENV_FILE, so setting CONDA_RUN='' makes the whole build and smoke test resolve to it -- no ABI skew. Build tooling (cmake/ninja/wheel) is pip installed; libpng/libjpeg/libwebp/pkg-config come from the manylinux image's system packages. All other Python versions keep the conda path.
1 parent 13a750a commit 38f8ca4

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

.github/actions/setup-binary-builds/action.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,40 @@ runs:
129129
set -euxo pipefail
130130
CONDA_ENV="${RUNNER_TEMP}/conda_environment_${GITHUB_RUN_ID}"
131131
export CONDA_EXTRA_PARAM=""
132+
133+
# Python 3.15 is still in pre-release and its C-API/ABI is not frozen.
134+
# conda-forge's python=3.15.0a* does not match the python.org alpha the
135+
# torch nightly cp315 wheels are built against, so importing torch under
136+
# the conda interpreter segfaults during module init. Build against the
137+
# manylinux python.org interpreter that produced the torch wheels
138+
# instead of conda. pkg-helpers already prepends /opt/python/<abi>/bin
139+
# to PATH via BUILD_ENV_FILE, so an empty CONDA_RUN makes every
140+
# `${CONDA_RUN} python|pip` in the build resolve to that interpreter --
141+
# no ABI skew. We only install the build tooling conda used to provide.
142+
case $PYTHON_VERSION in
143+
3.15) MANYLINUX_PYTHON=/opt/python/cp315-cp315/bin/python ;;
144+
3.15t) MANYLINUX_PYTHON=/opt/python/cp315-cp315t/bin/python ;;
145+
*) MANYLINUX_PYTHON="" ;;
146+
esac
147+
148+
if [ -n "${MANYLINUX_PYTHON}" ]; then
149+
if [ ! -x "${MANYLINUX_PYTHON}" ]; then
150+
echo "::error::Expected manylinux interpreter ${MANYLINUX_PYTHON} not found in build image"
151+
exit 1
152+
fi
153+
"${MANYLINUX_PYTHON}" -m pip install --upgrade pip
154+
# Match the build-tooling versions pinned for the conda path below.
155+
# (libpng/libjpeg/libwebp/pkg-config come from the manylinux image's
156+
# system packages rather than conda.)
157+
"${MANYLINUX_PYTHON}" -m pip install \
158+
"cmake==3.31.2" \
159+
"ninja==1.12.1" \
160+
"wheel==0.37.1"
161+
echo "CONDA_ENV=$(dirname "$(dirname "${MANYLINUX_PYTHON}")")" >> "${GITHUB_ENV}"
162+
echo "CONDA_RUN=" >> "${GITHUB_ENV}"
163+
exit 0
164+
fi
165+
132166
conda install -y conda=25.3.0
133167
134168
# shellcheck disable=SC2153

0 commit comments

Comments
 (0)