cdylib builds with -Cprofile-generate
RUSTFLAGS are broken under Unix with PyO3 0.23
#4796
Labels
-Cprofile-generate
RUSTFLAGS are broken under Unix with PyO3 0.23
#4796
Bug Description
During the process of releasing a new version of Granian I realised it seems not possible to create PGO builds in Linux and MacOS.
Maturin successfully builds the wheels with
RUSTFLAGS=-Cprofile-generate=$(pwd)/profdata
, but importing the library results in a segfault under MacOS and the following in Linux:Tested both on GHA (you can inspect the run here) and locally on MacOS.
Also tried to test different maturin versions (1.7.4->1.7.8) and reverting changes on other cargo dependencies from the last successful build with PyO3 0.22: nothing seems to work, reverting to PyO3 0.22 immediately fix the issue. Also, Windows seems to be unaffected by this.
Not sure this is 100% PyO3 fault, but given my limited knowledge on the inner processes it's also hard to identify other major responsibilities on something else. To maintainers: if you think this is Maturin related or it involves other components, feel free to close this and point me out to the right place.
Steps to Reproduce
RUSTFLAGS=-Cprofile-generate=$(pwd)/profdata maturin build --release -i {interpreter}
Backtrace
No response
Your operating system and version
Ubuntu 22.04, MacOS 13, MacOS 14
Your Python version (
python --version
)Python 3.9->3.13
Your Rust version (
rustc --version
)1.82.0, 1.83.0
Your PyO3 version
0.23.3
How did you install python? Did you use a virtualenv?
pyenv, brew, uv
Additional Info
No response
The text was updated successfully, but these errors were encountered: