-
-
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
Open
crusaderky
wants to merge
32
commits into
python:main
Choose a base branch
from
crusaderky:tsan
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+168
−138
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
d930e12
pixi builds for free-threading and tsan
crusaderky 57d45b9
Rename to tsan-free-threading
crusaderky 5ff29b4
Add libclang_rt hack
crusaderky 9a2a896
Add troubleshooting for tsan
crusaderky 97979e0
Add python_abi output and refactor
isuruf 456503b
fix typo
isuruf c46f283
Use single recipe.yaml duplicated across directories
isuruf d1a38c1
use symlinks
isuruf 57715f5
remove generate.sh
isuruf 8243c20
Merge remote-tracking branch 'origin/main' into tsan
crusaderky 12da3b8
Fix
crusaderky bfa4da3
Merge remote-tracking branch 'upstream/main' into tsan
crusaderky 1a4106f
Fix tsan
crusaderky 2402f77
switch ABI tag for asan/tsan
crusaderky 56f4403
git cleanup 1/2
crusaderky 546dcc0
git cleanup 2/2
crusaderky cd4cd26
README
crusaderky f028ded
Merge remote-tracking branch 'upstream/main' into tsan
crusaderky a86d345
Use libcompiler-rt and remove hack
isuruf 0aa5872
use at least macos 10.12
isuruf 62b7d1c
Merge remote-tracking branch 'upstream/main' into tsan
crusaderky ad6c740
Use libcompiler-rt and remove hack
isuruf fd6ca6d
note
crusaderky abae5a5
Fix CPPFLAGS too
isuruf a3f59cc
Merge remote-tracking branch 'upstream/main' into tsan
crusaderky fd87e84
Merge remote-tracking branch 'upstream/main' into tsan
crusaderky 2649286
Update Tools/pixi-packages/README.md
crusaderky 0e98a4a
Update platforms
crusaderky 4f49228
Merge remote-tracking branch 'isuruf/libcompiler-rt' into tsan
crusaderky 7b8f9d3
Merge branch 'main' into tsan
crusaderky 1ae77a5
Revert "Use libcompiler-rt and remove hack"
crusaderky cddc933
Revert "Update Tools/pixi-packages/README.md"
crusaderky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,36 +1,59 @@ | ||
| # 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 | ||
| (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. | ||
|
|
||
| Each package definition is contained in a subdirectory, but they share the build script | ||
| `build.sh` in this directory. Currently defined package variants: | ||
|
|
||
| - `default` | ||
| - `asan`: ASan-instrumented build with `PYTHON_ASAN=1` | ||
| - `freethreading` | ||
| - `asan`: ASan-instrumented 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 `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 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 | ||
| - 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 | ||
|
|
||
| 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 | ||
| ``` |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../default/pixi.toml |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../default/recipe.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| variant: | ||
| - asan | ||
| abi_tag: | ||
| - asan_cp315 | ||
| version: | ||
| - 3.15 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| variant: | ||
| - default | ||
| abi_tag: | ||
| - cp315 | ||
| version: | ||
| - 3.15 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../default/pixi.toml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../default/recipe.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| variant: | ||
| - freethreading | ||
| abi_tag: | ||
| - cp315t | ||
| version: | ||
| - 3.15 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../default/pixi.toml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../default/recipe.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| variant: | ||
| - tsan-freethreading | ||
| abi_tag: | ||
| - tsan_cp315t | ||
| version: | ||
| - 3.15 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.