Wrong wheel name when cross compiling with zig #2586
Replies: 2 comments 8 replies
-
Could you create a repro process without using nix like in a Docker container? |
Beta Was this translation helpful? Give feedback.
-
This is an artifact of how Maturin's platform resolution chain works:
I think this is a bug on Maturin's side since it breaks cross-compilation in environments where Maturin should probably use the host platform as a fallback if |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When cross-compiling a mixed Python/Rust project to
aarch64-unknown-linux-gnu
usingmaturin build --release --target aarch64-unknown-linux-gnu --zig
, the resulting wheel file is tagged with the build host's architecture (linux_x86_64
) instead of the target architecture (aarch64
).The actual compiled shared object (
.so
) inside the wheel is correctly compiled foraarch64-unknown-linux-gnu
(as confirmed by verbose logs). The issue is specific to the platform tag in the wheel's filename and maybe other internal metadata.Environment:
* Build Host OS: Linux (x86_64 in my case)
* Target:
aarch64-unknown-linux-gnu
* Maturin Version:
1.8.x
* Python for
abi3
compatibility:>=3.9
* pyo3 bindings
When enabling on
-vv
, it shows packaging the correct.so
file (fromaarch64
target directory):2025-05-08T22:30:18.938810Z DEBUG build_wheels:write_bindings_module: maturin::module_writer: Adding msc_rustclient/msc_rustclient.abi3.so from /home/yongmingd/multi-storage-client/rust/target/aarch64-unknown-linux-gnu/release/maturin/libmsc_rustclient.so
but generate incorrectly tagged final wheel:
📦 Built wheel for abi3 Python ≥ 3.9 to /home/yongmingd/multi-storage-client/rust/target/wheels/multi_storage_client-0.20.2-cp39-abi3-linux_x86_64.whl
Thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions