-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation failed with M1 macOS, PyO3 0.12, Python 3 #1330
Comments
As you're using macOS - you would need Or otherwise you could try building with |
@davidhewitt Thanks for the reply, that is indeed the problem. I copied my cargo config
Changing to |
@davidhewitt Oh and
Ref: https://github.com/RustSec/platforms-crate/blob/master/src/platform.rs and https://github.com/RustSec/platforms-crate/issues/31 Will open a separate issue to either |
🌍 Environment
rustc --version
): rustc 1.49.0-beta.4 (877c7cbe1 2020-12-10)version = "0.x.y"
withgit = "https://github.com/PyO3/pyo3")?
: no💥 Reproducing
This happens on my own project, but I can reproduce it with maturin's test-crate
1. Compile with System python 3.8
git clone https://github.com/PyO3/maturin.git cd maturin/test-crates/pyo3-pure cargo build
would produce the following error:
The python3 binary is from Apple, in universal format with both x86_64 and arm64.
file $(which python3)
gives/usr/bin/python3: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]
2. Compile with HomeBrew Python 3.9
basically the same process and same error
git clone https://github.com/PyO3/maturin.git cd maturin/test-crates/pyo3-pure PYO3_PYTHON=python3.9 cargo build
file $(which python3.9)
output:/opt/homebrew/bin/python3.9: Mach-O 64-bit executable arm64
3. Compile with Rosetta under x86 works fine
The text was updated successfully, but these errors were encountered: