From d930e122854358d99220a980e6a27382c22ad9a5 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Wed, 17 Dec 2025 09:18:22 +0000 Subject: [PATCH 01/15] pixi builds for free-threading and tsan --- Tools/pixi-packages/README.md | 8 ++- Tools/pixi-packages/build.sh | 12 +++- Tools/pixi-packages/free-threading/pixi.toml | 8 +++ .../pixi-packages/free-threading/recipe.yaml | 63 +++++++++++++++++++ Tools/pixi-packages/tsan/pixi.toml | 8 +++ Tools/pixi-packages/tsan/recipe.yaml | 63 +++++++++++++++++++ 6 files changed, 157 insertions(+), 5 deletions(-) create mode 100644 Tools/pixi-packages/free-threading/pixi.toml create mode 100644 Tools/pixi-packages/free-threading/recipe.yaml create mode 100644 Tools/pixi-packages/tsan/pixi.toml create mode 100644 Tools/pixi-packages/tsan/recipe.yaml diff --git a/Tools/pixi-packages/README.md b/Tools/pixi-packages/README.md index 50c3315ac0e5fc..049f38b06b93d0 100644 --- a/Tools/pixi-packages/README.md +++ b/Tools/pixi-packages/README.md @@ -12,7 +12,7 @@ python = { git = "https://github.com/python/cpython", subdirectory = "Tools/pixi ``` This is particularly useful when developers need to build CPython from source -(for example, for an ASan-instrumented build), as it does not require any manual +(for example, for an ASan or TSan-instrumented build), as it does not require any manual clone or build steps. Instead, Pixi will automatically handle both the build and installation of the package. @@ -20,7 +20,9 @@ Each package definition is contained in a subdirectory, but they share the build `build.sh` in this directory. Currently defined package variants: - `default` -- `asan`: ASan-instrumented build with `PYTHON_ASAN=1` +- `free-threading` +- `asan`: ASan-instrumented build +- `tsan`: free-threading, TSan-instrumented build ## Maintenance @@ -30,7 +32,7 @@ Each package definition is contained in a subdirectory, but they share the build ## Opportunities for future improvement -- More package variants (such as TSan, UBSan) +- More package variants (such as UBSan) - Support for Windows - Using a single `pixi.toml` and `recipe.yaml` for all package variants is blocked on https://github.com/prefix-dev/pixi/issues/4599 - A workaround can be removed from the build script once https://github.com/prefix-dev/rattler-build/issues/2012 is resolved diff --git a/Tools/pixi-packages/build.sh b/Tools/pixi-packages/build.sh index 120f1d6bb0088a..6fe9b4ba50c662 100644 --- a/Tools/pixi-packages/build.sh +++ b/Tools/pixi-packages/build.sh @@ -1,11 +1,19 @@ #!/bin/bash -if [[ "${PYTHON_VARIANT}" == "asan" ]]; then +if [[ "${PYTHON_VARIANT}" == "free-threading" ]]; then + echo "BUILD TYPE: FREE-THREADING" + BUILD_DIR="../build_free_threading" + CONFIGURE_EXTRA="--disable-gil" +elif [[ "${PYTHON_VARIANT}" == "asan" ]]; then echo "BUILD TYPE: ASAN" BUILD_DIR="../build_asan" CONFIGURE_EXTRA="--with-address-sanitizer" - export PYTHON_ASAN="1" export ASAN_OPTIONS="strict_init_order=true" +elif [[ "${PYTHON_VARIANT}" == "tsan" ]]; then + echo "BUILD TYPE: TSAN" + BUILD_DIR="../build_tsan" + CONFIGURE_EXTRA="--disable-gil --with-thread-sanitizer" + export TSAN_OPTIONS="suppressions=${SRC_DIR}/Tools/tsan/suppressions_free_threading.txt" else echo "BUILD TYPE: DEFAULT" BUILD_DIR="../build" diff --git a/Tools/pixi-packages/free-threading/pixi.toml b/Tools/pixi-packages/free-threading/pixi.toml new file mode 100644 index 00000000000000..001ff78fa5d8cb --- /dev/null +++ b/Tools/pixi-packages/free-threading/pixi.toml @@ -0,0 +1,8 @@ +[workspace] +channels = ["https://prefix.dev/conda-forge"] +platforms = ["osx-arm64", "linux-64"] +preview = ["pixi-build"] + +[package.build.backend] +name = "pixi-build-rattler-build" +version = "*" diff --git a/Tools/pixi-packages/free-threading/recipe.yaml b/Tools/pixi-packages/free-threading/recipe.yaml new file mode 100644 index 00000000000000..61c01562d35519 --- /dev/null +++ b/Tools/pixi-packages/free-threading/recipe.yaml @@ -0,0 +1,63 @@ +context: + # Keep up to date + version: "3.15" + +package: + name: python + version: ${{ version }} + +source: + - path: ../../.. + +build: + files: + exclude: + - "*.o" + script: + file: ../build.sh + env: + PYTHON_VARIANT: "free-threading" + +# derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml +requirements: + build: + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + - make + - pkg-config + # configure script looks for llvm-ar for lto + - if: osx + then: + - llvm-tools + - if: linux + then: + - ld_impl_${{ target_platform }} + - binutils_impl_${{ target_platform }} + - clang-19 + - llvm-tools-19 + + host: + - bzip2 + - sqlite + - liblzma-devel + - zlib + - zstd + - openssl + - readline + - tk + # These two are just to get the headers needed for tk.h, but is unused + - xorg-libx11 + - xorg-xorgproto + - ncurses + - libffi + - if: linux + then: + - ld_impl_${{ target_platform }} + - libuuid + - libmpdec-devel + - expat + +about: + homepage: https://www.python.org/ + license: Python-2.0 + license_file: LICENSE diff --git a/Tools/pixi-packages/tsan/pixi.toml b/Tools/pixi-packages/tsan/pixi.toml new file mode 100644 index 00000000000000..001ff78fa5d8cb --- /dev/null +++ b/Tools/pixi-packages/tsan/pixi.toml @@ -0,0 +1,8 @@ +[workspace] +channels = ["https://prefix.dev/conda-forge"] +platforms = ["osx-arm64", "linux-64"] +preview = ["pixi-build"] + +[package.build.backend] +name = "pixi-build-rattler-build" +version = "*" diff --git a/Tools/pixi-packages/tsan/recipe.yaml b/Tools/pixi-packages/tsan/recipe.yaml new file mode 100644 index 00000000000000..f036cac180d22f --- /dev/null +++ b/Tools/pixi-packages/tsan/recipe.yaml @@ -0,0 +1,63 @@ +context: + # Keep up to date + version: "3.15" + +package: + name: python + version: ${{ version }} + +source: + - path: ../../.. + +build: + files: + exclude: + - "*.o" + script: + file: ../build.sh + env: + PYTHON_VARIANT: "tsan" + +# derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml +requirements: + build: + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + - make + - pkg-config + # configure script looks for llvm-ar for lto + - if: osx + then: + - llvm-tools + - if: linux + then: + - ld_impl_${{ target_platform }} + - binutils_impl_${{ target_platform }} + - clang-19 + - llvm-tools-19 + + host: + - bzip2 + - sqlite + - liblzma-devel + - zlib + - zstd + - openssl + - readline + - tk + # These two are just to get the headers needed for tk.h, but is unused + - xorg-libx11 + - xorg-xorgproto + - ncurses + - libffi + - if: linux + then: + - ld_impl_${{ target_platform }} + - libuuid + - libmpdec-devel + - expat + +about: + homepage: https://www.python.org/ + license: Python-2.0 + license_file: LICENSE From 57d45b97a63eff8e14287f8ff01ffa41641a52fa Mon Sep 17 00:00:00 2001 From: crusaderky Date: Fri, 2 Jan 2026 15:25:13 +0000 Subject: [PATCH 02/15] Rename to tsan-free-threading --- Tools/pixi-packages/README.md | 2 +- Tools/pixi-packages/build.sh | 6 +++--- Tools/pixi-packages/{tsan => tsan-free-threading}/pixi.toml | 0 .../pixi-packages/{tsan => tsan-free-threading}/recipe.yaml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename Tools/pixi-packages/{tsan => tsan-free-threading}/pixi.toml (100%) rename Tools/pixi-packages/{tsan => tsan-free-threading}/recipe.yaml (96%) diff --git a/Tools/pixi-packages/README.md b/Tools/pixi-packages/README.md index 049f38b06b93d0..c5fc4a1af15c21 100644 --- a/Tools/pixi-packages/README.md +++ b/Tools/pixi-packages/README.md @@ -22,7 +22,7 @@ Each package definition is contained in a subdirectory, but they share the build - `default` - `free-threading` - `asan`: ASan-instrumented build -- `tsan`: free-threading, TSan-instrumented build +- `tsan-free-threading`: TSan-instrumented free-threading build ## Maintenance diff --git a/Tools/pixi-packages/build.sh b/Tools/pixi-packages/build.sh index 6fe9b4ba50c662..b2bceda779f2cc 100644 --- a/Tools/pixi-packages/build.sh +++ b/Tools/pixi-packages/build.sh @@ -9,9 +9,9 @@ elif [[ "${PYTHON_VARIANT}" == "asan" ]]; then BUILD_DIR="../build_asan" CONFIGURE_EXTRA="--with-address-sanitizer" export ASAN_OPTIONS="strict_init_order=true" -elif [[ "${PYTHON_VARIANT}" == "tsan" ]]; then - echo "BUILD TYPE: TSAN" - BUILD_DIR="../build_tsan" +elif [[ "${PYTHON_VARIANT}" == "tsan-free-threading" ]]; then + echo "BUILD TYPE: TSAN FREE-THREADING" + BUILD_DIR="../build_tsan_free_threading" CONFIGURE_EXTRA="--disable-gil --with-thread-sanitizer" export TSAN_OPTIONS="suppressions=${SRC_DIR}/Tools/tsan/suppressions_free_threading.txt" else diff --git a/Tools/pixi-packages/tsan/pixi.toml b/Tools/pixi-packages/tsan-free-threading/pixi.toml similarity index 100% rename from Tools/pixi-packages/tsan/pixi.toml rename to Tools/pixi-packages/tsan-free-threading/pixi.toml diff --git a/Tools/pixi-packages/tsan/recipe.yaml b/Tools/pixi-packages/tsan-free-threading/recipe.yaml similarity index 96% rename from Tools/pixi-packages/tsan/recipe.yaml rename to Tools/pixi-packages/tsan-free-threading/recipe.yaml index f036cac180d22f..dfae06ad7a51d5 100644 --- a/Tools/pixi-packages/tsan/recipe.yaml +++ b/Tools/pixi-packages/tsan-free-threading/recipe.yaml @@ -16,7 +16,7 @@ build: script: file: ../build.sh env: - PYTHON_VARIANT: "tsan" + PYTHON_VARIANT: "tsan-free-threading" # derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml requirements: From 5ff29b41afa3d0f56035600ee901d325a093ee12 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Fri, 2 Jan 2026 15:25:27 +0000 Subject: [PATCH 03/15] Add libclang_rt hack --- Tools/pixi-packages/build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tools/pixi-packages/build.sh b/Tools/pixi-packages/build.sh index b2bceda779f2cc..8926de2603846f 100644 --- a/Tools/pixi-packages/build.sh +++ b/Tools/pixi-packages/build.sh @@ -41,5 +41,6 @@ ln -sf "${PREFIX}/bin/python3" "${PREFIX}/bin/python" # https://github.com/prefix-dev/rattler-build/issues/2012 if [[ ${OSTYPE} == "darwin"* ]]; then - cp "${BUILD_PREFIX}/lib/clang/21/lib/darwin/libclang_rt.asan_osx_dynamic.dylib" "${PREFIX}/lib/libclang_rt.asan_osx_dynamic.dylib" + cp "${BUILD_PREFIX}/lib/clang/21/lib/darwin/libclang_rt.asan_osx_dynamic.dylib" "${PREFIX}/lib/" + cp "${BUILD_PREFIX}/lib/clang/21/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib" "${PREFIX}/lib/" fi From 9a2a8963286077536f67b89a2123355aeb049a3d Mon Sep 17 00:00:00 2001 From: crusaderky Date: Fri, 2 Jan 2026 16:02:29 +0000 Subject: [PATCH 04/15] Add troubleshooting for tsan --- Tools/pixi-packages/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Tools/pixi-packages/README.md b/Tools/pixi-packages/README.md index c5fc4a1af15c21..94d606cee3439d 100644 --- a/Tools/pixi-packages/README.md +++ b/Tools/pixi-packages/README.md @@ -36,3 +36,18 @@ Each package definition is contained in a subdirectory, but they share the build - Support for Windows - Using a single `pixi.toml` and `recipe.yaml` for all package variants is blocked on https://github.com/prefix-dev/pixi/issues/4599 - A workaround can be removed from the build script once https://github.com/prefix-dev/rattler-build/issues/2012 is resolved + +## Troubleshooting + +TSan builds may crash on Linux with +``` +FATAL: ThreadSanitizer: unexpected memory mapping 0x7977bd072000-0x7977bd500000 +``` +To fix it, try reducing `mmap_rnd_bits`: + +```bash +$ sudo sysctl vm.mmap_rnd_bits +vm.mmap_rnd_bits = 32 # too high for TSan +$ sudo sysctl vm.mmap_rnd_bits=28 # reduce it +vm.mmap_rnd_bits = 28 +``` From 97979e08317e44e3473252196f6d9243ae31e4df Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 8 Jan 2026 12:59:30 -0800 Subject: [PATCH 05/15] Add python_abi output and refactor - Remove clang-19 since we are not building the experimental jit - Remove ld_impl because we are not hacking the makefiles - Add site_packages_path - Make recipe.yaml identical with just the variant name difference - Add a generate.sh to generate recipe.yaml from default variant - Add a runtime requirement of libsanitizer for gcc --- Tools/pixi-packages/asan/recipe.yaml | 121 +++++++++++------- Tools/pixi-packages/build.sh | 1 + Tools/pixi-packages/default/recipe.yaml | 117 ++++++++++------- .../pixi-packages/free-threading/recipe.yaml | 121 +++++++++++------- Tools/pixi-packages/generate.sh | 12 ++ Tools/pixi-packages/recipe.yaml | 88 +++++++++++++ .../tsan-free-threading/recipe.yaml | 121 +++++++++++------- 7 files changed, 392 insertions(+), 189 deletions(-) create mode 100644 Tools/pixi-packages/generate.sh create mode 100644 Tools/pixi-packages/recipe.yaml diff --git a/Tools/pixi-packages/asan/recipe.yaml b/Tools/pixi-packages/asan/recipe.yaml index dea88394ad9fe2..e27e5235fc554d 100644 --- a/Tools/pixi-packages/asan/recipe.yaml +++ b/Tools/pixi-packages/asan/recipe.yaml @@ -1,61 +1,86 @@ context: # Keep up to date version: "3.15" + variant: "asan" + freethreading_tag: ${{ "t" if "free-threading" in variant else "" }} + abi_tag: cp${{ version | split(".") | join("") }}${{ freethreading_tag }} -package: +recipe: name: python - version: ${{ version }} source: - path: ../../.. -build: - files: - exclude: - - "*.o" - script: - file: ../build.sh - env: - PYTHON_VARIANT: "asan" - -# derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml -requirements: +outputs: +- package: + name: python_abi + version: ${{ version }} build: - - ${{ compiler('c') }} - - ${{ compiler('cxx') }} - - make - - pkg-config - # configure script looks for llvm-ar for lto - - if: osx - then: - - llvm-tools - - if: linux - then: - - ld_impl_${{ target_platform }} - - binutils_impl_${{ target_platform }} - - clang-19 - - llvm-tools-19 - - host: - - bzip2 - - sqlite - - liblzma-devel - - zlib - - zstd - - openssl - - readline - - tk - # These two are just to get the headers needed for tk.h, but is unused - - xorg-libx11 - - xorg-xorgproto - - ncurses - - libffi - - if: linux - then: - - ld_impl_${{ target_platform }} - - libuuid - - libmpdec-devel - - expat + string: "0_cp35" + requirements: + run_constraints: + - python ${{ version }}.* *_cp35 + +- package: + name: python + version: ${{ version }} + build: + string: "0_cp35" + files: + exclude: + - "*.o" + script: + file: ../build.sh + env: + PYTHON_VARIANT: ${{ variant }} + python: + site_packages_path: "lib/python${{ version }}${{ freethreading_tag }}/site-packages" + + # derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml + requirements: + build: + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + - make + - pkg-config + # configure script looks for llvm-ar for lto + - if: osx + then: + - llvm-tools + + host: + - bzip2 + - sqlite + - liblzma-devel + - zlib + - zstd + - openssl + - readline + - tk + # These two are just to get the headers needed for tk.h, but is unused + - xorg-libx11 + - xorg-xorgproto + - ncurses + - libffi + - if: linux + then: + - libuuid + - libmpdec-devel + - expat + - if: c_compiler == "gcc" and "san" in variant + then: + - libsanitizer + + ignore_run_exports: + from_package: + - xorg-libx11 + - xorg-xorgproto + + run_exports: + noarch: + - python + weak: + - python_abi ${{ version }}.* *_cp${{ version | split(".") | join("") }}${{ freethreading_tag }} about: homepage: https://www.python.org/ diff --git a/Tools/pixi-packages/build.sh b/Tools/pixi-packages/build.sh index 8926de2603846f..6332ef15564a6a 100644 --- a/Tools/pixi-packages/build.sh +++ b/Tools/pixi-packages/build.sh @@ -31,6 +31,7 @@ else --oldincludedir="${BUILD_PREFIX}/${HOST}/sysroot/usr/include" \ --enable-shared \ --srcdir="${SRC_DIR}" \ + --with-system-expat \ ${CONFIGURE_EXTRA} fi diff --git a/Tools/pixi-packages/default/recipe.yaml b/Tools/pixi-packages/default/recipe.yaml index eeb4052ec3859c..93d6c664d6ec4e 100644 --- a/Tools/pixi-packages/default/recipe.yaml +++ b/Tools/pixi-packages/default/recipe.yaml @@ -1,59 +1,86 @@ context: # Keep up to date version: "3.15" + variant: "default" + freethreading_tag: ${{ "t" if "free-threading" in variant else "" }} + abi_tag: cp${{ version | split(".") | join("") }}${{ freethreading_tag }} -package: +recipe: name: python - version: ${{ version }} source: - path: ../../.. -build: - files: - exclude: - - "*.o" - script: - file: ../build.sh +outputs: +- package: + name: python_abi + version: ${{ version }} + build: + string: "0_cp35" + requirements: + run_constraints: + - python ${{ version }}.* *_cp35 -# derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml -requirements: +- package: + name: python + version: ${{ version }} build: - - ${{ compiler('c') }} - - ${{ compiler('cxx') }} - - make - - pkg-config - # configure script looks for llvm-ar for lto - - if: osx - then: - - llvm-tools - - if: linux - then: - - ld_impl_${{ target_platform }} - - binutils_impl_${{ target_platform }} - - clang-19 - - llvm-tools-19 - - host: - - bzip2 - - sqlite - - liblzma-devel - - zlib - - zstd - - openssl - - readline - - tk - # These two are just to get the headers needed for tk.h, but is unused - - xorg-libx11 - - xorg-xorgproto - - ncurses - - libffi - - if: linux - then: - - ld_impl_${{ target_platform }} - - libuuid - - libmpdec-devel - - expat + string: "0_cp35" + files: + exclude: + - "*.o" + script: + file: ../build.sh + env: + PYTHON_VARIANT: ${{ variant }} + python: + site_packages_path: "lib/python${{ version }}${{ freethreading_tag }}/site-packages" + + # derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml + requirements: + build: + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + - make + - pkg-config + # configure script looks for llvm-ar for lto + - if: osx + then: + - llvm-tools + + host: + - bzip2 + - sqlite + - liblzma-devel + - zlib + - zstd + - openssl + - readline + - tk + # These two are just to get the headers needed for tk.h, but is unused + - xorg-libx11 + - xorg-xorgproto + - ncurses + - libffi + - if: linux + then: + - libuuid + - libmpdec-devel + - expat + - if: c_compiler == "gcc" and "san" in variant + then: + - libsanitizer + + ignore_run_exports: + from_package: + - xorg-libx11 + - xorg-xorgproto + + run_exports: + noarch: + - python + weak: + - python_abi ${{ version }}.* *_cp${{ version | split(".") | join("") }}${{ freethreading_tag }} about: homepage: https://www.python.org/ diff --git a/Tools/pixi-packages/free-threading/recipe.yaml b/Tools/pixi-packages/free-threading/recipe.yaml index 61c01562d35519..14e3b47d0b298d 100644 --- a/Tools/pixi-packages/free-threading/recipe.yaml +++ b/Tools/pixi-packages/free-threading/recipe.yaml @@ -1,61 +1,86 @@ context: # Keep up to date version: "3.15" + variant: "free-threading" + freethreading_tag: ${{ "t" if "free-threading" in variant else "" }} + abi_tag: cp${{ version | split(".") | join("") }}${{ freethreading_tag }} -package: +recipe: name: python - version: ${{ version }} source: - path: ../../.. -build: - files: - exclude: - - "*.o" - script: - file: ../build.sh - env: - PYTHON_VARIANT: "free-threading" - -# derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml -requirements: +outputs: +- package: + name: python_abi + version: ${{ version }} build: - - ${{ compiler('c') }} - - ${{ compiler('cxx') }} - - make - - pkg-config - # configure script looks for llvm-ar for lto - - if: osx - then: - - llvm-tools - - if: linux - then: - - ld_impl_${{ target_platform }} - - binutils_impl_${{ target_platform }} - - clang-19 - - llvm-tools-19 - - host: - - bzip2 - - sqlite - - liblzma-devel - - zlib - - zstd - - openssl - - readline - - tk - # These two are just to get the headers needed for tk.h, but is unused - - xorg-libx11 - - xorg-xorgproto - - ncurses - - libffi - - if: linux - then: - - ld_impl_${{ target_platform }} - - libuuid - - libmpdec-devel - - expat + string: "0_cp35t" + requirements: + run_constraints: + - python ${{ version }}.* *_cp35t + +- package: + name: python + version: ${{ version }} + build: + string: "0_cp35t" + files: + exclude: + - "*.o" + script: + file: ../build.sh + env: + PYTHON_VARIANT: ${{ variant }} + python: + site_packages_path: "lib/python${{ version }}${{ freethreading_tag }}/site-packages" + + # derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml + requirements: + build: + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + - make + - pkg-config + # configure script looks for llvm-ar for lto + - if: osx + then: + - llvm-tools + + host: + - bzip2 + - sqlite + - liblzma-devel + - zlib + - zstd + - openssl + - readline + - tk + # These two are just to get the headers needed for tk.h, but is unused + - xorg-libx11 + - xorg-xorgproto + - ncurses + - libffi + - if: linux + then: + - libuuid + - libmpdec-devel + - expat + - if: c_compiler == "gcc" and "san" in variant + then: + - libsanitizer + + ignore_run_exports: + from_package: + - xorg-libx11 + - xorg-xorgproto + + run_exports: + noarch: + - python + weak: + - python_abi ${{ version }}.* *_cp${{ version | split(".") | join("") }}${{ freethreading_tag }} about: homepage: https://www.python.org/ diff --git a/Tools/pixi-packages/generate.sh b/Tools/pixi-packages/generate.sh new file mode 100644 index 00000000000000..435449812d49d5 --- /dev/null +++ b/Tools/pixi-packages/generate.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Using a single `pixi.toml` and `recipe.yaml` for all package variants is blocked on https://github.com/prefix-dev/pixi/issues/4599 + +for name in default asan free-threading tsan-free-threading; do + if [[ "${name}" == *free-threading* ]]; then + tag="cp35t" + else + tag="cp35" + fi + sed -e 's/variant: "default"/variant: "'${name}'"/g' -e 's/${{ abi_tag }}/'${tag}'/g' Tools/pixi-packages/recipe.yaml > Tools/pixi-packages/${name}/recipe.yaml +done diff --git a/Tools/pixi-packages/recipe.yaml b/Tools/pixi-packages/recipe.yaml new file mode 100644 index 00000000000000..e6c9f9aad15ccb --- /dev/null +++ b/Tools/pixi-packages/recipe.yaml @@ -0,0 +1,88 @@ +context: + # Keep up to date + version: "3.15" + variant: "default" + freethreading_tag: ${{ "t" if "free-threading" in variant else "" }} + abi_tag: cp${{ version | split(".") | join("") }}${{ freethreading_tag }} + +recipe: + name: python + +source: + - path: ../../.. + +outputs: +- package: + name: python_abi + version: ${{ version }} + build: + string: "0_${{ abi_tag }}" + requirements: + run_constraints: + - python ${{ version }}.* *_${{ abi_tag }} + +- package: + name: python + version: ${{ version }} + build: + string: "0_${{ abi_tag }}" + files: + exclude: + - "*.o" + script: + file: ../build.sh + env: + PYTHON_VARIANT: ${{ variant }} + python: + site_packages_path: "lib/python${{ version }}${{ freethreading_tag }}/site-packages" + + # derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml + requirements: + build: + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + - make + - pkg-config + # configure script looks for llvm-ar for lto + - if: osx + then: + - llvm-tools + + host: + - bzip2 + - sqlite + - liblzma-devel + - zlib + - zstd + - openssl + - readline + - tk + # These two are just to get the headers needed for tk.h, but is unused + - xorg-libx11 + - xorg-xorgproto + - ncurses + - libffi + - if: linux + then: + - libuuid + - libmpdec-devel + - expat + - if: c_compiler == "gcc" and "san" in variant + then: + - libsanitizer + + ignore_run_exports: + from_package: + - xorg-libx11 + - xorg-xorgproto + + run_exports: + noarch: + - python + weak: + - python_abi ${{ version }}.* *_cp${{ version | split(".") | join("") }}${{ freethreading_tag }} + +about: + homepage: https://www.python.org/ + license: Python-2.0 + license_file: LICENSE diff --git a/Tools/pixi-packages/tsan-free-threading/recipe.yaml b/Tools/pixi-packages/tsan-free-threading/recipe.yaml index dfae06ad7a51d5..867aad3ee08e47 100644 --- a/Tools/pixi-packages/tsan-free-threading/recipe.yaml +++ b/Tools/pixi-packages/tsan-free-threading/recipe.yaml @@ -1,61 +1,86 @@ context: # Keep up to date version: "3.15" + variant: "tsan-free-threading" + freethreading_tag: ${{ "t" if "free-threading" in variant else "" }} + abi_tag: cp${{ version | split(".") | join("") }}${{ freethreading_tag }} -package: +recipe: name: python - version: ${{ version }} source: - path: ../../.. -build: - files: - exclude: - - "*.o" - script: - file: ../build.sh - env: - PYTHON_VARIANT: "tsan-free-threading" - -# derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml -requirements: +outputs: +- package: + name: python_abi + version: ${{ version }} build: - - ${{ compiler('c') }} - - ${{ compiler('cxx') }} - - make - - pkg-config - # configure script looks for llvm-ar for lto - - if: osx - then: - - llvm-tools - - if: linux - then: - - ld_impl_${{ target_platform }} - - binutils_impl_${{ target_platform }} - - clang-19 - - llvm-tools-19 - - host: - - bzip2 - - sqlite - - liblzma-devel - - zlib - - zstd - - openssl - - readline - - tk - # These two are just to get the headers needed for tk.h, but is unused - - xorg-libx11 - - xorg-xorgproto - - ncurses - - libffi - - if: linux - then: - - ld_impl_${{ target_platform }} - - libuuid - - libmpdec-devel - - expat + string: "0_cp35t" + requirements: + run_constraints: + - python ${{ version }}.* *_cp35t + +- package: + name: python + version: ${{ version }} + build: + string: "0_cp35t" + files: + exclude: + - "*.o" + script: + file: ../build.sh + env: + PYTHON_VARIANT: ${{ variant }} + python: + site_packages_path: "lib/python${{ version }}${{ freethreading_tag }}/site-packages" + + # derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml + requirements: + build: + - ${{ compiler('c') }} + - ${{ compiler('cxx') }} + - make + - pkg-config + # configure script looks for llvm-ar for lto + - if: osx + then: + - llvm-tools + + host: + - bzip2 + - sqlite + - liblzma-devel + - zlib + - zstd + - openssl + - readline + - tk + # These two are just to get the headers needed for tk.h, but is unused + - xorg-libx11 + - xorg-xorgproto + - ncurses + - libffi + - if: linux + then: + - libuuid + - libmpdec-devel + - expat + - if: c_compiler == "gcc" and "san" in variant + then: + - libsanitizer + + ignore_run_exports: + from_package: + - xorg-libx11 + - xorg-xorgproto + + run_exports: + noarch: + - python + weak: + - python_abi ${{ version }}.* *_cp${{ version | split(".") | join("") }}${{ freethreading_tag }} about: homepage: https://www.python.org/ From 456503b2531f7ca292b5d743a2f485ef6c3a2c8e Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 8 Jan 2026 14:27:32 -0800 Subject: [PATCH 06/15] fix typo --- Tools/pixi-packages/asan/recipe.yaml | 6 +++--- Tools/pixi-packages/default/recipe.yaml | 6 +++--- Tools/pixi-packages/free-threading/recipe.yaml | 6 +++--- Tools/pixi-packages/generate.sh | 4 ++-- Tools/pixi-packages/tsan-free-threading/recipe.yaml | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Tools/pixi-packages/asan/recipe.yaml b/Tools/pixi-packages/asan/recipe.yaml index e27e5235fc554d..5b7a48ac26a59a 100644 --- a/Tools/pixi-packages/asan/recipe.yaml +++ b/Tools/pixi-packages/asan/recipe.yaml @@ -16,16 +16,16 @@ outputs: name: python_abi version: ${{ version }} build: - string: "0_cp35" + string: "0_cp315" requirements: run_constraints: - - python ${{ version }}.* *_cp35 + - python ${{ version }}.* *_cp315 - package: name: python version: ${{ version }} build: - string: "0_cp35" + string: "0_cp315" files: exclude: - "*.o" diff --git a/Tools/pixi-packages/default/recipe.yaml b/Tools/pixi-packages/default/recipe.yaml index 93d6c664d6ec4e..174af1f2bd9db2 100644 --- a/Tools/pixi-packages/default/recipe.yaml +++ b/Tools/pixi-packages/default/recipe.yaml @@ -16,16 +16,16 @@ outputs: name: python_abi version: ${{ version }} build: - string: "0_cp35" + string: "0_cp315" requirements: run_constraints: - - python ${{ version }}.* *_cp35 + - python ${{ version }}.* *_cp315 - package: name: python version: ${{ version }} build: - string: "0_cp35" + string: "0_cp315" files: exclude: - "*.o" diff --git a/Tools/pixi-packages/free-threading/recipe.yaml b/Tools/pixi-packages/free-threading/recipe.yaml index 14e3b47d0b298d..f732e82a707d3b 100644 --- a/Tools/pixi-packages/free-threading/recipe.yaml +++ b/Tools/pixi-packages/free-threading/recipe.yaml @@ -16,16 +16,16 @@ outputs: name: python_abi version: ${{ version }} build: - string: "0_cp35t" + string: "0_cp315t" requirements: run_constraints: - - python ${{ version }}.* *_cp35t + - python ${{ version }}.* *_cp315t - package: name: python version: ${{ version }} build: - string: "0_cp35t" + string: "0_cp315t" files: exclude: - "*.o" diff --git a/Tools/pixi-packages/generate.sh b/Tools/pixi-packages/generate.sh index 435449812d49d5..896ba9fac22b9e 100644 --- a/Tools/pixi-packages/generate.sh +++ b/Tools/pixi-packages/generate.sh @@ -4,9 +4,9 @@ for name in default asan free-threading tsan-free-threading; do if [[ "${name}" == *free-threading* ]]; then - tag="cp35t" + tag="cp315t" else - tag="cp35" + tag="cp315" fi sed -e 's/variant: "default"/variant: "'${name}'"/g' -e 's/${{ abi_tag }}/'${tag}'/g' Tools/pixi-packages/recipe.yaml > Tools/pixi-packages/${name}/recipe.yaml done diff --git a/Tools/pixi-packages/tsan-free-threading/recipe.yaml b/Tools/pixi-packages/tsan-free-threading/recipe.yaml index 867aad3ee08e47..385e07486ee06f 100644 --- a/Tools/pixi-packages/tsan-free-threading/recipe.yaml +++ b/Tools/pixi-packages/tsan-free-threading/recipe.yaml @@ -16,16 +16,16 @@ outputs: name: python_abi version: ${{ version }} build: - string: "0_cp35t" + string: "0_cp315t" requirements: run_constraints: - - python ${{ version }}.* *_cp35t + - python ${{ version }}.* *_cp315t - package: name: python version: ${{ version }} build: - string: "0_cp35t" + string: "0_cp315t" files: exclude: - "*.o" From c46f283846b6fcb8b82d9110c9332a71d3aaaf94 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 8 Jan 2026 18:07:08 -0800 Subject: [PATCH 07/15] Use single recipe.yaml duplicated across directories --- Tools/pixi-packages/README.md | 8 +- Tools/pixi-packages/asan/pixi.toml | 5 ++ Tools/pixi-packages/asan/recipe.yaml | 14 +-- Tools/pixi-packages/build.sh | 4 +- Tools/pixi-packages/default/pixi.toml | 5 ++ Tools/pixi-packages/default/recipe.yaml | 16 ++-- .../pixi.toml | 5 ++ .../recipe.yaml | 14 +-- Tools/pixi-packages/generate.sh | 9 +- Tools/pixi-packages/recipe.yaml | 88 ------------------- .../pixi.toml | 5 ++ .../recipe.yaml | 14 +-- 12 files changed, 57 insertions(+), 130 deletions(-) rename Tools/pixi-packages/{free-threading => freethreading}/pixi.toml (66%) rename Tools/pixi-packages/{free-threading => freethreading}/recipe.yaml (80%) delete mode 100644 Tools/pixi-packages/recipe.yaml rename Tools/pixi-packages/{tsan-free-threading => tsan_freethreading}/pixi.toml (65%) rename Tools/pixi-packages/{tsan-free-threading => tsan_freethreading}/recipe.yaml (80%) diff --git a/Tools/pixi-packages/README.md b/Tools/pixi-packages/README.md index 94d606cee3439d..99e92f3cb3d90a 100644 --- a/Tools/pixi-packages/README.md +++ b/Tools/pixi-packages/README.md @@ -20,14 +20,14 @@ Each package definition is contained in a subdirectory, but they share the build `build.sh` in this directory. Currently defined package variants: - `default` -- `free-threading` +- `freethreading` - `asan`: ASan-instrumented build -- `tsan-free-threading`: TSan-instrumented free-threading build +- `tsan_freethreading`: TSan-instrumented free-threading build ## Maintenance -- Keep the `version` fields in each `recipe.yaml` up to date with the Python version -- Keep the dependency requirements up to date in each `recipe.yaml` +- Keep the `abi_tag` and `version` fields in each `pixi.toml` up to date with the Python version +- If you update one `recipe.yaml` file, update all - Update `build.sh` for any breaking changes in the `configure` and `make` workflow ## Opportunities for future improvement diff --git a/Tools/pixi-packages/asan/pixi.toml b/Tools/pixi-packages/asan/pixi.toml index 001ff78fa5d8cb..7c8200067d8cdf 100644 --- a/Tools/pixi-packages/asan/pixi.toml +++ b/Tools/pixi-packages/asan/pixi.toml @@ -3,6 +3,11 @@ channels = ["https://prefix.dev/conda-forge"] platforms = ["osx-arm64", "linux-64"] preview = ["pixi-build"] +[workspace.build-variants] +variant = ["asan"] +abi_tag = ["cp315"] +version = ["3.15"] + [package.build.backend] name = "pixi-build-rattler-build" version = "*" diff --git a/Tools/pixi-packages/asan/recipe.yaml b/Tools/pixi-packages/asan/recipe.yaml index 5b7a48ac26a59a..a59e7db9e6353f 100644 --- a/Tools/pixi-packages/asan/recipe.yaml +++ b/Tools/pixi-packages/asan/recipe.yaml @@ -1,9 +1,9 @@ context: # Keep up to date version: "3.15" - variant: "asan" - freethreading_tag: ${{ "t" if "free-threading" in variant else "" }} - abi_tag: cp${{ version | split(".") | join("") }}${{ freethreading_tag }} + variant: ${{ variant }} + freethreading_tag: ${{ "t" if "freethreading" in variant else "" }} + abi_tag: ${{ abi_tag }} recipe: name: python @@ -16,16 +16,16 @@ outputs: name: python_abi version: ${{ version }} build: - string: "0_cp315" + string: "0_${{ variant }}_${{ abi_tag }}" requirements: run_constraints: - - python ${{ version }}.* *_cp315 + - python ${{ version }}.* *_${{ variant }}_${{ abi_tag }} - package: name: python version: ${{ version }} build: - string: "0_cp315" + string: "0_${{ variant }}_${{ abi_tag }}" files: exclude: - "*.o" @@ -80,7 +80,7 @@ outputs: noarch: - python weak: - - python_abi ${{ version }}.* *_cp${{ version | split(".") | join("") }}${{ freethreading_tag }} + - python_abi ${{ version }}.* *_${{ variant }}_${{ abi_tag }} about: homepage: https://www.python.org/ diff --git a/Tools/pixi-packages/build.sh b/Tools/pixi-packages/build.sh index 6332ef15564a6a..1a4f5d6a26b415 100644 --- a/Tools/pixi-packages/build.sh +++ b/Tools/pixi-packages/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -if [[ "${PYTHON_VARIANT}" == "free-threading" ]]; then +if [[ "${PYTHON_VARIANT}" == "freethreading" ]]; then echo "BUILD TYPE: FREE-THREADING" BUILD_DIR="../build_free_threading" CONFIGURE_EXTRA="--disable-gil" @@ -9,7 +9,7 @@ elif [[ "${PYTHON_VARIANT}" == "asan" ]]; then BUILD_DIR="../build_asan" CONFIGURE_EXTRA="--with-address-sanitizer" export ASAN_OPTIONS="strict_init_order=true" -elif [[ "${PYTHON_VARIANT}" == "tsan-free-threading" ]]; then +elif [[ "${PYTHON_VARIANT}" == "tsan_freethreading" ]]; then echo "BUILD TYPE: TSAN FREE-THREADING" BUILD_DIR="../build_tsan_free_threading" CONFIGURE_EXTRA="--disable-gil --with-thread-sanitizer" diff --git a/Tools/pixi-packages/default/pixi.toml b/Tools/pixi-packages/default/pixi.toml index 001ff78fa5d8cb..efc0892b45520f 100644 --- a/Tools/pixi-packages/default/pixi.toml +++ b/Tools/pixi-packages/default/pixi.toml @@ -3,6 +3,11 @@ channels = ["https://prefix.dev/conda-forge"] platforms = ["osx-arm64", "linux-64"] preview = ["pixi-build"] +[workspace.build-variants] +variant = ["default"] +abi_tag = ["cp315"] +version = ["3.15"] + [package.build.backend] name = "pixi-build-rattler-build" version = "*" diff --git a/Tools/pixi-packages/default/recipe.yaml b/Tools/pixi-packages/default/recipe.yaml index 174af1f2bd9db2..83f04736d7ed70 100644 --- a/Tools/pixi-packages/default/recipe.yaml +++ b/Tools/pixi-packages/default/recipe.yaml @@ -1,9 +1,9 @@ context: # Keep up to date - version: "3.15" - variant: "default" - freethreading_tag: ${{ "t" if "free-threading" in variant else "" }} - abi_tag: cp${{ version | split(".") | join("") }}${{ freethreading_tag }} + version: ${{ version }} + variant: ${{ variant }} + freethreading_tag: ${{ "t" if "freethreading" in variant else "" }} + abi_tag: ${{ abi_tag }} recipe: name: python @@ -16,16 +16,16 @@ outputs: name: python_abi version: ${{ version }} build: - string: "0_cp315" + string: "0_${{ variant }}_${{ abi_tag }}" requirements: run_constraints: - - python ${{ version }}.* *_cp315 + - python ${{ version }}.* *_${{ variant }}_${{ abi_tag }} - package: name: python version: ${{ version }} build: - string: "0_cp315" + string: "0_${{ variant }}_${{ abi_tag }}" files: exclude: - "*.o" @@ -80,7 +80,7 @@ outputs: noarch: - python weak: - - python_abi ${{ version }}.* *_cp${{ version | split(".") | join("") }}${{ freethreading_tag }} + - python_abi ${{ version }}.* *_${{ variant }}_${{ abi_tag }} about: homepage: https://www.python.org/ diff --git a/Tools/pixi-packages/free-threading/pixi.toml b/Tools/pixi-packages/freethreading/pixi.toml similarity index 66% rename from Tools/pixi-packages/free-threading/pixi.toml rename to Tools/pixi-packages/freethreading/pixi.toml index 001ff78fa5d8cb..a6369b02059572 100644 --- a/Tools/pixi-packages/free-threading/pixi.toml +++ b/Tools/pixi-packages/freethreading/pixi.toml @@ -3,6 +3,11 @@ channels = ["https://prefix.dev/conda-forge"] platforms = ["osx-arm64", "linux-64"] preview = ["pixi-build"] +[workspace.build-variants] +variant = ["freethreading"] +abi_tag = ["cp315t"] +version = ["3.15"] + [package.build.backend] name = "pixi-build-rattler-build" version = "*" diff --git a/Tools/pixi-packages/free-threading/recipe.yaml b/Tools/pixi-packages/freethreading/recipe.yaml similarity index 80% rename from Tools/pixi-packages/free-threading/recipe.yaml rename to Tools/pixi-packages/freethreading/recipe.yaml index f732e82a707d3b..a59e7db9e6353f 100644 --- a/Tools/pixi-packages/free-threading/recipe.yaml +++ b/Tools/pixi-packages/freethreading/recipe.yaml @@ -1,9 +1,9 @@ context: # Keep up to date version: "3.15" - variant: "free-threading" - freethreading_tag: ${{ "t" if "free-threading" in variant else "" }} - abi_tag: cp${{ version | split(".") | join("") }}${{ freethreading_tag }} + variant: ${{ variant }} + freethreading_tag: ${{ "t" if "freethreading" in variant else "" }} + abi_tag: ${{ abi_tag }} recipe: name: python @@ -16,16 +16,16 @@ outputs: name: python_abi version: ${{ version }} build: - string: "0_cp315t" + string: "0_${{ variant }}_${{ abi_tag }}" requirements: run_constraints: - - python ${{ version }}.* *_cp315t + - python ${{ version }}.* *_${{ variant }}_${{ abi_tag }} - package: name: python version: ${{ version }} build: - string: "0_cp315t" + string: "0_${{ variant }}_${{ abi_tag }}" files: exclude: - "*.o" @@ -80,7 +80,7 @@ outputs: noarch: - python weak: - - python_abi ${{ version }}.* *_cp${{ version | split(".") | join("") }}${{ freethreading_tag }} + - python_abi ${{ version }}.* *_${{ variant }}_${{ abi_tag }} about: homepage: https://www.python.org/ diff --git a/Tools/pixi-packages/generate.sh b/Tools/pixi-packages/generate.sh index 896ba9fac22b9e..d6cb48448aa8bb 100644 --- a/Tools/pixi-packages/generate.sh +++ b/Tools/pixi-packages/generate.sh @@ -2,11 +2,6 @@ # Using a single `pixi.toml` and `recipe.yaml` for all package variants is blocked on https://github.com/prefix-dev/pixi/issues/4599 -for name in default asan free-threading tsan-free-threading; do - if [[ "${name}" == *free-threading* ]]; then - tag="cp315t" - else - tag="cp315" - fi - sed -e 's/variant: "default"/variant: "'${name}'"/g' -e 's/${{ abi_tag }}/'${tag}'/g' Tools/pixi-packages/recipe.yaml > Tools/pixi-packages/${name}/recipe.yaml +for name in asan free-threading tsan-free-threading; do + cp Tools/pixi-packages/default/recipe.yaml Tools/pixi-packages/${name}/recipe.yaml done diff --git a/Tools/pixi-packages/recipe.yaml b/Tools/pixi-packages/recipe.yaml deleted file mode 100644 index e6c9f9aad15ccb..00000000000000 --- a/Tools/pixi-packages/recipe.yaml +++ /dev/null @@ -1,88 +0,0 @@ -context: - # Keep up to date - version: "3.15" - variant: "default" - freethreading_tag: ${{ "t" if "free-threading" in variant else "" }} - abi_tag: cp${{ version | split(".") | join("") }}${{ freethreading_tag }} - -recipe: - name: python - -source: - - path: ../../.. - -outputs: -- package: - name: python_abi - version: ${{ version }} - build: - string: "0_${{ abi_tag }}" - requirements: - run_constraints: - - python ${{ version }}.* *_${{ abi_tag }} - -- package: - name: python - version: ${{ version }} - build: - string: "0_${{ abi_tag }}" - files: - exclude: - - "*.o" - script: - file: ../build.sh - env: - PYTHON_VARIANT: ${{ variant }} - python: - site_packages_path: "lib/python${{ version }}${{ freethreading_tag }}/site-packages" - - # derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml - requirements: - build: - - ${{ compiler('c') }} - - ${{ compiler('cxx') }} - - make - - pkg-config - # configure script looks for llvm-ar for lto - - if: osx - then: - - llvm-tools - - host: - - bzip2 - - sqlite - - liblzma-devel - - zlib - - zstd - - openssl - - readline - - tk - # These two are just to get the headers needed for tk.h, but is unused - - xorg-libx11 - - xorg-xorgproto - - ncurses - - libffi - - if: linux - then: - - libuuid - - libmpdec-devel - - expat - - if: c_compiler == "gcc" and "san" in variant - then: - - libsanitizer - - ignore_run_exports: - from_package: - - xorg-libx11 - - xorg-xorgproto - - run_exports: - noarch: - - python - weak: - - python_abi ${{ version }}.* *_cp${{ version | split(".") | join("") }}${{ freethreading_tag }} - -about: - homepage: https://www.python.org/ - license: Python-2.0 - license_file: LICENSE diff --git a/Tools/pixi-packages/tsan-free-threading/pixi.toml b/Tools/pixi-packages/tsan_freethreading/pixi.toml similarity index 65% rename from Tools/pixi-packages/tsan-free-threading/pixi.toml rename to Tools/pixi-packages/tsan_freethreading/pixi.toml index 001ff78fa5d8cb..be0515ee0bf065 100644 --- a/Tools/pixi-packages/tsan-free-threading/pixi.toml +++ b/Tools/pixi-packages/tsan_freethreading/pixi.toml @@ -3,6 +3,11 @@ channels = ["https://prefix.dev/conda-forge"] platforms = ["osx-arm64", "linux-64"] preview = ["pixi-build"] +[workspace.build-variants] +variant = ["tsan_freethreading"] +abi_tag = ["cp315t"] +version = ["3.15"] + [package.build.backend] name = "pixi-build-rattler-build" version = "*" diff --git a/Tools/pixi-packages/tsan-free-threading/recipe.yaml b/Tools/pixi-packages/tsan_freethreading/recipe.yaml similarity index 80% rename from Tools/pixi-packages/tsan-free-threading/recipe.yaml rename to Tools/pixi-packages/tsan_freethreading/recipe.yaml index 385e07486ee06f..a59e7db9e6353f 100644 --- a/Tools/pixi-packages/tsan-free-threading/recipe.yaml +++ b/Tools/pixi-packages/tsan_freethreading/recipe.yaml @@ -1,9 +1,9 @@ context: # Keep up to date version: "3.15" - variant: "tsan-free-threading" - freethreading_tag: ${{ "t" if "free-threading" in variant else "" }} - abi_tag: cp${{ version | split(".") | join("") }}${{ freethreading_tag }} + variant: ${{ variant }} + freethreading_tag: ${{ "t" if "freethreading" in variant else "" }} + abi_tag: ${{ abi_tag }} recipe: name: python @@ -16,16 +16,16 @@ outputs: name: python_abi version: ${{ version }} build: - string: "0_cp315t" + string: "0_${{ variant }}_${{ abi_tag }}" requirements: run_constraints: - - python ${{ version }}.* *_cp315t + - python ${{ version }}.* *_${{ variant }}_${{ abi_tag }} - package: name: python version: ${{ version }} build: - string: "0_cp315t" + string: "0_${{ variant }}_${{ abi_tag }}" files: exclude: - "*.o" @@ -80,7 +80,7 @@ outputs: noarch: - python weak: - - python_abi ${{ version }}.* *_cp${{ version | split(".") | join("") }}${{ freethreading_tag }} + - python_abi ${{ version }}.* *_${{ variant }}_${{ abi_tag }} about: homepage: https://www.python.org/ From d1a38c118a40453f18c3010c4a149e47ce6e281e Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 8 Jan 2026 18:09:45 -0800 Subject: [PATCH 08/15] use symlinks --- Tools/pixi-packages/asan/recipe.yaml | 89 +------------------ Tools/pixi-packages/freethreading/recipe.yaml | 89 +------------------ .../tsan_freethreading/recipe.yaml | 89 +------------------ 3 files changed, 3 insertions(+), 264 deletions(-) mode change 100644 => 120000 Tools/pixi-packages/asan/recipe.yaml mode change 100644 => 120000 Tools/pixi-packages/freethreading/recipe.yaml mode change 100644 => 120000 Tools/pixi-packages/tsan_freethreading/recipe.yaml diff --git a/Tools/pixi-packages/asan/recipe.yaml b/Tools/pixi-packages/asan/recipe.yaml deleted file mode 100644 index a59e7db9e6353f..00000000000000 --- a/Tools/pixi-packages/asan/recipe.yaml +++ /dev/null @@ -1,88 +0,0 @@ -context: - # Keep up to date - version: "3.15" - variant: ${{ variant }} - freethreading_tag: ${{ "t" if "freethreading" in variant else "" }} - abi_tag: ${{ abi_tag }} - -recipe: - name: python - -source: - - path: ../../.. - -outputs: -- package: - name: python_abi - version: ${{ version }} - build: - string: "0_${{ variant }}_${{ abi_tag }}" - requirements: - run_constraints: - - python ${{ version }}.* *_${{ variant }}_${{ abi_tag }} - -- package: - name: python - version: ${{ version }} - build: - string: "0_${{ variant }}_${{ abi_tag }}" - files: - exclude: - - "*.o" - script: - file: ../build.sh - env: - PYTHON_VARIANT: ${{ variant }} - python: - site_packages_path: "lib/python${{ version }}${{ freethreading_tag }}/site-packages" - - # derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml - requirements: - build: - - ${{ compiler('c') }} - - ${{ compiler('cxx') }} - - make - - pkg-config - # configure script looks for llvm-ar for lto - - if: osx - then: - - llvm-tools - - host: - - bzip2 - - sqlite - - liblzma-devel - - zlib - - zstd - - openssl - - readline - - tk - # These two are just to get the headers needed for tk.h, but is unused - - xorg-libx11 - - xorg-xorgproto - - ncurses - - libffi - - if: linux - then: - - libuuid - - libmpdec-devel - - expat - - if: c_compiler == "gcc" and "san" in variant - then: - - libsanitizer - - ignore_run_exports: - from_package: - - xorg-libx11 - - xorg-xorgproto - - run_exports: - noarch: - - python - weak: - - python_abi ${{ version }}.* *_${{ variant }}_${{ abi_tag }} - -about: - homepage: https://www.python.org/ - license: Python-2.0 - license_file: LICENSE diff --git a/Tools/pixi-packages/asan/recipe.yaml b/Tools/pixi-packages/asan/recipe.yaml new file mode 120000 index 00000000000000..90c5c497965560 --- /dev/null +++ b/Tools/pixi-packages/asan/recipe.yaml @@ -0,0 +1 @@ +../default/recipe.yaml \ No newline at end of file diff --git a/Tools/pixi-packages/freethreading/recipe.yaml b/Tools/pixi-packages/freethreading/recipe.yaml deleted file mode 100644 index a59e7db9e6353f..00000000000000 --- a/Tools/pixi-packages/freethreading/recipe.yaml +++ /dev/null @@ -1,88 +0,0 @@ -context: - # Keep up to date - version: "3.15" - variant: ${{ variant }} - freethreading_tag: ${{ "t" if "freethreading" in variant else "" }} - abi_tag: ${{ abi_tag }} - -recipe: - name: python - -source: - - path: ../../.. - -outputs: -- package: - name: python_abi - version: ${{ version }} - build: - string: "0_${{ variant }}_${{ abi_tag }}" - requirements: - run_constraints: - - python ${{ version }}.* *_${{ variant }}_${{ abi_tag }} - -- package: - name: python - version: ${{ version }} - build: - string: "0_${{ variant }}_${{ abi_tag }}" - files: - exclude: - - "*.o" - script: - file: ../build.sh - env: - PYTHON_VARIANT: ${{ variant }} - python: - site_packages_path: "lib/python${{ version }}${{ freethreading_tag }}/site-packages" - - # derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml - requirements: - build: - - ${{ compiler('c') }} - - ${{ compiler('cxx') }} - - make - - pkg-config - # configure script looks for llvm-ar for lto - - if: osx - then: - - llvm-tools - - host: - - bzip2 - - sqlite - - liblzma-devel - - zlib - - zstd - - openssl - - readline - - tk - # These two are just to get the headers needed for tk.h, but is unused - - xorg-libx11 - - xorg-xorgproto - - ncurses - - libffi - - if: linux - then: - - libuuid - - libmpdec-devel - - expat - - if: c_compiler == "gcc" and "san" in variant - then: - - libsanitizer - - ignore_run_exports: - from_package: - - xorg-libx11 - - xorg-xorgproto - - run_exports: - noarch: - - python - weak: - - python_abi ${{ version }}.* *_${{ variant }}_${{ abi_tag }} - -about: - homepage: https://www.python.org/ - license: Python-2.0 - license_file: LICENSE diff --git a/Tools/pixi-packages/freethreading/recipe.yaml b/Tools/pixi-packages/freethreading/recipe.yaml new file mode 120000 index 00000000000000..90c5c497965560 --- /dev/null +++ b/Tools/pixi-packages/freethreading/recipe.yaml @@ -0,0 +1 @@ +../default/recipe.yaml \ No newline at end of file diff --git a/Tools/pixi-packages/tsan_freethreading/recipe.yaml b/Tools/pixi-packages/tsan_freethreading/recipe.yaml deleted file mode 100644 index a59e7db9e6353f..00000000000000 --- a/Tools/pixi-packages/tsan_freethreading/recipe.yaml +++ /dev/null @@ -1,88 +0,0 @@ -context: - # Keep up to date - version: "3.15" - variant: ${{ variant }} - freethreading_tag: ${{ "t" if "freethreading" in variant else "" }} - abi_tag: ${{ abi_tag }} - -recipe: - name: python - -source: - - path: ../../.. - -outputs: -- package: - name: python_abi - version: ${{ version }} - build: - string: "0_${{ variant }}_${{ abi_tag }}" - requirements: - run_constraints: - - python ${{ version }}.* *_${{ variant }}_${{ abi_tag }} - -- package: - name: python - version: ${{ version }} - build: - string: "0_${{ variant }}_${{ abi_tag }}" - files: - exclude: - - "*.o" - script: - file: ../build.sh - env: - PYTHON_VARIANT: ${{ variant }} - python: - site_packages_path: "lib/python${{ version }}${{ freethreading_tag }}/site-packages" - - # derived from https://github.com/conda-forge/python-feedstock/blob/main/recipe/meta.yaml - requirements: - build: - - ${{ compiler('c') }} - - ${{ compiler('cxx') }} - - make - - pkg-config - # configure script looks for llvm-ar for lto - - if: osx - then: - - llvm-tools - - host: - - bzip2 - - sqlite - - liblzma-devel - - zlib - - zstd - - openssl - - readline - - tk - # These two are just to get the headers needed for tk.h, but is unused - - xorg-libx11 - - xorg-xorgproto - - ncurses - - libffi - - if: linux - then: - - libuuid - - libmpdec-devel - - expat - - if: c_compiler == "gcc" and "san" in variant - then: - - libsanitizer - - ignore_run_exports: - from_package: - - xorg-libx11 - - xorg-xorgproto - - run_exports: - noarch: - - python - weak: - - python_abi ${{ version }}.* *_${{ variant }}_${{ abi_tag }} - -about: - homepage: https://www.python.org/ - license: Python-2.0 - license_file: LICENSE diff --git a/Tools/pixi-packages/tsan_freethreading/recipe.yaml b/Tools/pixi-packages/tsan_freethreading/recipe.yaml new file mode 120000 index 00000000000000..90c5c497965560 --- /dev/null +++ b/Tools/pixi-packages/tsan_freethreading/recipe.yaml @@ -0,0 +1 @@ +../default/recipe.yaml \ No newline at end of file From 57715f54119631a6e6c7717f0ead364b20439a6d Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 8 Jan 2026 18:10:59 -0800 Subject: [PATCH 09/15] remove generate.sh --- Tools/pixi-packages/README.md | 1 - Tools/pixi-packages/generate.sh | 7 ------- 2 files changed, 8 deletions(-) delete mode 100644 Tools/pixi-packages/generate.sh diff --git a/Tools/pixi-packages/README.md b/Tools/pixi-packages/README.md index 99e92f3cb3d90a..4cd48da0715cf9 100644 --- a/Tools/pixi-packages/README.md +++ b/Tools/pixi-packages/README.md @@ -27,7 +27,6 @@ Each package definition is contained in a subdirectory, but they share the build ## Maintenance - Keep the `abi_tag` and `version` fields in each `pixi.toml` up to date with the Python version -- If you update one `recipe.yaml` file, update all - Update `build.sh` for any breaking changes in the `configure` and `make` workflow ## Opportunities for future improvement diff --git a/Tools/pixi-packages/generate.sh b/Tools/pixi-packages/generate.sh deleted file mode 100644 index d6cb48448aa8bb..00000000000000 --- a/Tools/pixi-packages/generate.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# Using a single `pixi.toml` and `recipe.yaml` for all package variants is blocked on https://github.com/prefix-dev/pixi/issues/4599 - -for name in asan free-threading tsan-free-threading; do - cp Tools/pixi-packages/default/recipe.yaml Tools/pixi-packages/${name}/recipe.yaml -done From 12da3b81796c73f4b4b4c55fc34d6138cf20b7a5 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Wed, 14 Jan 2026 14:58:36 +0000 Subject: [PATCH 10/15] Fix --- Tools/pixi-packages/asan/variants.yaml | 6 ++++++ Tools/pixi-packages/build.sh | 6 +++--- Tools/pixi-packages/default/pixi.toml | 5 ----- Tools/pixi-packages/default/recipe.yaml | 3 --- Tools/pixi-packages/default/variants.yaml | 6 ++++++ Tools/pixi-packages/freethreading/variants.yaml | 6 ++++++ Tools/pixi-packages/tsan-freethreading/pixi.toml | 1 + .../recipe.yaml | 0 .../pixi-packages/tsan-freethreading/variants.yaml | 6 ++++++ Tools/pixi-packages/tsan_freethreading/pixi.toml | 13 ------------- 10 files changed, 28 insertions(+), 24 deletions(-) create mode 100644 Tools/pixi-packages/asan/variants.yaml create mode 100644 Tools/pixi-packages/default/variants.yaml create mode 100644 Tools/pixi-packages/freethreading/variants.yaml create mode 120000 Tools/pixi-packages/tsan-freethreading/pixi.toml rename Tools/pixi-packages/{tsan_freethreading => tsan-freethreading}/recipe.yaml (100%) create mode 100644 Tools/pixi-packages/tsan-freethreading/variants.yaml delete mode 100644 Tools/pixi-packages/tsan_freethreading/pixi.toml diff --git a/Tools/pixi-packages/asan/variants.yaml b/Tools/pixi-packages/asan/variants.yaml new file mode 100644 index 00000000000000..fdb26662a261bb --- /dev/null +++ b/Tools/pixi-packages/asan/variants.yaml @@ -0,0 +1,6 @@ +variant: + - asan +abi_tag: + - cp315 +version: + - 3.15 diff --git a/Tools/pixi-packages/build.sh b/Tools/pixi-packages/build.sh index 1a4f5d6a26b415..e6d96f7b0cb3d8 100644 --- a/Tools/pixi-packages/build.sh +++ b/Tools/pixi-packages/build.sh @@ -2,16 +2,16 @@ if [[ "${PYTHON_VARIANT}" == "freethreading" ]]; then echo "BUILD TYPE: FREE-THREADING" - BUILD_DIR="../build_free_threading" + BUILD_DIR="../build_freethreading" CONFIGURE_EXTRA="--disable-gil" elif [[ "${PYTHON_VARIANT}" == "asan" ]]; then echo "BUILD TYPE: ASAN" BUILD_DIR="../build_asan" CONFIGURE_EXTRA="--with-address-sanitizer" export ASAN_OPTIONS="strict_init_order=true" -elif [[ "${PYTHON_VARIANT}" == "tsan_freethreading" ]]; then +elif [[ "${PYTHON_VARIANT}" == "tsan-freethreading" ]]; then echo "BUILD TYPE: TSAN FREE-THREADING" - BUILD_DIR="../build_tsan_free_threading" + BUILD_DIR="../build_tsan-freethreading" CONFIGURE_EXTRA="--disable-gil --with-thread-sanitizer" export TSAN_OPTIONS="suppressions=${SRC_DIR}/Tools/tsan/suppressions_free_threading.txt" else diff --git a/Tools/pixi-packages/default/pixi.toml b/Tools/pixi-packages/default/pixi.toml index efc0892b45520f..001ff78fa5d8cb 100644 --- a/Tools/pixi-packages/default/pixi.toml +++ b/Tools/pixi-packages/default/pixi.toml @@ -3,11 +3,6 @@ channels = ["https://prefix.dev/conda-forge"] platforms = ["osx-arm64", "linux-64"] preview = ["pixi-build"] -[workspace.build-variants] -variant = ["default"] -abi_tag = ["cp315"] -version = ["3.15"] - [package.build.backend] name = "pixi-build-rattler-build" version = "*" diff --git a/Tools/pixi-packages/default/recipe.yaml b/Tools/pixi-packages/default/recipe.yaml index 83f04736d7ed70..7120c5f2a369a2 100644 --- a/Tools/pixi-packages/default/recipe.yaml +++ b/Tools/pixi-packages/default/recipe.yaml @@ -1,9 +1,6 @@ context: # Keep up to date - version: ${{ version }} - variant: ${{ variant }} freethreading_tag: ${{ "t" if "freethreading" in variant else "" }} - abi_tag: ${{ abi_tag }} recipe: name: python diff --git a/Tools/pixi-packages/default/variants.yaml b/Tools/pixi-packages/default/variants.yaml new file mode 100644 index 00000000000000..f66e9e7a2226ba --- /dev/null +++ b/Tools/pixi-packages/default/variants.yaml @@ -0,0 +1,6 @@ +variant: + - default +abi_tag: + - cp315 +version: + - 3.15 diff --git a/Tools/pixi-packages/freethreading/variants.yaml b/Tools/pixi-packages/freethreading/variants.yaml new file mode 100644 index 00000000000000..022833d04c3821 --- /dev/null +++ b/Tools/pixi-packages/freethreading/variants.yaml @@ -0,0 +1,6 @@ +variant: + - freethreading +abi_tag: + - cp315t +version: + - 3.15 diff --git a/Tools/pixi-packages/tsan-freethreading/pixi.toml b/Tools/pixi-packages/tsan-freethreading/pixi.toml new file mode 120000 index 00000000000000..3d713eb33ae811 --- /dev/null +++ b/Tools/pixi-packages/tsan-freethreading/pixi.toml @@ -0,0 +1 @@ +../default/pixi.toml \ No newline at end of file diff --git a/Tools/pixi-packages/tsan_freethreading/recipe.yaml b/Tools/pixi-packages/tsan-freethreading/recipe.yaml similarity index 100% rename from Tools/pixi-packages/tsan_freethreading/recipe.yaml rename to Tools/pixi-packages/tsan-freethreading/recipe.yaml diff --git a/Tools/pixi-packages/tsan-freethreading/variants.yaml b/Tools/pixi-packages/tsan-freethreading/variants.yaml new file mode 100644 index 00000000000000..74e02f2e580320 --- /dev/null +++ b/Tools/pixi-packages/tsan-freethreading/variants.yaml @@ -0,0 +1,6 @@ +variant: + - tsan-freethreading +abi_tag: + - cp315t +version: + - 3.15 diff --git a/Tools/pixi-packages/tsan_freethreading/pixi.toml b/Tools/pixi-packages/tsan_freethreading/pixi.toml deleted file mode 100644 index be0515ee0bf065..00000000000000 --- a/Tools/pixi-packages/tsan_freethreading/pixi.toml +++ /dev/null @@ -1,13 +0,0 @@ -[workspace] -channels = ["https://prefix.dev/conda-forge"] -platforms = ["osx-arm64", "linux-64"] -preview = ["pixi-build"] - -[workspace.build-variants] -variant = ["tsan_freethreading"] -abi_tag = ["cp315t"] -version = ["3.15"] - -[package.build.backend] -name = "pixi-build-rattler-build" -version = "*" From 1a4106f5d5024a17aecf1c8efc40d54a46aff113 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Wed, 14 Jan 2026 15:15:31 +0000 Subject: [PATCH 11/15] Fix tsan --- Tools/pixi-packages/asan/variants.yaml | 2 +- Tools/pixi-packages/build.sh | 16 +++++++--------- Tools/pixi-packages/default/recipe.yaml | 8 ++++---- .../tsan-freethreading/variants.yaml | 2 +- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Tools/pixi-packages/asan/variants.yaml b/Tools/pixi-packages/asan/variants.yaml index fdb26662a261bb..a4eb28b70c5b69 100644 --- a/Tools/pixi-packages/asan/variants.yaml +++ b/Tools/pixi-packages/asan/variants.yaml @@ -1,6 +1,6 @@ variant: - asan abi_tag: - - cp315 + - cp315_asan version: - 3.15 diff --git a/Tools/pixi-packages/build.sh b/Tools/pixi-packages/build.sh index e6d96f7b0cb3d8..9d00afe311224e 100644 --- a/Tools/pixi-packages/build.sh +++ b/Tools/pixi-packages/build.sh @@ -1,25 +1,23 @@ #!/bin/bash +echo "PYTHON_VARIANT: ${PYTHON_VARIANT}" + if [[ "${PYTHON_VARIANT}" == "freethreading" ]]; then - echo "BUILD TYPE: FREE-THREADING" - BUILD_DIR="../build_freethreading" CONFIGURE_EXTRA="--disable-gil" elif [[ "${PYTHON_VARIANT}" == "asan" ]]; then - echo "BUILD TYPE: ASAN" - BUILD_DIR="../build_asan" CONFIGURE_EXTRA="--with-address-sanitizer" export ASAN_OPTIONS="strict_init_order=true" elif [[ "${PYTHON_VARIANT}" == "tsan-freethreading" ]]; then - echo "BUILD TYPE: TSAN FREE-THREADING" - BUILD_DIR="../build_tsan-freethreading" CONFIGURE_EXTRA="--disable-gil --with-thread-sanitizer" export TSAN_OPTIONS="suppressions=${SRC_DIR}/Tools/tsan/suppressions_free_threading.txt" -else - echo "BUILD TYPE: DEFAULT" - BUILD_DIR="../build" +elif [[ "${PYTHON_VARIANT}" == "default" ]]; then CONFIGURE_EXTRA="" +else + echo "Unknown PYTHON_VARIANT: ${PYTHON_VARIANT}" + exit 1 fi +BUILD_DIR="../build_${PYTHON_VARIANT}" mkdir -p "${BUILD_DIR}" cd "${BUILD_DIR}" diff --git a/Tools/pixi-packages/default/recipe.yaml b/Tools/pixi-packages/default/recipe.yaml index 7120c5f2a369a2..a5609540ae7f68 100644 --- a/Tools/pixi-packages/default/recipe.yaml +++ b/Tools/pixi-packages/default/recipe.yaml @@ -13,16 +13,16 @@ outputs: name: python_abi version: ${{ version }} build: - string: "0_${{ variant }}_${{ abi_tag }}" + string: "0_${{ abi_tag }}" requirements: run_constraints: - - python ${{ version }}.* *_${{ variant }}_${{ abi_tag }} + - python ${{ version }}.* *_${{ abi_tag }} - package: name: python version: ${{ version }} build: - string: "0_${{ variant }}_${{ abi_tag }}" + string: "0_${{ abi_tag }}" files: exclude: - "*.o" @@ -77,7 +77,7 @@ outputs: noarch: - python weak: - - python_abi ${{ version }}.* *_${{ variant }}_${{ abi_tag }} + - python_abi ${{ version }}.* *_${{ abi_tag }} about: homepage: https://www.python.org/ diff --git a/Tools/pixi-packages/tsan-freethreading/variants.yaml b/Tools/pixi-packages/tsan-freethreading/variants.yaml index 74e02f2e580320..481c7298a34304 100644 --- a/Tools/pixi-packages/tsan-freethreading/variants.yaml +++ b/Tools/pixi-packages/tsan-freethreading/variants.yaml @@ -1,6 +1,6 @@ variant: - tsan-freethreading abi_tag: - - cp315t + - cp315t_tsan version: - 3.15 From 2402f77e332034607c4697ad19df1f0513de6e75 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Wed, 14 Jan 2026 15:26:40 +0000 Subject: [PATCH 12/15] switch ABI tag for asan/tsan --- Tools/pixi-packages/asan/variants.yaml | 2 +- Tools/pixi-packages/tsan-freethreading/variants.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/pixi-packages/asan/variants.yaml b/Tools/pixi-packages/asan/variants.yaml index a4eb28b70c5b69..2404948457e6bb 100644 --- a/Tools/pixi-packages/asan/variants.yaml +++ b/Tools/pixi-packages/asan/variants.yaml @@ -1,6 +1,6 @@ variant: - asan abi_tag: - - cp315_asan + - asan_cp315 version: - 3.15 diff --git a/Tools/pixi-packages/tsan-freethreading/variants.yaml b/Tools/pixi-packages/tsan-freethreading/variants.yaml index 481c7298a34304..6ed09fcc9b656b 100644 --- a/Tools/pixi-packages/tsan-freethreading/variants.yaml +++ b/Tools/pixi-packages/tsan-freethreading/variants.yaml @@ -1,6 +1,6 @@ variant: - tsan-freethreading abi_tag: - - cp315t_tsan + - tsan_cp315t version: - 3.15 From 56f4403960f9e4e774d20d41d43c0f5f58cfffd2 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Wed, 14 Jan 2026 15:28:50 +0000 Subject: [PATCH 13/15] git cleanup 1/2 --- Tools/pixi-packages/asan/pixi.toml | 13 ------------- Tools/pixi-packages/asan/recipe.yaml | 1 - Tools/pixi-packages/freethreading/pixi.toml | 13 ------------- Tools/pixi-packages/freethreading/recipe.yaml | 1 - Tools/pixi-packages/tsan-freethreading/pixi.toml | 1 - Tools/pixi-packages/tsan-freethreading/recipe.yaml | 1 - 6 files changed, 30 deletions(-) delete mode 100644 Tools/pixi-packages/asan/pixi.toml delete mode 120000 Tools/pixi-packages/asan/recipe.yaml delete mode 100644 Tools/pixi-packages/freethreading/pixi.toml delete mode 120000 Tools/pixi-packages/freethreading/recipe.yaml delete mode 120000 Tools/pixi-packages/tsan-freethreading/pixi.toml delete mode 120000 Tools/pixi-packages/tsan-freethreading/recipe.yaml diff --git a/Tools/pixi-packages/asan/pixi.toml b/Tools/pixi-packages/asan/pixi.toml deleted file mode 100644 index 7c8200067d8cdf..00000000000000 --- a/Tools/pixi-packages/asan/pixi.toml +++ /dev/null @@ -1,13 +0,0 @@ -[workspace] -channels = ["https://prefix.dev/conda-forge"] -platforms = ["osx-arm64", "linux-64"] -preview = ["pixi-build"] - -[workspace.build-variants] -variant = ["asan"] -abi_tag = ["cp315"] -version = ["3.15"] - -[package.build.backend] -name = "pixi-build-rattler-build" -version = "*" diff --git a/Tools/pixi-packages/asan/recipe.yaml b/Tools/pixi-packages/asan/recipe.yaml deleted file mode 120000 index 90c5c497965560..00000000000000 --- a/Tools/pixi-packages/asan/recipe.yaml +++ /dev/null @@ -1 +0,0 @@ -../default/recipe.yaml \ No newline at end of file diff --git a/Tools/pixi-packages/freethreading/pixi.toml b/Tools/pixi-packages/freethreading/pixi.toml deleted file mode 100644 index a6369b02059572..00000000000000 --- a/Tools/pixi-packages/freethreading/pixi.toml +++ /dev/null @@ -1,13 +0,0 @@ -[workspace] -channels = ["https://prefix.dev/conda-forge"] -platforms = ["osx-arm64", "linux-64"] -preview = ["pixi-build"] - -[workspace.build-variants] -variant = ["freethreading"] -abi_tag = ["cp315t"] -version = ["3.15"] - -[package.build.backend] -name = "pixi-build-rattler-build" -version = "*" diff --git a/Tools/pixi-packages/freethreading/recipe.yaml b/Tools/pixi-packages/freethreading/recipe.yaml deleted file mode 120000 index 90c5c497965560..00000000000000 --- a/Tools/pixi-packages/freethreading/recipe.yaml +++ /dev/null @@ -1 +0,0 @@ -../default/recipe.yaml \ No newline at end of file diff --git a/Tools/pixi-packages/tsan-freethreading/pixi.toml b/Tools/pixi-packages/tsan-freethreading/pixi.toml deleted file mode 120000 index 3d713eb33ae811..00000000000000 --- a/Tools/pixi-packages/tsan-freethreading/pixi.toml +++ /dev/null @@ -1 +0,0 @@ -../default/pixi.toml \ No newline at end of file diff --git a/Tools/pixi-packages/tsan-freethreading/recipe.yaml b/Tools/pixi-packages/tsan-freethreading/recipe.yaml deleted file mode 120000 index 90c5c497965560..00000000000000 --- a/Tools/pixi-packages/tsan-freethreading/recipe.yaml +++ /dev/null @@ -1 +0,0 @@ -../default/recipe.yaml \ No newline at end of file From 546dcc064796a55ea6b258d032aede6c895aea19 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Wed, 14 Jan 2026 15:29:58 +0000 Subject: [PATCH 14/15] git cleanup 2/2 --- Tools/pixi-packages/asan/pixi.toml | 1 + Tools/pixi-packages/asan/recipe.yaml | 1 + Tools/pixi-packages/freethreading/pixi.toml | 1 + Tools/pixi-packages/freethreading/recipe.yaml | 1 + Tools/pixi-packages/tsan-freethreading/pixi.toml | 1 + Tools/pixi-packages/tsan-freethreading/recipe.yaml | 1 + 6 files changed, 6 insertions(+) create mode 120000 Tools/pixi-packages/asan/pixi.toml create mode 120000 Tools/pixi-packages/asan/recipe.yaml create mode 120000 Tools/pixi-packages/freethreading/pixi.toml create mode 120000 Tools/pixi-packages/freethreading/recipe.yaml create mode 120000 Tools/pixi-packages/tsan-freethreading/pixi.toml create mode 120000 Tools/pixi-packages/tsan-freethreading/recipe.yaml diff --git a/Tools/pixi-packages/asan/pixi.toml b/Tools/pixi-packages/asan/pixi.toml new file mode 120000 index 00000000000000..3d713eb33ae811 --- /dev/null +++ b/Tools/pixi-packages/asan/pixi.toml @@ -0,0 +1 @@ +../default/pixi.toml \ No newline at end of file diff --git a/Tools/pixi-packages/asan/recipe.yaml b/Tools/pixi-packages/asan/recipe.yaml new file mode 120000 index 00000000000000..90c5c497965560 --- /dev/null +++ b/Tools/pixi-packages/asan/recipe.yaml @@ -0,0 +1 @@ +../default/recipe.yaml \ No newline at end of file diff --git a/Tools/pixi-packages/freethreading/pixi.toml b/Tools/pixi-packages/freethreading/pixi.toml new file mode 120000 index 00000000000000..3d713eb33ae811 --- /dev/null +++ b/Tools/pixi-packages/freethreading/pixi.toml @@ -0,0 +1 @@ +../default/pixi.toml \ No newline at end of file diff --git a/Tools/pixi-packages/freethreading/recipe.yaml b/Tools/pixi-packages/freethreading/recipe.yaml new file mode 120000 index 00000000000000..90c5c497965560 --- /dev/null +++ b/Tools/pixi-packages/freethreading/recipe.yaml @@ -0,0 +1 @@ +../default/recipe.yaml \ No newline at end of file diff --git a/Tools/pixi-packages/tsan-freethreading/pixi.toml b/Tools/pixi-packages/tsan-freethreading/pixi.toml new file mode 120000 index 00000000000000..3d713eb33ae811 --- /dev/null +++ b/Tools/pixi-packages/tsan-freethreading/pixi.toml @@ -0,0 +1 @@ +../default/pixi.toml \ No newline at end of file diff --git a/Tools/pixi-packages/tsan-freethreading/recipe.yaml b/Tools/pixi-packages/tsan-freethreading/recipe.yaml new file mode 120000 index 00000000000000..90c5c497965560 --- /dev/null +++ b/Tools/pixi-packages/tsan-freethreading/recipe.yaml @@ -0,0 +1 @@ +../default/recipe.yaml \ No newline at end of file From cd4cd26dd2ce2b57a919777fc0cec9de1c671f55 Mon Sep 17 00:00:00 2001 From: crusaderky Date: Thu, 15 Jan 2026 13:09:29 +0000 Subject: [PATCH 15/15] README --- Tools/pixi-packages/README.md | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Tools/pixi-packages/README.md b/Tools/pixi-packages/README.md index 4cd48da0715cf9..e096cd1ae9ff5f 100644 --- a/Tools/pixi-packages/README.md +++ b/Tools/pixi-packages/README.md @@ -1,14 +1,16 @@ # CPython Pixi packages -This directory contains definitions for [Pixi packages](https://pixi.sh/latest/reference/pixi_manifest/#the-package-section) -which can be built from the CPython source code. +This directory contains definitions for [Pixi +packages](https://pixi.sh/latest/reference/pixi_manifest/#the-package-section) which can +be built from the CPython source code. -Downstream developers can make use of these packages by adding them as Git dependencies in a -[Pixi workspace](https://pixi.sh/latest/first_workspace/), like: +Downstream developers can make use of these packages by adding them as Git dependencies +in a [Pixi workspace](https://pixi.sh/latest/first_workspace/), like: ```toml [dependencies] -python = { git = "https://github.com/python/cpython", subdirectory = "Tools/pixi-packages/asan" } +python.git = "https://github.com/python/cpython" +python.subdirectory = "Tools/pixi-packages/asan" ``` This is particularly useful when developers need to build CPython from source @@ -22,19 +24,24 @@ Each package definition is contained in a subdirectory, but they share the build - `default` - `freethreading` - `asan`: ASan-instrumented build -- `tsan_freethreading`: TSan-instrumented free-threading build +- `tsan-freethreading`: TSan-instrumented free-threading build ## Maintenance -- Keep the `abi_tag` and `version` fields in each `pixi.toml` up to date with the Python version +- Keep the `abi_tag` and `version` fields in each `variants.yaml` up to date with the + Python version - Update `build.sh` for any breaking changes in the `configure` and `make` workflow ## Opportunities for future improvement - More package variants (such as UBSan) - Support for Windows -- Using a single `pixi.toml` and `recipe.yaml` for all package variants is blocked on https://github.com/prefix-dev/pixi/issues/4599 -- A workaround can be removed from the build script once https://github.com/prefix-dev/rattler-build/issues/2012 is resolved +- Using a single `pixi.toml` and `recipe.yaml` for all package variants is blocked on + [pixi-build-backends#532](https://github.com/prefix-dev/pixi-build-backends/pull/532) + and [pixi#5248](https://github.com/prefix-dev/pixi/issues/5248) +- A workaround can be removed from the build script once + [rattler-build#2012](https://github.com/prefix-dev/rattler-build/issues/2012) is + resolved ## Troubleshooting