Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
f3a7a0b
PKG-15601 + PKG-2624: CF-align freethreading and debug build_type
skupr-anaconda Jul 6, 2026
e32cdb0
Fix PBP linter: script list form and only-lint scope
skupr-anaconda Jul 6, 2026
b65984a
Fix PBP graph submission: revert script YAML lists to duplicate strin…
skupr-anaconda Jul 6, 2026
1f1068f
Fix debug builds and freethreading cmake test failures
skupr-anaconda Jul 6, 2026
70a3862
Fix debug build install path and linter unknown_check warning
skupr-anaconda Jul 7, 2026
d9535a4
Fix debug libpython-static install paths in build_static.sh
skupr-anaconda Jul 7, 2026
8890722
Build nolto pic lib using STDLIB_VER for debug variants
skupr-anaconda Jul 7, 2026
734981e
Fix debug cmake tests, skip python-jit on debug, clear osx profraw
skupr-anaconda Jul 7, 2026
a2c29f6
Skip cmake test on debug builds instead of debug ABI symlinks
skupr-anaconda Jul 7, 2026
91ad6ee
Use VERABI_NO_DBG
skupr-anaconda Jul 9, 2026
79bd3de
Align build scripts and tests with conda-forge patterns.
skupr-anaconda Jul 9, 2026
6814327
Fix CI failures from graph 13f6ff7c: JIT skip, win nuget, CF nits.
skupr-anaconda Jul 9, 2026
26b5506
Win32: use CONDA_PYTHON_EXE instead of nuget for PCbuild.
skupr-anaconda Jul 9, 2026
30c1cca
PKG-15601/PKG-2624 — address review: cmake debug skip, win paths, cma…
skupr-anaconda Aug 18, 2026
c7ef41e
PKG-15601/PKG-2624 — finish conda-forge review alignment
skupr-anaconda Aug 19, 2026
a114f80
PKG-17264 — port 3.15.0rc1 + LLVM21 onto CF-align for main
skupr-anaconda Aug 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions abs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ build_parameters:
- "--error-overlinking"
- "--error-overdepending"

# Upload all testing artifacts on a labeled testing channel: ad-testing/label/py315
upload_channels:
- ad-testing/label/py315
# Destination: pkgs/main (PBP default). Do not set upload_channels or labeled
# testing channels — this branch delivers CF-align freethreading/debug for main.
build_env_vars:
ANACONDA_ROCKET_ENABLE_PY315: yes
2 changes: 1 addition & 1 deletion recipe/build_base.bat
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if "%DEBUG_C%"=="yes" (
set PGO=--pgo
)

if "%PY_GIL_DISABLED%" == "yes" (
if "%PY_FREETHREADING%" == "yes" (
set "FREETHREADING=--disable-gil"
set "THREAD=t"
set "EXE_T=%VER%t"
Expand Down
107 changes: 45 additions & 62 deletions recipe/build_base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,46 +33,33 @@ _buildd_shared=build-shared
_ENABLE_SHARED=--enable-shared
# We *still* build a shared lib here for non-static embedded use cases
_DISABLE_SHARED=--disable-shared
# Hack to allow easily comparing static vs shared interpreter performance
# .. hack because we just build it shared in both the build-static and
# build-shared directories.
# Yes this hack is a bit confusing, sorry about that.
if [[ ${PY_INTERP_LINKAGE_NATURE} == shared ]]; then
_DISABLE_SHARED=--enable-shared
_ENABLE_SHARED=--enable-shared
fi

# For debugging builds, set this to no to disable profile-guided optimization
if [[ ${DEBUG_C} == yes ]]; then
if [[ ${PY_INTERP_DEBUG} == yes ]]; then
_OPTIMIZED=no
else
_OPTIMIZED=yes
fi

if [[ ${target_platform} == linux-ppc64le ]]; then
_OPTIMIZED=no
# ppc64le cdt need to be rebuilt with files in powerpc64le-conda-linux-gnu instead of powerpc64le-conda_cos7-linux-gnu. In the mean time:
cp --force --archive --update --link $BUILD_PREFIX/powerpc64le-conda_cos7-linux-gnu/. $BUILD_PREFIX/powerpc64le-conda-linux-gnu
fi

declare -a _dbg_opts
if [[ ${DEBUG_PY} == yes ]]; then
if [[ ${PY_INTERP_DEBUG} == yes ]]; then
# This Python will not be usable with non-debug Python modules.
_dbg_opts+=(--with-pydebug)
DBG=d
else
DBG=
fi

if [[ ${PY_GIL_DISABLED} == yes ]]; then
if [[ ${PY_FREETHREADING} == yes ]]; then
# This Python will not be usable with non-free threading Python modules.
THREAD=t
else
THREAD=
fi

ABIFLAGS=${DBG}
ABIFLAGS=${DBG}${THREAD}
VERABI=${VER}${THREAD}${DBG}
VERABI_NO_DBG=${VER}${THREAD}

# Make sure the "python" value in conda_build_config.yaml is up to date.
test "${PY_VER}" = "${VER}"
Expand All @@ -83,7 +70,7 @@ test "${PY_VER}" = "${VER}"
unset _PYTHON_SYSCONFIGDATA_NAME
unset _CONDA_PYTHON_SYSCONFIGDATA_NAME

# Prevent lib/python${VERABI}/_sysconfigdata_*.py from ending up with full paths to these things
# Prevent lib/python${VERABI_NO_DBG}/_sysconfigdata_*.py from ending up with full paths to these things
# in _build_env because _build_env will not get found during prefix replacement, only _h_env_placeh ...
AR=$(basename "${AR}")

Expand Down Expand Up @@ -111,6 +98,12 @@ if [[ ${_OPTIMIZED} = yes ]]; then
CXXFLAGS=$(echo "${CXXFLAGS}" | sed "s/-O2/-O3/g")
fi

if [[ ${PY_INTERP_DEBUG} == yes ]]; then
CPPFLAGS=$(echo "${CPPFLAGS}" | sed "s/-O2/-O0/g")
CFLAGS=$(echo "${CFLAGS}" | sed "s/-O2/-O0/g")
CXXFLAGS=$(echo "${CXXFLAGS}" | sed "s/-O2/-O0/g")
fi

if [[ "$target_platform" == linux-* ]]; then
cp ${PREFIX}/include/uuid/uuid.h ${PREFIX}/include/uuid.h
fi
Expand Down Expand Up @@ -207,7 +200,7 @@ if [[ ${target_platform} == osx-64 ]]; then
# TODO: check with LLVM 12 if the following hack is needed.
# https://reviews.llvm.org/D76461 may have fixed the need for the following hack.
echo '#!/bin/bash' > $BUILD_PREFIX/bin/$HOST-llvm-ar
echo "$BUILD_PREFIX/bin/llvm-ar --format=darwin" '"$@"' >> $BUILD_PREFIX/bin/$HOST-llvm-ar
echo "$BUILD_PREFIX/bin/llvm-ar-21 --format=darwin" '"$@"' >> $BUILD_PREFIX/bin/$HOST-llvm-ar
chmod +x $BUILD_PREFIX/bin/$HOST-llvm-ar
export ARCHFLAGS="-arch x86_64"
elif [[ ${target_platform} == osx-arm64 ]]; then
Expand All @@ -216,7 +209,7 @@ elif [[ ${target_platform} == osx-arm64 ]]; then
export ac_sys_release=20.0.0
export MACOSX_DEFAULT_ARCH=arm64
echo '#!/bin/bash' > $BUILD_PREFIX/bin/$HOST-llvm-ar
echo "$BUILD_PREFIX/bin/llvm-ar --format=darwin" '"$@"' >> $BUILD_PREFIX/bin/$HOST-llvm-ar
echo "$BUILD_PREFIX/bin/llvm-ar-21 --format=darwin" '"$@"' >> $BUILD_PREFIX/bin/$HOST-llvm-ar
chmod +x $BUILD_PREFIX/bin/$HOST-llvm-ar
export ARCHFLAGS="-arch arm64"
export CFLAGS="$CFLAGS $ARCHFLAGS"
Expand Down Expand Up @@ -258,7 +251,7 @@ _common_configure_args+=("--with-tcltk-libs=-L${PREFIX}/lib -ltcl${TCLTK_VER} -l
_common_configure_args+=(--with-platlibdir=lib)
_common_configure_args+=(--with-system-libmpdec=yes)

if [[ "${DEBUG_PY}" == "yes" || "${target_platform}" != *"64" || ${PY_GIL_DISABLED} == yes ]]; then
if [[ "${PY_INTERP_DEBUG}" == "yes" || "${target_platform}" != *"-64" || ${PY_FREETHREADING} == yes ]]; then
_common_configure_args+=(--enable-experimental-jit=no)
else
_common_configure_args+=(--enable-experimental-jit=yes-off)
Expand All @@ -269,7 +262,7 @@ if [[ "${target_platform}" == osx-* ]]; then
_common_configure_args+=(--with-tail-call-interp)
fi

if [[ ${PY_GIL_DISABLED} == yes ]]; then
if [[ ${PY_FREETHREADING} == yes ]]; then
_common_configure_args+=(--disable-gil)
fi

Expand Down Expand Up @@ -365,7 +358,7 @@ fi
# build a static library with PIC objects and without LTO/PGO
make -j${CPU_COUNT} -C ${_buildd_shared} \
EXTRA_CFLAGS="${EXTRA_CFLAGS}" \
LIBRARY=libpython${VERABI}-pic.a libpython${VERABI}-pic.a
LIBRARY=libpython${VERABI_NO_DBG}-pic.a libpython${VERABI_NO_DBG}-pic.a

make -C ${_buildd_static} install

Expand Down Expand Up @@ -397,15 +390,17 @@ fi
SYSCONFIG=$(find ${_buildd_static}/$(cat ${_buildd_static}/pybuilddir.txt) -name "_sysconfigdata*.py" -print0)
cat ${SYSCONFIG} | ${SYS_PYTHON} "${RECIPE_DIR}"/replace-word-pairs.py \
"${_FLAGS_REPLACE[@]}" \
> ${PREFIX}/lib/python${VERABI}/$(basename ${SYSCONFIG})
MAKEFILE=$(find ${PREFIX}/lib/python${VERABI}/ -path "*config-*/Makefile" -print0)
> ${PREFIX}/lib/python${VERABI_NO_DBG}/$(basename ${SYSCONFIG})
BUILD_DETAILS=${_buildd_shared}/$(cat ${_buildd_shared}/pybuilddir.txt)/build-details.json
cp ${BUILD_DETAILS} ${PREFIX}/lib/python${VERABI_NO_DBG}/
MAKEFILE=$(find ${PREFIX}/lib/python${VERABI_NO_DBG}/ -path "*config-*/Makefile" -print0)
cp ${MAKEFILE} /tmp/Makefile-$$
cat /tmp/Makefile-$$ | ${SYS_PYTHON} "${RECIPE_DIR}"/replace-word-pairs.py \
"${_FLAGS_REPLACE[@]}" \
> ${MAKEFILE}
# Check to see that our differences took.
# echo diff -urN ${SYSCONFIG} ${PREFIX}/lib/python${VERABI}/$(basename ${SYSCONFIG})
# diff -urN ${SYSCONFIG} ${PREFIX}/lib/python${VERABI}/$(basename ${SYSCONFIG})
# echo diff -urN ${SYSCONFIG} ${PREFIX}/lib/python${VERABI_NO_DBG}/$(basename ${SYSCONFIG})
# diff -urN ${SYSCONFIG} ${PREFIX}/lib/python${VERABI_NO_DBG}/$(basename ${SYSCONFIG})

# Python installs python${VER}m and python${VER}, one as a hardlink to the other. conda-build breaks these
# by copying. Since the executable may be static it may be very large so change one to be a symlink
Expand All @@ -425,7 +420,7 @@ ln -s ${PREFIX}/bin/python${VER} ${PREFIX}/bin/python3.1
# Remove test data to save space
# Though keep `support` as some things use that.
# TODO :: Make a subpackage for this once we implement multi-level testing.
pushd ${PREFIX}/lib/python${VERABI}
pushd ${PREFIX}/lib/python${VERABI_NO_DBG}
mkdir test_keep
mv test/__init__.py test/support test/test_support* test/test_script_helper* test_keep/
rm -rf test */test
Expand All @@ -438,33 +433,17 @@ pushd ${PREFIX}
chmod +w lib/libpython${VERABI}.a
${STRIP} -S lib/libpython${VERABI}.a
fi
CONFIG_LIBPYTHON=$(find lib/python${VERABI}/config-${VERABI}* -name "libpython${VERABI}.a")
CONFIG_LIBPYTHON=$(find lib/python${VERABI_NO_DBG}/config-${VERABI}* -name "libpython${VERABI}.a")
if [[ -f lib/libpython${VERABI}.a ]] && [[ -f ${CONFIG_LIBPYTHON} ]]; then
chmod +w ${CONFIG_LIBPYTHON}
rm ${CONFIG_LIBPYTHON}
fi
popd

# OLD_HOST is with CentOS version in them. When building this recipe
# with the compilers from conda-forge OLD_HOST != HOST, but when building
# with the compilers from defaults OLD_HOST == HOST. Both cases are handled in the
# code below
case "$target_platform" in
linux-64)
OLD_HOST=$(echo ${HOST} | sed -e 's/-conda-/-conda_cos6-/g')
;;
linux-*)
OLD_HOST=$(echo ${HOST} | sed -e 's/-conda-/-conda_cos7-/g')
;;
*)
OLD_HOST=$HOST
;;
esac

# Copy sysconfig that gets recorded to a non-default name
# using the new compilers with python will require setting _PYTHON_SYSCONFIGDATA_NAME
# to the name of this file (minus the .py extension)
pushd "${PREFIX}"/lib/python${VERABI}
pushd "${PREFIX}"/lib/python${VERABI_NO_DBG}
# On Python 3.5 _sysconfigdata.py was getting copied in here and compiled for some reason.
# This breaks our attempt to find the right one as recorded_name.
find lib-dynload -name "_sysconfigdata*.py*" -exec rm {} \;
Expand All @@ -479,9 +458,9 @@ pushd "${PREFIX}"/lib/python${VERABI}
# Append the conda-forge zoneinfo to the end
sed -i.bak "s@zoneinfo'@zoneinfo:$PREFIX/share/tzinfo'@g" sysconfigfile
# Remove osx sysroot as it depends on the build machine
sed -i.bak "s@-isysroot @@g" sysconfigfile
# make sure $CONDA_BUILD_SYSROOT is not empty ...
if [[ ${HOST} =~ .*darwin.* ]] && [[ -n ${CONDA_BUILD_SYSROOT} ]]; then
# be sure CONDA_BUILD_SYSROOT has value, as other we will remove here instead spaces
if [[ "${target_platform}" == osx-* ]] && [[ -n ${CONDA_BUILD_SYSROOT} ]]; then
sed -i.bak "s@-isysroot @@g" sysconfigfile
sed -i.bak "s@$CONDA_BUILD_SYSROOT @@g" sysconfigfile
fi
# Remove unfilled config option
Expand All @@ -491,16 +470,12 @@ pushd "${PREFIX}"/lib/python${VERABI}
sed -i.bak "s/'GNULD': 'yes'/'GNULD': 'no'/g" sysconfigfile
cp sysconfigfile ${our_compilers_name}

sed -i.bak "s@${HOST}@${OLD_HOST}@g" sysconfigfile
old_compiler_name=_sysconfigdata_$(echo ${OLD_HOST} | sed -e 's/[.-]/_/g').py
cp sysconfigfile ${old_compiler_name}

# For system gcc remove the triple
sed -i.bak "s@$OLD_HOST-c++@g++@g" sysconfigfile
sed -i.bak "s@$OLD_HOST-@@g" sysconfigfile
sed -i.bak "s@$HOST-c++@g++@g" sysconfigfile
sed -i.bak "s@$HOST-@@g" sysconfigfile
if [[ "$target_platform" == linux* ]]; then
# For linux, make sure the system gcc uses our linker
sed -i.bak "s@-pthread@-pthread -B $PREFIX/compiler_compat@g" sysconfigfile
sed -i.bak "s@-pthread@-pthread -B $PREFIX/share/python_compiler_compat@g" sysconfigfile
fi
# Don't set -march and -mtune for system gcc
sed -i.bak "s@-march=[^( |\\\"|\\\')]*@@g" sysconfigfile
Expand All @@ -525,14 +500,22 @@ pushd "${PREFIX}"/lib/python${VERABI}
popd

if [[ ${HOST} =~ .*linux.* ]]; then
mkdir -p ${PREFIX}/compiler_compat
ln -s ${PREFIX}/bin/${HOST}-ld ${PREFIX}/compiler_compat/ld
echo "Files in this folder are to enhance backwards compatibility of anaconda software with older compilers." > ${PREFIX}/compiler_compat/README
echo "See: https://github.com/conda/conda/issues/6030 for more information." >> ${PREFIX}/compiler_compat/README
mkdir -p ${PREFIX}/share/python_compiler_compat
ln -s ${PREFIX}/bin/${HOST}-ld ${PREFIX}/share/python_compiler_compat/ld
echo "Files in this folder are to enhance backwards compatibility of anaconda software with older compilers." > ${PREFIX}/share/python_compiler_compat/README
echo "See: https://github.com/conda/conda/issues/6030 for more information." >> ${PREFIX}/share/python_compiler_compat/README
fi

python -c "import compileall,os;compileall.compile_dir(os.environ['PREFIX'])"
rm ${PREFIX}/lib/libpython${VERABI}.a

if [[ ${PY_INTERP_DEBUG} == yes ]]; then
rm ${PREFIX}/bin/python${VER}
ln -s ${PREFIX}/bin/python${VERABI} ${PREFIX}/bin/python${VER}
ln -s ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT} ${PREFIX}/lib/libpython${VERABI_NO_DBG}${SHLIB_EXT}
ln -s ${PREFIX}/include/python${VERABI} ${PREFIX}/include/python${VER}
fi

if [[ "$target_platform" == linux-* ]]; then
rm ${PREFIX}/include/uuid.h
fi
Expand All @@ -550,7 +533,7 @@ fi
# <prefix>/lib/python3.13t/site-packages.
# Note that these directories are not added to sys.path if they do not exist.
SP_DIR="${PREFIX}/lib/python${PY_VER}${THREAD}/site-packages"
if [[ ${PY_GIL_DISABLED} == yes ]]; then
if [[ ${PY_FREETHREADING} == yes ]]; then
echo "${PREFIX}/lib/python${PY_VER}/site-packages" >> $SP_DIR/conda-site.pth
fi
# Workaround for https://github.com/conda/conda/issues/10969
Expand Down
33 changes: 10 additions & 23 deletions recipe/build_static.sh
Original file line number Diff line number Diff line change
@@ -1,46 +1,33 @@
#!/bin/bash
set -ex

cd ${SRC_DIR}

_buildd_static=build-static
_buildd_shared=build-shared
if [[ ${DEBUG_PY} == yes ]]; then
if [[ ${PY_INTERP_DEBUG} == yes ]]; then
DBG=d
else
DBG=
fi
if [[ ${PY_GIL_DISABLED} == yes ]]; then
if [[ ${PY_FREETHREADING} == yes ]]; then
# This Python will not be usable with non-free threading Python modules.
THREAD=t
else
THREAD=
fi
VER=${PKG_VERSION%.*}
VERABI=${VER}${DBG}${THREAD}

case "$target_platform" in
linux-64)
OLD_HOST=$(echo ${HOST} | sed -e 's/-conda_cos6//g')
OLD_HOST=$(echo ${OLD_HOST} | sed -e 's/-conda_cos7//g')
OLD_HOST=$(echo ${OLD_HOST} | sed -e 's/-conda//g')
;;
linux-*)
OLD_HOST=$(echo ${HOST} | sed -e 's/-conda_cos7//g')
OLD_HOST=$(echo ${OLD_HOST} | sed -e 's/-conda//g')
;;
*)
OLD_HOST=$HOST
;;
esac
VER=${PKG_VERSION%.*}
ABIFLAGS=${DBG}${THREAD}
VERABI=${VER}${THREAD}${DBG}
VERABI_NO_DBG=${VER}${THREAD}

cp -pf ${_buildd_static}/libpython${VERABI}.a ${PREFIX}/lib/libpython${VERABI}.a
if [[ ${HOST} =~ .*linux.* ]]; then
pushd ${PREFIX}/lib/python${VERABI}/config-${VERABI}-${OLD_HOST}
pushd ${PREFIX}/lib/python${VERABI_NO_DBG}/config-${VERABI}-${HOST/-conda/}
elif [[ ${HOST} =~ .*darwin.* ]]; then
pushd ${PREFIX}/lib/python${VERABI}/config-${VERABI}-darwin
pushd ${PREFIX}/lib/python${VERABI_NO_DBG}/config-${VERABI}-darwin
fi
ln -s ../../libpython${VERABI}.a libpython${VERABI}.a
popd
# If the LTO info in the normal lib is problematic (using different compilers for example
# we also provide a 'nolto' version).
cp -pf ${_buildd_shared}/libpython${VERABI}-pic.a ${PREFIX}/lib/libpython${VERABI}.nolto.a
cp -pf ${_buildd_shared}/libpython${VERABI_NO_DBG}-pic.a ${PREFIX}/lib/libpython${VERABI_NO_DBG}.nolto.a
21 changes: 17 additions & 4 deletions recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,23 @@ python_impl:
- cpython
numpy:
- 2.5
gil_type:
- normal
# Will be enabled as part of https://anaconda.atlassian.net/browse/PKG-5855
- disabled
# Override aggregate global tk 8.6 — build/test against tk 9 from pkgs/main
tk:
- '9.0'
# Override aggregate global clang 20 on osx. CPython 3.15 JIT requires LLVM 21
# (Tools/jit/_llvm.py); mixing compiler('c')=20 with clang-21/llvm-tools-21
# breaks osx-arm64 LTO+PGO (___llvm_profile_runtime) and JIT tool discovery.
# Matches conda-forge python-feedstock osx c_compiler_version: 21.
c_compiler_version: # [osx]
- 21 # [osx]
cxx_compiler_version: # [osx]
- 21 # [osx]
freethreading:
- yes
- no # [not (s390x or (osx and x86_64))]
build_type:
- release
- debug # [not win]

# TODO: Windows tail-calling interpreter: 64-bit builds with Visual Studio 2026 (MSVC 18) can now use the tail-call interpreter (reported ~15–20% speedup).
# Official python.org Windows binaries now use it.
Expand Down
Loading