Skip to content

Conversation

@crusaderky
Copy link
Contributor

@crusaderky crusaderky commented Dec 17, 2025

Follow-up to #142469

  • Add pixi infrastructure for
    • freethreading: compiles with --disable-gil
    • tsan-freethreading: compiles with --disable-gil --with-thread-sanitizer
  • Refactor recipes:
    • Make recipe.yaml and pixi.toml all identical symlinks
    • Remove clang-19 since we are not building the experimental jit
    • Remove ld_impl because we are not hacking the makefiles
    • Add site_packages_path
  • Add support for MacOS Intel (specifically macos-15-intel github runners)
  • Signal support for Linux ARM (it already worked but was insofar untested)
  • Remove ASAN/TSAN DLLs hack on MacOS

Tested in CI on https://github.com/crusaderky/hdf5-pixi

script:
file: ../build.sh
env:
PYTHON_VARIANT: "free-threading"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

copy-paste of asan/recipe.yaml, except this one line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

copy-paste of asan/pixi.toml

script:
file: ../build.sh
env:
PYTHON_VARIANT: "tsan"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

copy-paste of asan/recipe.yaml, except this one line

@lucascolley
Copy link
Contributor

@kumaraditya303 @lucascolley any idea what's wrong here?

no clue sorry I haven't seen this before

@crusaderky crusaderky marked this pull request as draft December 17, 2025 12:10
@crusaderky crusaderky changed the title WIP pixi builds for free-threading and tsan WIP pixi builds for free-threading and TSAN Dec 17, 2025
@crusaderky
Copy link
Contributor Author

The tsan crash is due to the default mmap_rnd_bits on Ubuntu 24.04; it goes away after lowering it:

$ sudo sysctl vm.mmap_rnd_bits
vm.mmap_rnd_bits = 32  # too high
$ sudo sysctl vm.mmap_rnd_bits=28  # reduce it
vm.mmap_rnd_bits = 28

ubuntu-latest github actions workers seems to be unaffected.

@hugovk hugovk changed the title WIP pixi builds for free-threading and TSAN gh-143120: WIP pixi builds for free-threading and TSAN Dec 23, 2025
@hugovk
Copy link
Member

hugovk commented Dec 23, 2025

There's a lot of copy/paste here, which can make maintenance harder. Does pixi have some concept of code reuse or parametrisation? Maybe not the best example, but something like GitHub Actions' reusable workflows?

@hugovk hugovk added the infra CI, GitHub Actions, buildbots, Dependabot, etc. label Dec 23, 2025
@ngoldbaum
Copy link
Contributor

@lucascolley is there anything we can do right now to reduce the duplication here? Or does that require fixes in pixi?

@lucascolley
Copy link
Contributor

As mentioned in the README already, this is blocked on prefix-dev/pixi#4599.

Copy link
Contributor

@ngoldbaum ngoldbaum left a comment

Choose a reason for hiding this comment

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

I opened an issue which is needed to make this mergeable. I'm also playing with a NumPy recipe based on this.

- `asan`: ASan-instrumented build with `PYTHON_ASAN=1`
- `free-threading`
- `asan`: ASan-instrumented build
- `tsan`: free-threading, TSan-instrumented build
Copy link
Contributor

Choose a reason for hiding this comment

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

Should probably be called tsan-free-threading. There should probably also be an asan-free-threading. @lucascolley is there a way to avoid the combinatorial explosion of variants here? Ideally you'd be able to somehow combine these but I think that's probably not tenable at the moment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the answer to this is no because of prefix-dev/pixi#4599
Barring the above, we could write a template + generation script and then commit the output to git? Very ugly if you ask me.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, I would vote for keeping things simple but verbose at the minute until there is a proper solution upstream

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed to tsan-free-threading

@crusaderky crusaderky marked this pull request as ready for review January 2, 2026 16:05
@crusaderky crusaderky changed the title gh-143120: WIP pixi builds for free-threading and TSAN gh-143120: pixi builds for free-threading and TSAN Jan 2, 2026
@crusaderky
Copy link
Contributor Author

Ready for final review

@crusaderky crusaderky marked this pull request as ready for review January 15, 2026 13:04
@isuruf
Copy link
Contributor

isuruf commented Jan 15, 2026

@isuruf at the end of the numpy build I get
│ │ ⚠ warning Overdepending against python_abi
but I can't figure out if it's actually a problem or what it is about; could you investigate?

You can ignore it. Harmless warning.

@crusaderky
Copy link
Contributor Author

crusaderky commented Jan 20, 2026

This is out of scope of this PR and can be addressed in a follow-up.
Compilation on macos-15-intel gh action runners fails with

│ │ $SRC_DIR/Objects/mimalloc/prim/osx/../unix/prim.c:559:17: error: '_CLOCK_MONOTONIC' is only available on macOS 10.12 or newer [-Werror,-Wunguarded-availabi
│ │ lity]

As the image is macOS 15, this feels like it should be fixable with an env variable?
Not entirely sure what VM images conda-forge uses to build mac intel.
@isuruf did you hit this before?

@crusaderky
Copy link
Contributor Author

@isuruf the libasan fix works in my hdf5 recipe, but not in the python recipe:
https://github.com/crusaderky/hdf5-pixi/actions/runs/21245433717/job/61133422587?pr=8
This is as of fd6ca6d.

Reverting for now.

@isuruf
Copy link
Contributor

isuruf commented Jan 22, 2026

Your hdf5 recipe is still not using fd6ca6d. Can we please stop the reverting back and forth and debug why the correct commit from cpython is not being used?

@crusaderky
Copy link
Contributor Author

For the sake of test velocity and thoroughness, I've created https://github.com/crusaderky/cpython-pixi
Latest Python and Python+NumPy builds can be seen here.

@isuruf the latest macos-15-intel changes let the python build complete; thank you.
Now however I'm seeing similar failures when building numpy ASAN/TSAN on the same VMs (not blocking this PR).

Pending

  • (blocking) Confirmation that symlinks in the repository are OK
  • (not blocking) Investigate why the latest libcompiler-rt fixes macos ASAN/TSAN builds for my hdf5-pixi project, but not for python. I don't have a mac so my velocity here is very limited. Note that the changes to this PR have been reverted in the last two commits.

@lucascolley
Copy link
Contributor

(blocking) Confirmation that symlinks in the repository are OK

@hugovk would you be able to advise?

@crusaderky
Copy link
Contributor Author

Your hdf5 recipe is still not using fd6ca6d. Can we please stop the reverting back and forth and debug why the correct commit from cpython is not being used?

@isuruf I appreciate your frustration. I'm frustrated too by this issue. I'm fairly sure that the last CI run I pointed to shows the effect of the libcompiler-rt changes - because I checked - but I'm fallible, so I'll do it again this time making extra sure not to muddle any evidence afterwards.

For the sake of velocity and clarity I've moved my CI to https://github.com/crusaderky/cpython-pixi
It takes several hours for CI to finish. I'll report back.

@hugovk
Copy link
Member

hugovk commented Jan 22, 2026

(blocking) Confirmation that symlinks in the repository are OK

@hugovk would you be able to advise?

Let's not add symlinks to the repo, they're harder to use on Windows and make cross-platform support generally more complex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting review infra CI, GitHub Actions, buildbots, Dependabot, etc. skip news

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants