diff --git a/Tools/pixi-packages/README.md b/Tools/pixi-packages/README.md index 94d606cee3439d..4cd48da0715cf9 100644 --- a/Tools/pixi-packages/README.md +++ b/Tools/pixi-packages/README.md @@ -20,14 +20,13 @@ 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 - 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 deleted file mode 100644 index dea88394ad9fe2..00000000000000 --- a/Tools/pixi-packages/asan/recipe.yaml +++ /dev/null @@ -1,63 +0,0 @@ -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: "asan" - -# 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/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/build.sh b/Tools/pixi-packages/build.sh index 8926de2603846f..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" @@ -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/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 eeb4052ec3859c..83f04736d7ed70 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" + version: ${{ version }} + variant: ${{ variant }} + freethreading_tag: ${{ "t" if "freethreading" in variant else "" }} + abi_tag: ${{ abi_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_${{ variant }}_${{ abi_tag }}" + requirements: + run_constraints: + - python ${{ version }}.* *_${{ variant }}_${{ abi_tag }} -# 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_${{ 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/ diff --git a/Tools/pixi-packages/free-threading/recipe.yaml b/Tools/pixi-packages/free-threading/recipe.yaml deleted file mode 100644 index 61c01562d35519..00000000000000 --- a/Tools/pixi-packages/free-threading/recipe.yaml +++ /dev/null @@ -1,63 +0,0 @@ -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/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/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-free-threading/recipe.yaml b/Tools/pixi-packages/tsan-free-threading/recipe.yaml deleted file mode 100644 index dfae06ad7a51d5..00000000000000 --- a/Tools/pixi-packages/tsan-free-threading/recipe.yaml +++ /dev/null @@ -1,63 +0,0 @@ -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-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-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_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