forked from numpy/numpy
-
Notifications
You must be signed in to change notification settings - Fork 0
pixi recipes #4
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
Merged
Merged
pixi recipes #4
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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
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,37 +1,109 @@ | ||
| # NumPy 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 NumPy 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 NumPy 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: | ||
|
|
||
| ```toml | ||
| [dependencies] | ||
| numpy = { git = "https://github.com/numpy/numpy", subdirectory = "pixi-packages/asan" } | ||
| ``` | ||
| Downstream developers can make use of these packages by adding them as Git dependencies | ||
| in a [Pixi workspace](https://pixi.sh/latest/first_workspace/). | ||
|
|
||
| This is particularly useful when developers need to build NumPy from source | ||
| (for example, for an ASan-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. | ||
|
|
||
| See https://github.com/scipy/scipy/pull/24066 for a full example of downstream use. | ||
| See [scipy#24066](https://github.com/scipy/scipy/pull/24066) for a full example of | ||
| downstream use. | ||
|
|
||
| ## Variants | ||
| Each package definition is contained in a subdirectory. | ||
| Currently defined package variants: | ||
| All package variants include debug symbols. | ||
|
|
||
| Currently defined variants: | ||
|
|
||
| ### `default` | ||
| GIL-enabled build. | ||
|
|
||
| Usage: | ||
| ```toml | ||
| [dependencies] | ||
| python = "*" | ||
| numpy.git = "https://github.com/numpy/numpy" | ||
| numpy.subdirectory = "pixi-packages/default" | ||
| ``` | ||
| See `default/pixi.toml` if you wish to use python git tip instead. | ||
|
|
||
| *Tip:* you may change fork and add `numpy.rev = "<branch or git hash>"` to test unmerged | ||
| PRs. | ||
|
|
||
| ### `freethreading` | ||
| noGIL build. | ||
|
|
||
| Usage: | ||
| ```toml | ||
| [dependencies] | ||
| python-freethreading = "*" | ||
| numpy.git = "https://github.com/numpy/numpy" | ||
| numpy.subdirectory = "pixi-packages/freethreading" | ||
| ``` | ||
| See `freethreading/pixi.toml` if you wish to use python git tip instead. | ||
|
|
||
| - `default` | ||
| - `asan`: ASan-instrumented build with `-Db_sanitize=address` | ||
| ### `asan` | ||
| ASan-instrumented build with `-Db_sanitize=address`. | ||
|
|
||
| Usage: | ||
| ```toml | ||
| [dependencies] | ||
| python.git = "https://github.com/python/cpython" | ||
| python.subdirectory = "Tools/pixi-packages/asan" | ||
| numpy.git = "https://github.com/numpy/numpy" | ||
| numpy.subdirectory = "pixi-packages/asan" | ||
| ``` | ||
|
|
||
| ### `tsan-freethreading` | ||
| Freethreading TSan-instrumented build with `-Db_sanitize=thread`. | ||
|
|
||
| Usage: | ||
| ```toml | ||
| [dependencies] | ||
| python.git = "https://github.com/python/cpython" | ||
| python.subdirectory = "Tools/pixi-packages/tsan-freethreading" | ||
| numpy.git = "https://github.com/numpy/numpy" | ||
| numpy.subdirectory = "pixi-packages/tsan-freethreading" | ||
| ``` | ||
|
|
||
| ## Maintenance | ||
|
|
||
| - Keep host dependency requirements up to date | ||
| - For dependencies on upstream CPython Pixi packages, keep the git revision at a compatible version | ||
|
|
||
| ## 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 | ||
| ``` | ||
|
|
||
| ## 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` for all package variants is blocked on https://github.com/prefix-dev/pixi/issues/2813 | ||
| - Using a single `pixi.toml` for all package variants is blocked on | ||
| [pixi#2813](https://github.com/prefix-dev/pixi/issues/2813) | ||
| - Consider pinning dependency versions to guard against upstream breakages over time | ||
|
|
||
| ## Known issues | ||
| - [numpy#30561](https://github.com/numpy/numpy/issues/30561): `default` and | ||
| `freethreading` recipes must be manually tweaked to compile against cpython git tip; | ||
| see `default/pixi.toml` and `freethreading/pixi.toml` for details. | ||
| - [pixi#5226](https://github.com/prefix-dev/pixi/issues/5226): lock file is invalidated | ||
| on all `pixi` invocations | ||
| - [rattler-build#2094](https://github.com/prefix-dev/rattler-build/issues/2094): pixi | ||
| 0.63.0 introduces a regression regarding the license file; please skip it |
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,34 @@ | ||
| [workspace] | ||
| channels = ["https://prefix.dev/conda-forge"] | ||
| platforms = ["osx-arm64", "linux-64"] | ||
| preview = ["pixi-build"] | ||
|
|
||
| [package.build] | ||
| source.path = "../.." | ||
|
|
||
| [package.build.backend] | ||
| name = "pixi-build-python" | ||
| version = "*" | ||
|
|
||
| [package.build.config] | ||
| extra-input-globs = ["**/*.c.src"] | ||
| compilers = ["c", "cxx"] | ||
| extra-args = ["-Csetup-args=-Dbuildtype=debug"] | ||
|
|
||
| [package.host-dependencies] | ||
| # FIXME https://github.com/numpy/numpy/issues/30561 | ||
| # python = "*" prevents downstream from building cpython from sources. | ||
| # Workaround: fork numpy, then uncomment one of the following and | ||
| # comment out the other. | ||
|
|
||
| # Use latest cpython release from conda-forge | ||
| # python-freethreading = "*" | ||
|
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. same here |
||
|
|
||
| # Use cpython git tip | ||
| python.git = "https://github.com/crusaderky/cpython" | ||
| python.subdirectory = "Tools/pixi-packages/freethreading" | ||
| python.rev = "tsan" | ||
|
|
||
| meson-python = "*" | ||
| cython = "*" | ||
| uv = "*" # used to invoke the wheel build | ||
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
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.
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.
to be switched around before merging to numpy/numpy main