Cross-compilation to macos aarch64-apple-darwin target using Maturin Docker #1768
-
I am attempting to cross-compile Python Rust bindings for macOS aarch64-apple-darwin using maturin. I've tried using the maturin Docker image, but it fails with an error related to the Python interpreter. I've also looked into using osxcross for cross-compilation, but I'm not sure how to integrate it with maturin. Based on the GitHub issue #375 and the comments from @messense mentioning the I followed the tips from the aforementioned Issue and docs from PyO3 here. I tried using latest maturin docker image, but I couldn't make it work and compile my project to When I run:
( I tired with and without additional flags in Cargo.toml: I got
When I added I also tried add maturin on top of osxcross and playing with Finally I tried using Questions
I would greatly appreciate any guidance or examples to help resolve this issue. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
No, the docker image is for native compilation only.
No, but you can use it, there is nothing in maturin that prevents you from using a custom toolchain. You can use zig, but you should probably use zig 0.10.1 instead of 0.11.x because zig 0.11.x errors on unsuppported linker flags (instead of warning like in 0.10.1).
Sorry I don't have the free time to do that. It's hard to guess what's the real problem without a repro, so please provide a minimal repro. If you can't provide a repro in public for reasons, I'm up for paid private support if you want. |
Beta Was this translation helpful? Give feedback.
-
Thank you @messense you tip on using zig 0.10.1.post1 solved the problem. |
Beta Was this translation helpful? Give feedback.
No, the docker image is for native compilation only.
No, but you can use it, there is nothing in maturin that prevents you from using a custom toolchain. You can use zig, but you should probably use zig 0.10.1 instead of 0.11.x because zig 0.11.x errors on unsuppported linker flags (instead of warning like in 0.10.1).
Sorry I don't have the free time to do that.
It's hard to guess what's the real problem without a repro, so please…