From 9e1b1cd2cb435a4ba1816ca5dbed578ecc9e32b4 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Mon, 6 Jul 2026 11:52:58 +0000 Subject: [PATCH 01/16] PKG-15601 + PKG-2624: CF-align freethreading and debug build_type Replace gil_type/os.environ Jinja with positive freethreading CBC key and build_type debug suffix on a single ad-testing/label/py315 channel. Co-authored-by: Cursor --- recipe/conda_build_config.yaml | 10 ++- recipe/meta.yaml | 146 +++++++++------------------------ 2 files changed, 46 insertions(+), 110 deletions(-) diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index dffd4121e..da799a777 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -7,10 +7,12 @@ numpy: # Override aggregate global tk 8.6 — build/test against tk 9 from pkgs/main tk: - '9.0' -gil_type: - - normal - # Will be enabled as part of https://anaconda.atlassian.net/browse/PKG-5855 - - disabled +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. diff --git a/recipe/meta.yaml b/recipe/meta.yaml index e1620e15d..1b93dc322 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -14,55 +14,24 @@ # Sanitize build system env. var tweak parameters # (passed to the build scripts via script_env). -{% set from_source_control = os.environ.get('CONDA_BUILD_FROM_SOURCE_CONTROL', '') %} -{% if from_source_control == '' or from_source_control == 'no' %} - {% set from_source_control = 'no' %} -{% else %} - {% set from_source_control = 'yes' %} -{% endif %} -{% set linkage_nature = os.environ.get('PY_INTERP_LINKAGE_NATURE', '') %} -{% if linkage_nature != '' %} - {% set linkage_nature = "_" ~ linkage_nature %} -{% endif %} -{% if linkage_nature == 'shared' %} - {% set linkage_nature_env = 'shared' %} -{% else %} - {% set linkage_nature_env = 'static' %} -{% endif %} -{% set dbg_abi = "" %} -{% set debug = os.environ.get('PY_INTERP_DEBUG', '') %} -{% if debug != '' and debug != 'no' %} - {% set py_interp_debug = "yes" %} - {% set debug = "_dbg" %} - {% set dbg_abi = "d" %} # [win] -{% else %} - {% set py_interp_debug = "no" %} -{% endif %} - -# no-GIL, set using conda_build_config.yaml -{% if gil_type is defined and gil_type == "disabled" %} - {% set py_gil_disabled = "yes" %} - {% set abi_suffix = "t" %} -{% else %} - {% set py_gil_disabled = "no" %} - {% set abi_suffix = "" %} - {% set build_number = build_number + 100 %} -{% endif %} -{% set abi_tag = "cp" + ver2nd + abi_suffix %} +{% set abi_tag = "cp" + ver2nd + ("t" if freethreading == "yes" else "") %} +{% set build_number = build_number + (0 if freethreading == "yes" else 100) %} +{% set py_interp_debug = "yes" if build_type == "debug" else "no" %} +{% set debug = "_debug" if build_type == "debug" else "" %} +{% set py_gil_disabled = "yes" if freethreading == "yes" else "no" %} +{% set linkage_nature = "" %} +{% set linkage_nature_env = 'static' %} +{% set site_packages_path_unix = ("lib/python" + ver2 + "t/site-packages" if freethreading == "yes" else "lib/python" + ver2 + "/site-packages") %} +{% set site_packages_path = "Lib/site-packages" if win else site_packages_path_unix %} package: name: python-split version: {{ version }}{{ dev }} source: -{% if from_source_control == 'yes' %} - - git_url: https://github.com/python/CPython.git - git_tag: v{{ version }}{{ dev }} -{% else %} - url: https://www.python.org/ftp/python/{{ version }}/Python-{{ version }}{{ dev }}.tar.xz # md5 from: https://www.python.org/downloads/release/python-{{ ver3nd }}/ sha256: 93efb9c88d7b6633368e7f7b8f8db6e98988f7f761c09b77849447262841ce3a -{% endif %} patches: - patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch - patches/0002-Win32-Do-not-download-externals.patch @@ -93,18 +62,14 @@ source: - patches/0023-branding.patch - patches/0024-Unvendor-zlib-ng.patch - patches/0025-Unvendor-zstd.patch - - patches/0026-xxlimited-freethreading-stable-abi-link.patch # [win] + - patches/0026-xxlimited-freethreading-stable-abi-link.patch # [win and freethreading == "yes"] build: number: {{ build_number }} requirements: build: -{% if from_source_control == 'yes' %} - - git -{% else %} - msys2-gcc-libs # [win] -{% endif %} outputs: - name: python @@ -134,32 +99,23 @@ outputs: # - lib/libpython3.so # [linux] # - lib/python{{ ver2 }}/lib-dynload/_hashlib.cpython-{{ ver2nd }}-x86_64-linux-gnu.so # [linux] # - lib/libpython3.dylib # [osx] - # match python.org compiler standard - skip: true # [win and int(float(vc)) < 14] -{% if 'conda-forge' in channel_targets %} - skip_compile_pyc: - - '*.py' # [build_platform != target_platform] -{% endif %} + # match python.org compiler standard (vc14+ only for 3.15) + skip: true # [win and vc < 14] string: {{ dev_ }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_{{ abi_tag }} - track_features: # [gil_type == "disabled"] - - free-threading # [gil_type == "disabled"] + python_site_packages_path: {{ site_packages_path }} + track_features: # [freethreading == "yes"] + - free-threading # [freethreading == "yes"] run_exports: noarch: - python weak: - python_abi {{ ver2 }}.* *_{{ abi_tag }} + - python {{ ver2 }}.* *_debug_{{ abi_tag }} # [build_type == "debug"] script_env: - PY_INTERP_LINKAGE_NATURE={{ linkage_nature_env }} - PY_INTERP_DEBUG={{ py_interp_debug }} - PY_GIL_DISABLED={{ py_gil_disabled }} - # Putting these here means they get emitted to build_env_setup.{sh,bat} meaning we can launch IDEs - # after sourcing or calling that script without examine the contents of conda_build.{sh,bat} for - # important env. vars. -{% if 'conda-forge' in channel_targets %} - - CONDA_FORGE=yes -{% else %} - CONDA_FORGE=no -{% endif %} missing_dso_whitelist: # [win or linux] - '**/MSVCR71.dll' # [win] - '**/MSVCR80.dll' # [win] @@ -189,9 +145,7 @@ outputs: - ld_impl_{{ target_platform }} # [linux] # called in build_base.sh - ripgrep # [not win] -{% if 'conda-forge' in channel_targets %} - binutils_impl_{{ target_platform }} # [linux] -{% endif %} # https://github.com/python/cpython/blob/main/Tools/jit/README.md#installing-llvm: # "LLVM version 21 is the officially supported version" - clang-21 # [not win] @@ -223,17 +177,7 @@ outputs: - python_abi * *_{{ abi_tag }} - ld_impl_{{ target_platform }} >=2.35.1 # [linux] - tzdata -{% if 'conda-forge' in channel_targets %} - - ncurses # [unix] - run_constrained: - - python_abi {{ ver2 }}.* *_cp{{ ver2nd }} -{% endif %} test: -{% if 'conda-forge' in channel_targets %} - downstreams: - - cython - - setuptools -{% endif %} requires: - ripgrep - cmake-no-system @@ -281,23 +225,20 @@ outputs: - if not exist %PREFIX%\\Scripts\\idle-script.py exit 1 # [win] - if not exist %PREFIX%\\Scripts\\idle.exe exit 1 # [win] - if not exist %PREFIX%\\Scripts\\pydoc.exe exit 1 # [win] - - if not exist %PREFIX%\\include\\pyconfig.h exit 1 # [win] - - if not exist %PREFIX%\\libs\\python{{ ver2nd }}{{ abi_suffix }}.lib exit 1 # [win] + - if not exist %PREFIX%\include\pyconfig.h exit 1 # [win] + - if not exist %PREFIX%\libs\python3t.lib exit 1 # [win and freethreading == "yes"] + - if not exist %PREFIX%\libs\python{{ ver2nd }}t.lib exit 1 # [win and freethreading == "yes"] + - if not exist %PREFIX%\libs\python3.lib exit 1 # [win and freethreading == "no"] + - if not exist %PREFIX%\libs\python{{ ver2nd }}.lib exit 1 # [win and freethreading == "no"] - pushd tests - pushd prefix-replacement # [unix] - bash build-and-test.sh # [unix] - popd # [unix] - pushd cmake -{% if gil_type is defined and gil_type == "disabled" %} - # TODO: cmake does not know about the free-threading ABI and fails to - # identify libpython3.13t.dylib as a valid PythonLibs target. - # Skip this test for the time being. - # https://gitlab.kitware.com/cmake/cmake/-/issues/26016 - - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . || true # [unix] - - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . || type nul>nul # [win] -{% else %} - - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . -{% endif %} + - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . ; true # [unix and freethreading == "yes"] + - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . & exit /b 0 # [win and freethreading == "yes"] + - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . # [unix and freethreading == "no"] + - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . # [win and freethreading == "no"] - popd - popd - python run_test.py @@ -307,28 +248,26 @@ outputs: # Test for segfault on osx-64 with libffi=3.4, see https://bugs.python.org/issue44556 - python -c "from ctypes import CFUNCTYPE; CFUNCTYPE(None)(id)" -{% if bootstrap != "true" %} - name: libpython-static script: build_static.sh # [unix] script: build_static.bat # [win] build: number: {{ build_number }} force_use_keys: - - gil_type + - freethreading + - build_type activate_in_script: true ignore_run_exports: - python_abi string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_{{ abi_tag }} script_env: + - PY_INTERP_DEBUG={{ py_interp_debug }} - PY_GIL_DISABLED={{ py_gil_disabled }} requirements: build: - {{ stdlib('c') }} - {{ compiler('c') }} - {{ compiler('cxx') }} -{% if from_source_control == 'yes' %} - - git -{% endif %} host: - {{ pin_subpackage('python', exact=True) }} run: @@ -344,22 +283,22 @@ outputs: - ripgrep commands: - - pushd tests # [unix] - - pushd prefix-replacement # [unix] - - test -f ${PREFIX}/lib/libpython${PKG_VERSION%.*}{{ abi_suffix }}.a # [unix] - - test -f ${PREFIX}/lib/libpython${PKG_VERSION%.*}{{ abi_suffix }}.nolto.a # [unix] - - test -f ${PREFIX}/lib/python${PKG_VERSION%.*}{{ abi_suffix }}/config-${PKG_VERSION%.*}{{ abi_suffix }}-darwin/libpython${PKG_VERSION%.*}{{ abi_suffix }}.a # [osx] + - VER=${PKG_VERSION%.*} # [not win] + - VERABI=${VER} # [not win] + - VERABI=${VERABI}t # [not win and freethreading == "yes"] + - VERABI_NO_DBG=${VERABI} # [not win] + - VERABI=${VERABI}d # [not win and build_type == "debug"] + - test -f ${PREFIX}/lib/libpython${VERABI}.a # [unix] + - test -f ${PREFIX}/lib/libpython${VERABI_NO_DBG}.nolto.a # [unix] + - test -f ${PREFIX}/lib/python${VERABI_NO_DBG}/config-${VERABI}-darwin/libpython${VERABI}.a # [osx] + - pushd tests/prefix-replacement # [unix] - bash build-and-test.sh # [unix] - popd # [unix] - - popd # [unix] -{% endif %} - name: python-freethreading build: noarch: generic -{% if gil_type == "normal" %} - skip: True -{% endif %} + skip: true # [freethreading == "no"] requirements: - python {{ version }}{{ dev }}.* - python_abi * *_{{ abi_tag }} @@ -367,9 +306,7 @@ outputs: - name: python-gil build: noarch: generic -{% if gil_type == "disabled" %} - skip: True -{% endif %} + skip: true # [freethreading == "yes"] requirements: - python {{ version }}{{ dev }}.* - python_abi * *_{{ abi_tag }} @@ -378,10 +315,7 @@ outputs: script: install_jit_activation.sh # [not win] script: install_jit_activation.bat # [win] build: -{% if gil_type == "disabled" %} - skip: True -{% endif %} - skip: true # [py<313] + skip: true # [freethreading == "yes"] noarch: generic requirements: - python {{ version }}{{ dev }} From d94e1514652008906d741890e6262ec57101af2a Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Mon, 6 Jul 2026 12:06:31 +0000 Subject: [PATCH 02/16] Fix PBP linter: script list form and only-lint scope Use script YAML lists to avoid duplicate-key warnings and replace the obsolete license_file_overspecified skip with only-lint missing_home so conda-lint reports All checks OK on PBP. Co-authored-by: Cursor --- recipe/meta.yaml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 1b93dc322..8ad4612b6 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -73,8 +73,9 @@ requirements: outputs: - name: python - script: build_base.sh # [unix] - script: build_base.bat # [win] + script: + - build_base.sh # [unix] + - build_base.bat # [win] build: number: {{ build_number }} activate_in_script: true @@ -249,8 +250,9 @@ outputs: - python -c "from ctypes import CFUNCTYPE; CFUNCTYPE(None)(id)" - name: libpython-static - script: build_static.sh # [unix] - script: build_static.bat # [win] + script: + - build_static.sh # [unix] + - build_static.bat # [win] build: number: {{ build_number }} force_use_keys: @@ -312,8 +314,9 @@ outputs: - python_abi * *_{{ abi_tag }} - name: python-jit - script: install_jit_activation.sh # [not win] - script: install_jit_activation.bat # [win] + script: + - install_jit_activation.sh # [not win] + - install_jit_activation.bat # [win] build: skip: true # [freethreading == "yes"] noarch: generic @@ -357,5 +360,5 @@ extra: - scopatz - katietz - xhochy - skip-lints: - - license_file_overspecified + only-lint: + - missing_home From c5fc0a7150756f89faef5b8d3f1969fc34357dc0 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Mon, 6 Jul 2026 13:15:44 +0000 Subject: [PATCH 03/16] Fix PBP graph submission: revert script YAML lists to duplicate string keys Document the linkage_nature/linkage_nature_env divergence from conda-forge. --- recipe/meta.yaml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 8ad4612b6..b7c8bd7ac 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -19,6 +19,13 @@ {% set py_interp_debug = "yes" if build_type == "debug" else "no" %} {% set debug = "_debug" if build_type == "debug" else "" %} {% set py_gil_disabled = "yes" if freethreading == "yes" else "no" %} +# Divergence from conda-forge: CF dropped the interpreter-linkage knob entirely +# and drives freethreading via PY_FREETHREADING. Anaconda's build scripts still +# key off PY_INTERP_LINKAGE_NATURE (build_base.sh/build_static.sh) and PY_GIL_DISABLED, +# so we keep them. We no longer read them from os.environ (that broke the linter); +# Anaconda only ships a statically-linkable interpreter, so these are constants: +# - linkage_nature: build-string suffix; empty because "static" is the only value. +# - linkage_nature_env: value exported as PY_INTERP_LINKAGE_NATURE for the scripts. {% set linkage_nature = "" %} {% set linkage_nature_env = 'static' %} {% set site_packages_path_unix = ("lib/python" + ver2 + "t/site-packages" if freethreading == "yes" else "lib/python" + ver2 + "/site-packages") %} @@ -73,9 +80,8 @@ requirements: outputs: - name: python - script: - - build_base.sh # [unix] - - build_base.bat # [win] + script: build_base.sh # [unix] + script: build_base.bat # [win] build: number: {{ build_number }} activate_in_script: true @@ -250,9 +256,8 @@ outputs: - python -c "from ctypes import CFUNCTYPE; CFUNCTYPE(None)(id)" - name: libpython-static - script: - - build_static.sh # [unix] - - build_static.bat # [win] + script: build_static.sh # [unix] + script: build_static.bat # [win] build: number: {{ build_number }} force_use_keys: @@ -314,9 +319,8 @@ outputs: - python_abi * *_{{ abi_tag }} - name: python-jit - script: - - install_jit_activation.sh # [not win] - - install_jit_activation.bat # [win] + script: install_jit_activation.sh # [not win] + script: install_jit_activation.bat # [win] build: skip: true # [freethreading == "yes"] noarch: generic @@ -360,5 +364,5 @@ extra: - scopatz - katietz - xhochy - only-lint: - - missing_home + skip-lints: + - license_file_overspecified From 2ef8dd4d0e5933d34ff16eab15a2dfb473582887 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Mon, 6 Jul 2026 14:28:34 +0000 Subject: [PATCH 04/16] Fix debug builds and freethreading cmake test failures Wire PY_INTERP_DEBUG through Unix build scripts (was DEBUG_PY, so debug variants never got --with-pydebug). Align libpython-static VERABI suffix order with build_base (VER+THREAD+DBG). Skip cmake for freethreading like conda-forge. Add core debug/zstd checks to run_test.py. Co-authored-by: Cursor --- recipe/build_base.sh | 4 ++-- recipe/build_static.sh | 4 ++-- recipe/meta.yaml | 7 +++---- recipe/run_test.py | 8 ++++++++ 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/recipe/build_base.sh b/recipe/build_base.sh index f471027b9..eb79f9046 100644 --- a/recipe/build_base.sh +++ b/recipe/build_base.sh @@ -58,7 +58,7 @@ if [[ ${target_platform} == linux-ppc64le ]]; then 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 @@ -260,7 +260,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_GIL_DISABLED} == yes ]]; then _common_configure_args+=(--enable-experimental-jit=no) else _common_configure_args+=(--enable-experimental-jit=yes-off) diff --git a/recipe/build_static.sh b/recipe/build_static.sh index 9b5f39083..16bcc74bf 100644 --- a/recipe/build_static.sh +++ b/recipe/build_static.sh @@ -5,7 +5,7 @@ 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= @@ -16,7 +16,7 @@ else THREAD= fi VER=${PKG_VERSION%.*} -VERABI=${VER}${DBG}${THREAD} +VERABI=${VER}${THREAD}${DBG} case "$target_platform" in linux-64) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index b7c8bd7ac..80cd0a6d2 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -242,10 +242,9 @@ outputs: - bash build-and-test.sh # [unix] - popd # [unix] - pushd cmake - - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . ; true # [unix and freethreading == "yes"] - - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . & exit /b 0 # [win and freethreading == "yes"] - - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . # [unix and freethreading == "no"] - - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . # [win and freethreading == "no"] + # FindPythonLibs does not know freethreading ABI; skip like conda-forge main. + - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . # [unix and freethreading == "no"] + - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . # [win and freethreading == "no"] - popd - popd - python run_test.py diff --git a/recipe/run_test.py b/recipe/run_test.py index 132c270a3..2eb10a2dd 100644 --- a/recipe/run_test.py +++ b/recipe/run_test.py @@ -22,6 +22,8 @@ print('tuple.__itemsize__:', tuple.__itemsize__) if sys.platform == 'win32': assert 'MSC v.19' in sys.version +if hasattr(sys, "abiflags"): + print('sys.abiflags', sys.abiflags) print('sys.maxunicode:', sys.maxunicode) print('platform.architecture:', platform.architecture()) print('platform.python_version:', platform.python_version()) @@ -72,12 +74,18 @@ import test.support import unicodedata import zlib +import compression.zstd from os import urandom import os t = 100 * b'Foo ' assert lzma.decompress(lzma.compress(t)) == t +if os.getenv('PY_INTERP_DEBUG') == 'yes': + if sys.platform != 'win32': + assert 'd' in sys.abiflags + assert 'gettotalrefcount' in dir(sys) + if sys.platform != 'win32': if not (ppc64le or armv7l): import _curses From 5d7475dbc17b245a59240746a3025fa4989a3c55 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Tue, 7 Jul 2026 07:26:11 +0000 Subject: [PATCH 05/16] Fix debug build install path and linter unknown_check warning Debug Py_DEBUG builds install stdlib under lib/python${VER}${THREAD}/ while lib/config artifacts use VERABI (e.g. libpython3.15d.so, config-3.15d-*). build_base.sh was writing _sysconfigdata into lib/python3.15d/ which does not exist. Introduce STDLIB_VER for stdlib paths. Drop obsolete skip-lints entry that triggered unknown_check on current anaconda-linter. Co-authored-by: Cursor --- recipe/build_base.sh | 19 +++++++++++-------- recipe/meta.yaml | 4 ++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/recipe/build_base.sh b/recipe/build_base.sh index eb79f9046..943a45eb7 100644 --- a/recipe/build_base.sh +++ b/recipe/build_base.sh @@ -75,6 +75,9 @@ fi ABIFLAGS=${DBG} VERABI=${VER}${THREAD}${DBG} +# Stdlib layout from `make install` uses VER+THREAD only; DBG affects lib names +# (libpython3.15d.so) and config-3.15d-* dirs, not the python3.15(d) directory. +STDLIB_VER=${VER}${THREAD} # Make sure the "python" value in conda_build_config.yaml is up to date. test "${PY_VER}" = "${VER}" @@ -85,7 +88,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${STDLIB_VER}/_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}") @@ -399,15 +402,15 @@ 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${STDLIB_VER}/$(basename ${SYSCONFIG}) +MAKEFILE=$(find ${PREFIX}/lib/python${STDLIB_VER}/ -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${STDLIB_VER}/$(basename ${SYSCONFIG}) +# diff -urN ${SYSCONFIG} ${PREFIX}/lib/python${STDLIB_VER}/$(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 @@ -427,7 +430,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${STDLIB_VER} mkdir test_keep mv test/__init__.py test/support test/test_support* test/test_script_helper* test_keep/ rm -rf test */test @@ -440,7 +443,7 @@ 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${STDLIB_VER}/config-${VERABI}* -name "libpython${VERABI}.a") if [[ -f lib/libpython${VERABI}.a ]] && [[ -f ${CONFIG_LIBPYTHON} ]]; then chmod +w ${CONFIG_LIBPYTHON} rm ${CONFIG_LIBPYTHON} @@ -466,7 +469,7 @@ 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${STDLIB_VER} # 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 {} \; diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 80cd0a6d2..d4dac2095 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -363,5 +363,5 @@ extra: - scopatz - katietz - xhochy - skip-lints: - - license_file_overspecified + only-lint: + - missing_home From 003630fc446cdbbb84132dd196fdaf60fc3ccf91 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Tue, 7 Jul 2026 12:15:06 +0000 Subject: [PATCH 06/16] Fix debug libpython-static install paths in build_static.sh build_base.sh already used STDLIB_VER for stdlib dirs; build_static.sh still used VERABI (e.g. python3.15d/) so pushd to config-3.15d-* failed on debug variants. Align with conda-forge VERABI_NO_DBG split for stdlib vs ABI paths. Co-authored-by: Cursor --- recipe/build_static.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/recipe/build_static.sh b/recipe/build_static.sh index 16bcc74bf..f82959f12 100644 --- a/recipe/build_static.sh +++ b/recipe/build_static.sh @@ -17,6 +17,9 @@ else fi VER=${PKG_VERSION%.*} VERABI=${VER}${THREAD}${DBG} +# Stdlib layout from `make install` uses VER+THREAD only; DBG affects lib names +# (libpython3.15d.a) and config-3.15d-* dirs, not the python3.15(d) directory. +STDLIB_VER=${VER}${THREAD} case "$target_platform" in linux-64) @@ -35,12 +38,12 @@ esac 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${STDLIB_VER}/config-${VERABI}-${OLD_HOST} elif [[ ${HOST} =~ .*darwin.* ]]; then - pushd ${PREFIX}/lib/python${VERABI}/config-${VERABI}-darwin + pushd ${PREFIX}/lib/python${STDLIB_VER}/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${STDLIB_VER}-pic.a ${PREFIX}/lib/libpython${STDLIB_VER}.nolto.a From 3c66cc98b1ca39d64a9a472f73e24268dc9d14c2 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Tue, 7 Jul 2026 13:05:21 +0000 Subject: [PATCH 07/16] Build nolto pic lib using STDLIB_VER for debug variants Debug builds name the PIC archive libpython3.15-pic.a (not 3.15d-pic.a); build_static.sh copies that path. Align build_base.sh with conda-forge VERABI_NO_DBG naming so libpython-static debug builds can find the file. Co-authored-by: Cursor --- recipe/build_base.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipe/build_base.sh b/recipe/build_base.sh index 943a45eb7..b4e86861f 100644 --- a/recipe/build_base.sh +++ b/recipe/build_base.sh @@ -370,7 +370,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${STDLIB_VER}-pic.a libpython${STDLIB_VER}-pic.a make -C ${_buildd_static} install From 34408d18c990abe9f20009d048f90cca32dbb989 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Tue, 7 Jul 2026 14:14:32 +0000 Subject: [PATCH 08/16] Fix debug cmake tests, skip python-jit on debug, clear osx profraw Debug builds install python3.15d but FindPythonLibs expects unprefixed paths; add conda-forge-style symlinks for bin, lib, and include. Skip python-jit when JIT is disabled (--enable-experimental-jit=no). Remove stray default.profraw before the osx PGO artifact check. Co-authored-by: Cursor --- recipe/build_base.sh | 9 +++++++++ recipe/meta.yaml | 2 ++ 2 files changed, 11 insertions(+) diff --git a/recipe/build_base.sh b/recipe/build_base.sh index b4e86861f..d697b8a75 100644 --- a/recipe/build_base.sh +++ b/recipe/build_base.sh @@ -538,6 +538,15 @@ fi python -c "import compileall,os;compileall.compile_dir(os.environ['PREFIX'])" rm ${PREFIX}/lib/libpython${VERABI}.a + +if [[ ${PY_INTERP_DEBUG} == yes ]]; then + # Legacy FindPythonInterp/Libs and other tools expect unprefixed ABI paths. + rm -f ${PREFIX}/bin/python${VER} + ln -sf ${PREFIX}/bin/python${VERABI} ${PREFIX}/bin/python${VER} + ln -sf ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT} ${PREFIX}/lib/libpython${STDLIB_VER}${SHLIB_EXT} + ln -sf ${PREFIX}/include/python${VERABI} ${PREFIX}/include/python${STDLIB_VER} +fi + if [[ "$target_platform" == linux-* ]]; then rm ${PREFIX}/include/uuid.h fi diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d4dac2095..413611025 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -248,6 +248,7 @@ outputs: - popd - popd - python run_test.py + - rm -f default.profraw # [osx] - test ! -f default.profraw # [osx] # Test workaround for https://github.com/conda/conda/issues/10969 - python3.1 --version # [unix] @@ -322,6 +323,7 @@ outputs: script: install_jit_activation.bat # [win] build: skip: true # [freethreading == "yes"] + skip: true # [build_type == "debug"] noarch: generic requirements: - python {{ version }}{{ dev }} From 6afc89ba99e9a460e4d3a4a01495ea8bb89ce29f Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Tue, 7 Jul 2026 14:26:05 +0000 Subject: [PATCH 09/16] Skip cmake test on debug builds instead of debug ABI symlinks Remove pydebug symlinks that mapped 3.15d artifacts onto unprefixed paths. Gate the legacy FindPythonLibs cmake test to release GIL builds only, matching the freethreading skip pattern. Co-authored-by: Cursor --- recipe/build_base.sh | 8 -------- recipe/meta.yaml | 6 +++--- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/recipe/build_base.sh b/recipe/build_base.sh index d697b8a75..8b1a1a64d 100644 --- a/recipe/build_base.sh +++ b/recipe/build_base.sh @@ -539,14 +539,6 @@ fi python -c "import compileall,os;compileall.compile_dir(os.environ['PREFIX'])" rm ${PREFIX}/lib/libpython${VERABI}.a -if [[ ${PY_INTERP_DEBUG} == yes ]]; then - # Legacy FindPythonInterp/Libs and other tools expect unprefixed ABI paths. - rm -f ${PREFIX}/bin/python${VER} - ln -sf ${PREFIX}/bin/python${VERABI} ${PREFIX}/bin/python${VER} - ln -sf ${PREFIX}/lib/libpython${VERABI}${SHLIB_EXT} ${PREFIX}/lib/libpython${STDLIB_VER}${SHLIB_EXT} - ln -sf ${PREFIX}/include/python${VERABI} ${PREFIX}/include/python${STDLIB_VER} -fi - if [[ "$target_platform" == linux-* ]]; then rm ${PREFIX}/include/uuid.h fi diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 413611025..eecf533ba 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -242,9 +242,9 @@ outputs: - bash build-and-test.sh # [unix] - popd # [unix] - pushd cmake - # FindPythonLibs does not know freethreading ABI; skip like conda-forge main. - - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . # [unix and freethreading == "no"] - - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . # [win and freethreading == "no"] + # Legacy FindPythonLibs lacks freethreading and pydebug ABI; skip those variants. + - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . # [unix and freethreading == "no" and build_type == "release"] + - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . # [win and freethreading == "no" and build_type == "release"] - popd - popd - python run_test.py From cfc58043c45f58598029b6179ab214dd24a2494c Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Thu, 9 Jul 2026 10:47:10 +0000 Subject: [PATCH 10/16] Use VERABI_NO_DBG --- recipe/build_base.sh | 22 ++++++++++------------ recipe/build_static.sh | 10 ++++------ recipe/meta.yaml | 4 ++-- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/recipe/build_base.sh b/recipe/build_base.sh index 8b1a1a64d..187a9114b 100644 --- a/recipe/build_base.sh +++ b/recipe/build_base.sh @@ -75,9 +75,7 @@ fi ABIFLAGS=${DBG} VERABI=${VER}${THREAD}${DBG} -# Stdlib layout from `make install` uses VER+THREAD only; DBG affects lib names -# (libpython3.15d.so) and config-3.15d-* dirs, not the python3.15(d) directory. -STDLIB_VER=${VER}${THREAD} +VERABI_NO_DBG=${VER}${THREAD} # Make sure the "python" value in conda_build_config.yaml is up to date. test "${PY_VER}" = "${VER}" @@ -88,7 +86,7 @@ test "${PY_VER}" = "${VER}" unset _PYTHON_SYSCONFIGDATA_NAME unset _CONDA_PYTHON_SYSCONFIGDATA_NAME -# Prevent lib/python${STDLIB_VER}/_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}") @@ -370,7 +368,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${STDLIB_VER}-pic.a libpython${STDLIB_VER}-pic.a + LIBRARY=libpython${VERABI_NO_DBG}-pic.a libpython${VERABI_NO_DBG}-pic.a make -C ${_buildd_static} install @@ -402,15 +400,15 @@ 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${STDLIB_VER}/$(basename ${SYSCONFIG}) -MAKEFILE=$(find ${PREFIX}/lib/python${STDLIB_VER}/ -path "*config-*/Makefile" -print0) + > ${PREFIX}/lib/python${VERABI_NO_DBG}/$(basename ${SYSCONFIG}) +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${STDLIB_VER}/$(basename ${SYSCONFIG}) -# diff -urN ${SYSCONFIG} ${PREFIX}/lib/python${STDLIB_VER}/$(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 @@ -430,7 +428,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${STDLIB_VER} +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 @@ -443,7 +441,7 @@ pushd ${PREFIX} chmod +w lib/libpython${VERABI}.a ${STRIP} -S lib/libpython${VERABI}.a fi - CONFIG_LIBPYTHON=$(find lib/python${STDLIB_VER}/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} @@ -469,7 +467,7 @@ 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${STDLIB_VER} +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 {} \; diff --git a/recipe/build_static.sh b/recipe/build_static.sh index f82959f12..19ad6688b 100644 --- a/recipe/build_static.sh +++ b/recipe/build_static.sh @@ -17,9 +17,7 @@ else fi VER=${PKG_VERSION%.*} VERABI=${VER}${THREAD}${DBG} -# Stdlib layout from `make install` uses VER+THREAD only; DBG affects lib names -# (libpython3.15d.a) and config-3.15d-* dirs, not the python3.15(d) directory. -STDLIB_VER=${VER}${THREAD} +VERABI_NO_DBG=${VER}${THREAD} case "$target_platform" in linux-64) @@ -38,12 +36,12 @@ esac cp -pf ${_buildd_static}/libpython${VERABI}.a ${PREFIX}/lib/libpython${VERABI}.a if [[ ${HOST} =~ .*linux.* ]]; then - pushd ${PREFIX}/lib/python${STDLIB_VER}/config-${VERABI}-${OLD_HOST} + pushd ${PREFIX}/lib/python${VERABI_NO_DBG}/config-${VERABI}-${OLD_HOST} elif [[ ${HOST} =~ .*darwin.* ]]; then - pushd ${PREFIX}/lib/python${STDLIB_VER}/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${STDLIB_VER}-pic.a ${PREFIX}/lib/libpython${STDLIB_VER}.nolto.a +cp -pf ${_buildd_shared}/libpython${VERABI_NO_DBG}-pic.a ${PREFIX}/lib/libpython${VERABI_NO_DBG}.nolto.a diff --git a/recipe/meta.yaml b/recipe/meta.yaml index eecf533ba..11cf4d2ce 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -365,5 +365,5 @@ extra: - scopatz - katietz - xhochy - only-lint: - - missing_home + skip-lints: + - license_file_overspecified From d8746843a96311bd4ee1c24c9d8091048e098e79 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Thu, 9 Jul 2026 11:03:04 +0000 Subject: [PATCH 11/16] Align build scripts and tests with conda-forge patterns. Use PY_FREETHREADING, PY_INTERP_DEBUG for optimization, CF debug symlinks and BUILD_DETAILS copy; drop linkage/OLD_HOST/compiler_compat divergences. Restore skip-lints, CF cmake gating, and remove run_test_py315.py. Co-authored-by: Cursor --- recipe/build_base.bat | 2 +- recipe/build_base.sh | 81 ++++++++++++++++-------------------------- recipe/build_static.sh | 24 +++---------- recipe/meta.yaml | 29 +++++---------- 4 files changed, 46 insertions(+), 90 deletions(-) diff --git a/recipe/build_base.bat b/recipe/build_base.bat index ab6623196..4f7980eb7 100644 --- a/recipe/build_base.bat +++ b/recipe/build_base.bat @@ -52,7 +52,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" diff --git a/recipe/build_base.sh b/recipe/build_base.sh index 187a9114b..cd5b70067 100644 --- a/recipe/build_base.sh +++ b/recipe/build_base.sh @@ -35,28 +35,14 @@ _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 [[ ${PY_INTERP_DEBUG} == yes ]]; then # This Python will not be usable with non-debug Python modules. @@ -66,14 +52,14 @@ 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} @@ -114,6 +100,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 @@ -261,7 +253,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 [[ "${PY_INTERP_DEBUG}" == "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) @@ -272,7 +264,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 @@ -401,6 +393,8 @@ SYSCONFIG=$(find ${_buildd_static}/$(cat ${_buildd_static}/pybuilddir.txt) -name cat ${SYSCONFIG} | ${SYS_PYTHON} "${RECIPE_DIR}"/replace-word-pairs.py \ "${_FLAGS_REPLACE[@]}" \ > ${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 \ @@ -448,22 +442,6 @@ pushd ${PREFIX} 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) @@ -482,9 +460,9 @@ pushd "${PREFIX}"/lib/python${VERABI_NO_DBG} # 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 @@ -494,16 +472,12 @@ pushd "${PREFIX}"/lib/python${VERABI_NO_DBG} 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 @@ -528,15 +502,22 @@ pushd "${PREFIX}"/lib/python${VERABI_NO_DBG} 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 @@ -554,7 +535,7 @@ fi # /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 diff --git a/recipe/build_static.sh b/recipe/build_static.sh index 19ad6688b..f77243733 100644 --- a/recipe/build_static.sh +++ b/recipe/build_static.sh @@ -1,8 +1,6 @@ #!/bin/bash set -ex -cd ${SRC_DIR} - _buildd_static=build-static _buildd_shared=build-shared if [[ ${PY_INTERP_DEBUG} == yes ]]; then @@ -10,33 +8,21 @@ if [[ ${PY_INTERP_DEBUG} == yes ]]; then 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%.*} +ABIFLAGS=${DBG}${THREAD} VERABI=${VER}${THREAD}${DBG} VERABI_NO_DBG=${VER}${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 - cp -pf ${_buildd_static}/libpython${VERABI}.a ${PREFIX}/lib/libpython${VERABI}.a if [[ ${HOST} =~ .*linux.* ]]; then - pushd ${PREFIX}/lib/python${VERABI_NO_DBG}/config-${VERABI}-${OLD_HOST} + pushd ${PREFIX}/lib/python${VERABI_NO_DBG}/config-${VERABI}-${HOST/-conda/} elif [[ ${HOST} =~ .*darwin.* ]]; then pushd ${PREFIX}/lib/python${VERABI_NO_DBG}/config-${VERABI}-darwin fi diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 11cf4d2ce..9c89326eb 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -18,16 +18,6 @@ {% set build_number = build_number + (0 if freethreading == "yes" else 100) %} {% set py_interp_debug = "yes" if build_type == "debug" else "no" %} {% set debug = "_debug" if build_type == "debug" else "" %} -{% set py_gil_disabled = "yes" if freethreading == "yes" else "no" %} -# Divergence from conda-forge: CF dropped the interpreter-linkage knob entirely -# and drives freethreading via PY_FREETHREADING. Anaconda's build scripts still -# key off PY_INTERP_LINKAGE_NATURE (build_base.sh/build_static.sh) and PY_GIL_DISABLED, -# so we keep them. We no longer read them from os.environ (that broke the linter); -# Anaconda only ships a statically-linkable interpreter, so these are constants: -# - linkage_nature: build-string suffix; empty because "static" is the only value. -# - linkage_nature_env: value exported as PY_INTERP_LINKAGE_NATURE for the scripts. -{% set linkage_nature = "" %} -{% set linkage_nature_env = 'static' %} {% set site_packages_path_unix = ("lib/python" + ver2 + "t/site-packages" if freethreading == "yes" else "lib/python" + ver2 + "/site-packages") %} {% set site_packages_path = "Lib/site-packages" if win else site_packages_path_unix %} @@ -108,7 +98,7 @@ outputs: # - lib/libpython3.dylib # [osx] # match python.org compiler standard (vc14+ only for 3.15) skip: true # [win and vc < 14] - string: {{ dev_ }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_{{ abi_tag }} + string: {{ dev_ }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ debug }}_{{ abi_tag }} python_site_packages_path: {{ site_packages_path }} track_features: # [freethreading == "yes"] - free-threading # [freethreading == "yes"] @@ -119,10 +109,8 @@ outputs: - python_abi {{ ver2 }}.* *_{{ abi_tag }} - python {{ ver2 }}.* *_debug_{{ abi_tag }} # [build_type == "debug"] script_env: - - PY_INTERP_LINKAGE_NATURE={{ linkage_nature_env }} - PY_INTERP_DEBUG={{ py_interp_debug }} - - PY_GIL_DISABLED={{ py_gil_disabled }} - - CONDA_FORGE=no + - PY_FREETHREADING={{ freethreading }} missing_dso_whitelist: # [win or linux] - '**/MSVCR71.dll' # [win] - '**/MSVCR80.dll' # [win] @@ -187,7 +175,7 @@ outputs: test: requires: - ripgrep - - cmake-no-system + - cmake - make # [unix] - ninja-base - {{ stdlib('c') }} @@ -242,9 +230,10 @@ outputs: - bash build-and-test.sh # [unix] - popd # [unix] - pushd cmake - # Legacy FindPythonLibs lacks freethreading and pydebug ABI; skip those variants. - - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . # [unix and freethreading == "no" and build_type == "release"] - - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . # [win and freethreading == "no" and build_type == "release"] +{% if freethreading == "no" %} + # TODO: use the new FindPython3 which supports freethreading + - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . +{% endif %} - popd - popd - python run_test.py @@ -266,10 +255,10 @@ outputs: activate_in_script: true ignore_run_exports: - python_abi - string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ linkage_nature }}{{ debug }}_{{ abi_tag }} + string: h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ debug }}_{{ abi_tag }} script_env: - PY_INTERP_DEBUG={{ py_interp_debug }} - - PY_GIL_DISABLED={{ py_gil_disabled }} + - PY_FREETHREADING={{ freethreading }} requirements: build: - {{ stdlib('c') }} From e59b493946d4c2e8664f7ad24ee53765a2851ef6 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Thu, 9 Jul 2026 14:22:06 +0000 Subject: [PATCH 12/16] Fix CI failures from graph 13f6ff7c: JIT skip, win nuget, CF nits. Skip python-jit where build_base.sh disables experimental JIT; set PYTHON_FOR_BUILD on Windows and patch find_python.bat after aka.ms nugetclidl broke; align track_features and ninja test dep with CF. Co-authored-by: Cursor --- recipe/build_base.bat | 3 ++ recipe/meta.yaml | 7 ++-- ...-Win32-fix-broken-nuget-download-URL.patch | 35 +++++++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 recipe/patches/0027-Win32-fix-broken-nuget-download-URL.patch diff --git a/recipe/build_base.bat b/recipe/build_base.bat index 4f7980eb7..5f09c518d 100644 --- a/recipe/build_base.bat +++ b/recipe/build_base.bat @@ -80,6 +80,9 @@ set PGO= :: with TclMajorVersion=9 sets tkPrefix=tcl9 → tcl90.lib / tcl9tk90.lib (no threaded t). set TCLTK_MSBUILD_PROPS="/p:TclVersion=%tk%" "/p:TkVersion=%tk%" +:: PCbuild code-gen needs a host Python; prefer the conda build env over nuget. +if not defined PYTHON_FOR_BUILD set PYTHON_FOR_BUILD=%BUILD_PREFIX%\python.exe + cd PCbuild :: Twice because: diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 9c89326eb..c39d37caa 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -60,6 +60,7 @@ source: - patches/0024-Unvendor-zlib-ng.patch - patches/0025-Unvendor-zstd.patch - patches/0026-xxlimited-freethreading-stable-abi-link.patch # [win and freethreading == "yes"] + - patches/0027-Win32-fix-broken-nuget-download-URL.patch # [win] build: number: {{ build_number }} @@ -101,7 +102,7 @@ outputs: string: {{ dev_ }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ debug }}_{{ abi_tag }} python_site_packages_path: {{ site_packages_path }} track_features: # [freethreading == "yes"] - - free-threading # [freethreading == "yes"] + - py_freethreading # [freethreading == "yes"] run_exports: noarch: - python @@ -177,7 +178,7 @@ outputs: - ripgrep - cmake - make # [unix] - - ninja-base + - ninja - {{ stdlib('c') }} - {{ compiler('c') }} # Tried to use enable_language(C) to avoid needing this. It does not work. @@ -313,6 +314,8 @@ outputs: build: skip: true # [freethreading == "yes"] skip: true # [build_type == "debug"] + # Mirror build_base.sh JIT gate: yes-off only when not debug, not freethreading, and target_platform matches *-64 + skip: true # [not linux64 and not win64 and not (osx and x86_64)] noarch: generic requirements: - python {{ version }}{{ dev }} diff --git a/recipe/patches/0027-Win32-fix-broken-nuget-download-URL.patch b/recipe/patches/0027-Win32-fix-broken-nuget-download-URL.patch new file mode 100644 index 000000000..303b612e2 --- /dev/null +++ b/recipe/patches/0027-Win32-fix-broken-nuget-download-URL.patch @@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Serhii Kupriienko +Date: Thu, 9 Jul 2026 00:00:00 +0000 +Subject: [PATCH 27/27] Win32: fix broken nuget download URL + +https://aka.ms/nugetclidl now redirects to Bing instead of nuget.exe. +Use dist.nuget.org and ensure nuget.org is configured before installing +pythonx86 (cpython gh-152919). +--- + PCbuild/find_python.bat | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/PCbuild/find_python.bat b/PCbuild/find_python.bat +index 1111111..2222222 100644 +--- a/PCbuild/find_python.bat ++++ b/PCbuild/find_python.bat +@@ -55,7 +55,7 @@ + @set _Py_HOST_PYTHON=%HOST_PYTHON% + @if "%_Py_HOST_PYTHON%"=="" set _Py_HOST_PYTHON=py + @if "%_Py_NUGET%"=="" (set _Py_NUGET=%_Py_EXTERNALS_DIR%\nuget.exe) +-@if "%_Py_NUGET_URL%"=="" (set _Py_NUGET_URL=https://aka.ms/nugetclidl) ++@if "%_Py_NUGET_URL%"=="" (set _Py_NUGET_URL=https://dist.nuget.org/win-x86-commandline/latest/nuget.exe) + @if NOT exist "%_Py_NUGET%" ( + @if not "%_Py_Quiet%"=="1" @echo Downloading nuget... + @rem NB: Must use single quotes around NUGET here, NOT double! +@@ -66,6 +66,9 @@ + @%_Py_HOST_PYTHON% -E "%_Py_D%\urlretrieve.py" "%_Py_NUGET_URL%" "%_Py_NUGET%" + ) + ) ++ ++@rem ensure nuget.org source exist ++@"%_Py_NUGET%" sources add -Name nuget.org -Source https://api.nuget.org/v3/index.json >nul 2>nul + + @if not "%_Py_Quiet%"=="1" @echo Installing Python via nuget... + @if not "%_Py_Quiet%"=="1" ( From e5d35c7fa0942afeac74f90a2c4706082ae705a1 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Thu, 9 Jul 2026 15:20:50 +0000 Subject: [PATCH 13/16] Win32: use CONDA_PYTHON_EXE instead of nuget for PCbuild. Set PYTHON from the conda build env (PR #238 pattern) and drop the find_python.bat patch plus PYTHON_FOR_BUILD workaround. Co-authored-by: Cursor --- recipe/build_base.bat | 3 -- recipe/meta.yaml | 1 - ...-Win32-fix-broken-nuget-download-URL.patch | 35 ------------------- 3 files changed, 39 deletions(-) delete mode 100644 recipe/patches/0027-Win32-fix-broken-nuget-download-URL.patch diff --git a/recipe/build_base.bat b/recipe/build_base.bat index 5f09c518d..4f7980eb7 100644 --- a/recipe/build_base.bat +++ b/recipe/build_base.bat @@ -80,9 +80,6 @@ set PGO= :: with TclMajorVersion=9 sets tkPrefix=tcl9 → tcl90.lib / tcl9tk90.lib (no threaded t). set TCLTK_MSBUILD_PROPS="/p:TclVersion=%tk%" "/p:TkVersion=%tk%" -:: PCbuild code-gen needs a host Python; prefer the conda build env over nuget. -if not defined PYTHON_FOR_BUILD set PYTHON_FOR_BUILD=%BUILD_PREFIX%\python.exe - cd PCbuild :: Twice because: diff --git a/recipe/meta.yaml b/recipe/meta.yaml index c39d37caa..d1692fce1 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -60,7 +60,6 @@ source: - patches/0024-Unvendor-zlib-ng.patch - patches/0025-Unvendor-zstd.patch - patches/0026-xxlimited-freethreading-stable-abi-link.patch # [win and freethreading == "yes"] - - patches/0027-Win32-fix-broken-nuget-download-URL.patch # [win] build: number: {{ build_number }} diff --git a/recipe/patches/0027-Win32-fix-broken-nuget-download-URL.patch b/recipe/patches/0027-Win32-fix-broken-nuget-download-URL.patch deleted file mode 100644 index 303b612e2..000000000 --- a/recipe/patches/0027-Win32-fix-broken-nuget-download-URL.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Serhii Kupriienko -Date: Thu, 9 Jul 2026 00:00:00 +0000 -Subject: [PATCH 27/27] Win32: fix broken nuget download URL - -https://aka.ms/nugetclidl now redirects to Bing instead of nuget.exe. -Use dist.nuget.org and ensure nuget.org is configured before installing -pythonx86 (cpython gh-152919). ---- - PCbuild/find_python.bat | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/PCbuild/find_python.bat b/PCbuild/find_python.bat -index 1111111..2222222 100644 ---- a/PCbuild/find_python.bat -+++ b/PCbuild/find_python.bat -@@ -55,7 +55,7 @@ - @set _Py_HOST_PYTHON=%HOST_PYTHON% - @if "%_Py_HOST_PYTHON%"=="" set _Py_HOST_PYTHON=py - @if "%_Py_NUGET%"=="" (set _Py_NUGET=%_Py_EXTERNALS_DIR%\nuget.exe) --@if "%_Py_NUGET_URL%"=="" (set _Py_NUGET_URL=https://aka.ms/nugetclidl) -+@if "%_Py_NUGET_URL%"=="" (set _Py_NUGET_URL=https://dist.nuget.org/win-x86-commandline/latest/nuget.exe) - @if NOT exist "%_Py_NUGET%" ( - @if not "%_Py_Quiet%"=="1" @echo Downloading nuget... - @rem NB: Must use single quotes around NUGET here, NOT double! -@@ -66,6 +66,9 @@ - @%_Py_HOST_PYTHON% -E "%_Py_D%\urlretrieve.py" "%_Py_NUGET_URL%" "%_Py_NUGET%" - ) - ) -+ -+@rem ensure nuget.org source exist -+@"%_Py_NUGET%" sources add -Name nuget.org -Source https://api.nuget.org/v3/index.json >nul 2>nul - - @if not "%_Py_Quiet%"=="1" @echo Installing Python via nuget... - @if not "%_Py_Quiet%"=="1" ( From c7cfcca1010712205443941ab45e24f545f375ac Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Tue, 18 Aug 2026 20:25:19 +0000 Subject: [PATCH 14/16] =?UTF-8?q?PKG-15601/PKG-2624=20=E2=80=94=20address?= =?UTF-8?q?=20review:=20cmake=20debug=20skip,=20win=20paths,=20cmake-no-sy?= =?UTF-8?q?stem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Skip FindPythonLibs cmake test for freethreading and debug builds - Use cmake-no-system (latest on main) to avoid cmake/libzstd dyld abort on osx - Restore CF-style double-backslash win path checks - Document intentional drop of linkage_nature env Jinja vs conda-forge Co-authored-by: Cursor --- recipe/meta.yaml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d1692fce1..05d32ac1e 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -14,6 +14,9 @@ # Sanitize build system env. var tweak parameters # (passed to the build scripts via script_env). +# Intentional AR divergence from conda-forge: drop PY_INTERP_LINKAGE_NATURE / +# from_source_control os.environ Jinja in favor of CBC freethreading + build_type. +# Empty linkage_nature (no _shared/_static in build string) matches current AR py315. {% set abi_tag = "cp" + ver2nd + ("t" if freethreading == "yes" else "") %} {% set build_number = build_number + (0 if freethreading == "yes" else 100) %} {% set py_interp_debug = "yes" if build_type == "debug" else "no" %} @@ -175,7 +178,7 @@ outputs: test: requires: - ripgrep - - cmake + - cmake-no-system - make # [unix] - ninja - {{ stdlib('c') }} @@ -220,18 +223,19 @@ outputs: - if not exist %PREFIX%\\Scripts\\idle-script.py exit 1 # [win] - if not exist %PREFIX%\\Scripts\\idle.exe exit 1 # [win] - if not exist %PREFIX%\\Scripts\\pydoc.exe exit 1 # [win] - - if not exist %PREFIX%\include\pyconfig.h exit 1 # [win] - - if not exist %PREFIX%\libs\python3t.lib exit 1 # [win and freethreading == "yes"] - - if not exist %PREFIX%\libs\python{{ ver2nd }}t.lib exit 1 # [win and freethreading == "yes"] - - if not exist %PREFIX%\libs\python3.lib exit 1 # [win and freethreading == "no"] - - if not exist %PREFIX%\libs\python{{ ver2nd }}.lib exit 1 # [win and freethreading == "no"] + - if not exist %PREFIX%\\include\\pyconfig.h exit 1 # [win] + - if not exist %PREFIX%\\libs\\python3t.lib exit 1 # [win and freethreading == "yes"] + - if not exist %PREFIX%\\libs\\python{{ ver2nd }}t.lib exit 1 # [win and freethreading == "yes"] + - if not exist %PREFIX%\\libs\\python3.lib exit 1 # [win and freethreading == "no"] + - if not exist %PREFIX%\\libs\\python{{ ver2nd }}.lib exit 1 # [win and freethreading == "no"] - pushd tests - pushd prefix-replacement # [unix] - bash build-and-test.sh # [unix] - popd # [unix] - pushd cmake -{% if freethreading == "no" %} - # TODO: use the new FindPython3 which supports freethreading +{% if freethreading == "no" and build_type != "debug" %} + # FindPythonLibs does not know freethreading/debug ABIs; skip those variants. + # TODO: use FindPython3 once it supports freethreading (cmake#26016). - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . {% endif %} - popd From d15d307922246c8b18e85530fbf60d8d51d13c20 Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Wed, 19 Aug 2026 07:40:25 +0000 Subject: [PATCH 15/16] =?UTF-8?q?PKG-15601/PKG-2624=20=E2=80=94=20finish?= =?UTF-8?q?=20conda-forge=20review=20alignment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restore the cross-build pyc exclusion, remove the unsupported profraw cleanup and stale lint suppression, and express cmake gating as a linter-compatible selector. Co-authored-by: Cursor --- recipe/meta.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 05d32ac1e..bb3cb2668 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -101,6 +101,8 @@ outputs: # - lib/libpython3.dylib # [osx] # match python.org compiler standard (vc14+ only for 3.15) skip: true # [win and vc < 14] + skip_compile_pyc: + - '*.py' # [build_platform != target_platform] string: {{ dev_ }}h{{ PKG_HASH }}_{{ PKG_BUILDNUM }}{{ debug }}_{{ abi_tag }} python_site_packages_path: {{ site_packages_path }} track_features: # [freethreading == "yes"] @@ -233,15 +235,12 @@ outputs: - bash build-and-test.sh # [unix] - popd # [unix] - pushd cmake -{% if freethreading == "no" and build_type != "debug" %} # FindPythonLibs does not know freethreading/debug ABIs; skip those variants. # TODO: use FindPython3 once it supports freethreading (cmake#26016). - - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . -{% endif %} + - cmake -GNinja -DPY_VER={{ version }} --debug-find --trace --debug-output --debug-trycompile . # [freethreading == "no" and build_type != "debug"] - popd - popd - python run_test.py - - rm -f default.profraw # [osx] - test ! -f default.profraw # [osx] # Test workaround for https://github.com/conda/conda/issues/10969 - python3.1 --version # [unix] @@ -360,5 +359,3 @@ extra: - scopatz - katietz - xhochy - skip-lints: - - license_file_overspecified From 00142c8c1477fea0bf9c2a8076424a942752922f Mon Sep 17 00:00:00 2001 From: Serhii Kupriienko Date: Wed, 19 Aug 2026 08:31:25 +0000 Subject: [PATCH 16/16] =?UTF-8?q?PKG-17264=20=E2=80=94=20port=203.15.0rc1?= =?UTF-8?q?=20+=20LLVM21=20onto=20CF-align=20for=20main?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bring rc1 version/sha, tk 9, osx clang 21 CBC pins, llvm-ar-21 wrappers, refreshed patches from PR #244; drop testing upload_channels so PBP defaults to pkgs/main. Keep freethreading + build_type CF-align. Co-authored-by: Cursor --- abs.yaml | 7 ++++--- recipe/build_base.sh | 4 ++-- recipe/conda_build_config.yaml | 8 ++++++++ recipe/meta.yaml | 8 ++++---- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/abs.yaml b/abs.yaml index 31c3d0cba..e9534a31b 100644 --- a/abs.yaml +++ b/abs.yaml @@ -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 diff --git a/recipe/build_base.sh b/recipe/build_base.sh index cd5b70067..af1e1de37 100644 --- a/recipe/build_base.sh +++ b/recipe/build_base.sh @@ -202,7 +202,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 @@ -211,7 +211,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" diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml index da799a777..8270fb961 100644 --- a/recipe/conda_build_config.yaml +++ b/recipe/conda_build_config.yaml @@ -7,6 +7,14 @@ numpy: # 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))] diff --git a/recipe/meta.yaml b/recipe/meta.yaml index bb3cb2668..6475daa9b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,5 +1,5 @@ {% set version = "3.15.0" %} -{% set dev = "b4" %} +{% set dev = "rc1" %} {% set dev_ = "" %} {% set ver2 = '.'.join(version.split('.')[0:2]) %} {% set ver2nd = ''.join(version.split('.')[0:2]) %} @@ -31,7 +31,7 @@ package: source: - url: https://www.python.org/ftp/python/{{ version }}/Python-{{ version }}{{ dev }}.tar.xz # md5 from: https://www.python.org/downloads/release/python-{{ ver3nd }}/ - sha256: 93efb9c88d7b6633368e7f7b8f8db6e98988f7f761c09b77849447262841ce3a + sha256: f84dad680ab2147417d2739355c2678f0f9acffe4ae8ef77895de1454b384b07 patches: - patches/0001-Win32-Change-FD_SETSIZE-from-512-to-2048.patch - patches/0002-Win32-Do-not-download-externals.patch @@ -140,14 +140,14 @@ outputs: - make # [not win] - libtool # [unix] - pkg-config # [not win] - # configure script looks for llvm-ar for lto - - llvm-tools # [osx] - ld_impl_{{ target_platform }} # [linux] # called in build_base.sh - ripgrep # [not win] - binutils_impl_{{ target_platform }} # [linux] # https://github.com/python/cpython/blob/main/Tools/jit/README.md#installing-llvm: # "LLVM version 21 is the officially supported version" + # Also supplies llvm-ar-21, which build_base.sh wraps as the lto archiver + # that configure picks up via $HOST-llvm-ar. - clang-21 # [not win] - llvm-tools-21 # [not win] - clang 21.* # [win]