Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Tools/pixi-packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,34 @@ in a [Pixi workspace](https://pixi.sh/latest/first_workspace/), like:
```toml
[dependencies]
python.git = "https://github.com/python/cpython"
python.subdirectory = "Tools/pixi-packages/asan"
python.subdirectory = "Tools/pixi-packages"
python.flags = "asan"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python.flags = "asan"
python.flags = ["asan"]

```

This is particularly useful when developers need to build CPython from source
(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:
Each package variant carries a 'flag' to enable selection of that variant — see
[the Pixi docs](https://pixi.prefix.dev/latest/concepts/package_specifications/#extras-and-flags
for details of how to use this. Currently defined package variants:

- `default`
- `freethreading`
- `asan`: ASan-instrumented build
- `tsan-freethreading`: TSan-instrumented free-threading build
- `tsan_freethreading`: TSan-instrumented free-threading build

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to remove the - from this variant name, given that it is invalid in the flags field: https://conda.org/learn/ceps/cep-0045#repodata-record-syntax


## Maintenance

- Keep the `abi_tag` and `version` fields in each `variants.yaml` up to date with the
- Keep the `abi_tag` and `version` fields in `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` for all package variants is blocked on
[pixi#5248](https://github.com/prefix-dev/pixi/issues/5248)

## Troubleshooting

Expand Down
6 changes: 0 additions & 6 deletions Tools/pixi-packages/asan/variants.yaml

This file was deleted.

10 changes: 0 additions & 10 deletions Tools/pixi-packages/clone-recipe.sh

This file was deleted.

15 changes: 0 additions & 15 deletions Tools/pixi-packages/default/pixi.toml

This file was deleted.

6 changes: 0 additions & 6 deletions Tools/pixi-packages/default/variants.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions Tools/pixi-packages/freethreading/pixi.toml

This file was deleted.

6 changes: 0 additions & 6 deletions Tools/pixi-packages/freethreading/variants.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# NOTE: Please always only modify default/pixi.toml and then run clone-recipe.sh to
# propagate the changes to the other variants.

[workspace]
channels = ["https://prefix.dev/conda-forge"]
platforms = ["linux-64", "linux-aarch64", "osx-64", "osx-arm64"]
Expand All @@ -10,6 +7,3 @@ requires-pixi = ">=0.66.0"
[package.build.backend]
name = "pixi-build-rattler-build"
version = "*"

[package.build.config]
recipe = "../default/recipe.yaml"
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# NOTE: Please always only modify default/recipe.yaml and then run clone-recipe.sh to
# propagate the changes to the other variants.

context:
# Keep up to date
freethreading_tag: ${{ "t" if "freethreading" in variant else "" }}
Expand All @@ -9,7 +6,7 @@ recipe:
name: python

source:
- path: ../../..
- path: ../..

outputs:
- package:
Expand All @@ -25,12 +22,14 @@ outputs:
name: python
version: ${{ version }}
build:
flags:
- ${{ variant }}
string: "0_${{ abi_tag }}"
files:
exclude:
- "*.o"
script:
file: ../build.sh
file: build.sh
env:
PYTHON_VARIANT: ${{ variant }}
python:
Expand Down
15 changes: 0 additions & 15 deletions Tools/pixi-packages/tsan-freethreading/pixi.toml

This file was deleted.

6 changes: 0 additions & 6 deletions Tools/pixi-packages/tsan-freethreading/variants.yaml

This file was deleted.

8 changes: 8 additions & 0 deletions Tools/pixi-packages/variants.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: ["3.16"]

openssl:
- '3.5'
Comment on lines +3 to +4

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

obviously you could download the current pinning file, yaml-load it and extract the openssl pin, but that's perhaps more complexity and dynamism than justified - an argument could be made that openssl is special enough to handle it separately... and although pins have a habit of going stale, staying on an LTS version probably makes sense here.

conda-forge will probably migrate to openssl 4 in the fall, but since AFAICT python has no other dependencies that are themselves openssl-dependent, this should not cause any conflicts (except in larger environments with the most recent builds, but that's not really relevant for the ASAN stuff).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

obviously you could download the current pinning file, yaml-load it and extract the openssl pin, but that's perhaps more complexity and dynamism than justified

an idea was floated at some point that variant configs themselves could be packaged as conda packages and Pixi could consume them that way. Not sure if anyone has thought about that recently.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, conda-forge-pinning is exactly that package. You'd still have to go parse the yaml though. 🤷


zip_keys: [["variant", "abi_tag"]]
variant: ["default", "asan", "freethreading", "tsan_freethreading"]
abi_tag: ["cp316", "asan_cp316", "cp316t", "tsan_cp316t"]
Loading