Closed mgorny closed 7 months ago
IMO in Rust we could use the portable-atomic crate.
Does it work if we have that as an optional dependency? Alternatively we could use AtomicBool
and a OnceLock
pair, which I actually used in my original implementation.
If you give me a patch, I can test it on this system.
I will try to put something together by end of Sunday. Afraid I'm a little bit behind on OSS this week; was in hospital with my son the two weeks before.
I created #3619 as I agree with @messense on using portable-atomic to resolve this. @mgorny Could you give it a try?
An alternative I see is safely casting the interpreter ID to 32-bits (using TryInto
) and use that instead of a full 64-bit interpreter ID because 4 billion subinterpreters should be enough for everybody?
Thank you! I can confirm that the setuptools-rust example builds against your branch on that machine, and the tests pass.
Bug Description
When building a package (html-py-ever example from setuptools-rust) using pyo3 0.20.0 on ppc32, I'm getting the following error:
Steps to Reproduce
Backtrace
Your operating system and version
Gentoo Linux, ppc32 nspawn container on POWER9
Your Python version (
python --version
)Python 3.11.6
Your Rust version (
rustc --version
)rustc 1.71.1 (eb26296b5 2023-08-03)
Your PyO3 version
0.20.0
How did you install python? Did you use a virtualenv?
Gentoo package. Tested inside a venv (with another venv layer via build) and outside.
Additional Info
I know that C programs using 64-bit atomics need to explicitly link
-latomic
here. I don't know how that maps to Rust.