Switching between free-threaded and standard ABI does not invalidate build cache
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.2k
- Forks
- 1k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 66
Description
Bug Description
See this bcrypt PR, which fixed a caching issue seen on github actions that led to a segfault. IMO this caching issue should have just led to a rebuild rather than a silently broken build.
Steps to Reproduce
I've only been able to trigger this on bcrypt's CI, but now that I understand what's happening I suspect that if you build PyO3 (or a project that depends on PyO3) with a gil-enabled interpreter and then try to rebuild the project with a free-threaded interpreter but keeping the build cache, you will get a successful build but the python extension will be broken.
Your operating system and version
MacOS
Your Python version (python --version)
3.13.1
Your Rust version (rustc --version)
1.84.0
Your PyO3 version
0.23.4
How did you install python? Did you use a virtualenv?
github actions setup-python action
Additional Info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the cache reuse described for PyO3 builds when switching between a GIL-enabled and free-threaded Python interpreter, using the bcrypt pull request and GitHub Actions run linked in the issue. Trace which build inputs distinguish the two ABIs, then verify that changing the interpreter mode causes a rebuild rather than reusing an incompatible extension.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, python, rust
- Domain
- build-system, ci-cd
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100