-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-143120: pixi builds for free-threading and TSAN #142872
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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-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 | ||
| echo "BUILD TYPE: DEFAULT" | ||
| BUILD_DIR="../build" | ||
|
|
@@ -33,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/" | ||
|
Comment on lines
+44
to
+45
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't have straightforward means to test this. @lucascolley / @ngoldbaum could you give it a go?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The build dependencies list
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe we can drop the happy to give this a go but would be easier once there is a NumPy build using this.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm able to get past the rpath errors I was seeing before on my Mac using this hack. Thanks! |
||
| fi | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. copy-paste of |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 = "*" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. copy-paste of |
||
|
|
||
| # 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 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. copy-paste of |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 = "*" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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-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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why delete this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not find it to be used anywhere. @lucascolley any insight?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it can be removed, yes. I forgot halfway through whether it did anything on the CPython side