You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't know what the bug is. The wheel created in pyO3 and CFFI mode both seems to be incompatible with my platform. I've tested with both, but here's the output:
[9:10:50] mat ❯ maturin new whatever
✔ 🤷 Which kind of bindings to use? · pyo3
✨ Done! New project created whatever
~/src
[9:10:54] mat ❯ cd whatever
~/src/whatever
[9:10:57] mat ❯ ls
Cargo.toml pyproject.toml src
~/src/whatever
[9:10:58] mat ❯ maturin develop
🔗 Found pyo3 bindings
🐍 Found CPython 3.10 at /opt/homebrew/anaconda3/envs/mat/bin/python
Compiling target-lexicon v0.12.4
Compiling proc-macro2 v1.0.40
Compiling once_cell v1.12.0
Compiling unicode-ident v1.0.1
Compiling quote v1.0.20
Compiling libc v0.2.126
Compiling autocfg v1.1.0
Compiling syn v1.0.98
Compiling parking_lot_core v0.9.3
Compiling scopeguard v1.1.0
Compiling cfg-if v1.0.0
Compiling smallvec v1.8.0
Compiling indoc v1.0.6
Compiling unindent v0.1.9
Compiling lock_api v0.4.7
Compiling pyo3-build-config v0.16.5
Compiling parking_lot v0.12.1
Compiling pyo3-ffi v0.16.5
Compiling pyo3 v0.16.5
Compiling pyo3-macros-backend v0.16.5
Compiling pyo3-macros v0.16.5
Compiling whatever v0.1.0 (/Users/rseymour/src/whatever)
Finished dev [unoptimized + debuginfo] target(s) in 6.55s
📦 Built wheel for CPython 3.10 to /var/folders/2c/z3xyp3hj53z0qbwqlt75tn_c0000gn/T/.tmpYipyUF/whatever-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
💥 maturin failed
Caused by: pip install in /opt/homebrew/anaconda3/envs/mat failed running ["-m", "pip", "--disable-pip-version-check", "install", "--force-reinstall"]: exit status: 1
--- Stdout:
--- Stderr:
ERROR: whatever-0.1.0-cp310-cp310-macosx_11_0_arm64.whl is not a supported wheel on this platform.
---
unzipping the wheel and running file on the .so:
[9:11:12] mat ❯ maturin build
🔗 Found pyo3 bindings
🐍 Found CPython 3.9 at /opt/homebrew/anaconda3/bin/python3.9, CPython 3.10 at /opt/homebrew/anaconda3/envs/mat/bin/python3.10
📦 Built source distribution to /Users/rseymour/src/whatever/target/wheels/whatever-0.1.0.tar.gz
Compiling pyo3-build-config v0.16.5
Compiling pyo3-ffi v0.16.5
Compiling pyo3 v0.16.5
Compiling whatever v0.1.0 (/Users/rseymour/src/whatever)
Finished dev [unoptimized + debuginfo] target(s) in 3.08s
📦 Built wheel for CPython 3.9 to /Users/rseymour/src/whatever/target/wheels/whatever-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Compiling pyo3-build-config v0.16.5
Compiling pyo3-ffi v0.16.5
Compiling pyo3 v0.16.5
arg Building [========================> ] 40/42: pyo3
Compiling whatever v0.1.0 (/Users/rseymour/src/whatever)
Finished dev [unoptimized + debuginfo] target(s) in 2.71s
📦 Built wheel for CPython 3.10 to /Users/rseymour/src/whatever/target/wheels/whatever-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
~/src/whatever 6s
[9:12:59] mat ❯ cd target/wheels
~/src/whatever/target/wheels
[9:13:11] mat ❯ ls
whatever-0.1.0-cp310-cp310-macosx_11_0_arm64.whl whatever-0.1.0-cp39-cp39-macosx_11_0_arm64.whl whatever-0.1.0.tar.gz
~/src/whatever/target/wheels
[9:13:13] mat ❯ pip install whatever-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
ERROR: whatever-0.1.0-cp39-cp39-macosx_11_0_arm64.whl is not a supported wheel on this platform.
~/src/whatever/target/wheels
[9:13:32] mat ❯ pip install whatever-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
ERROR: whatever-0.1.0-cp310-cp310-macosx_11_0_arm64.whl is not a supported wheel on this platform.
~/src/whatever/target/wheels
[9:13:43] mat ❯ unzip whatever-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Archive: whatever-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
inflating: whatever-0.1.0.dist-info/METADATA
inflating: whatever-0.1.0.dist-info/WHEEL
inflating: whatever/__init__.py
inflating: whatever/whatever.cpython-310-darwin.so
inflating: whatever-0.1.0.dist-info/RECORD
~/src/whatever/target/wheels
[9:13:53] mat ❯ file whatever/whatever.cpython-310-darwin.so
whatever/whatever.cpython-310-darwin.so: Mach-O 64-bit dynamically linked shared library arm64
not sure why pip is mad. I'm assuming conda is angry with me for not really knowing how to use it, but I don't understand how a .so for arm64 doesn't run on an M1 laptop all of the sudden...
~/src/whatever/target/wheels
[9:14:57] mat ❯ which python
/opt/homebrew/anaconda3/envs/mat/bin/python
~/src/whatever/target/wheels
[9:15:20] mat ❯ file /opt/homebrew/anaconda3/envs/mat/bin/python
/opt/homebrew/anaconda3/envs/mat/bin/python: Mach-O 64-bit executable x86_64
oh. that explains it.
I'm submitting this as a solved bug. I'm not a conda pro, so I figured conda update --all was self referential. alas. "all" sometimes means "all but the interpreter"
The fix is:
conda deactivate # just in case you're in a conda environment
conda install anaconda=2022.05 # as of today 2022-06-23
Your Python version (python -V)
Python 3.10.4
Your pip version (pip -V)
pip 21.2.4
What bindings you're using
cffi
Does cargo build work?
Yes, it works
If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash /)?
Yes
Steps to Reproduce
listed above, this is just a bug showing how an old anaconda on an M1 machine can install a x86 python and make a working rust build seem like its broken!
The text was updated successfully, but these errors were encountered:
This is actually the same kind of issue as #979 and it's fixed in #980.
Previously because maturin develop has no --target option, it relies on rustc -vV to get the host target as target triple, after #980 it will also look at the architecture of current Python interpreter on macOS.
Right it's the same mismatch, where if I'd had a rust cross compile toolchain setup I might not have noticed? Also for folks finding this, the right command for me was brew upgrade anaconda since I had installed via brew, not the internal anaconda update (which fails for me trying to solve dependency constraints)
Bug Description
I don't know what the bug is. The wheel created in pyO3 and CFFI mode both seems to be incompatible with my platform. I've tested with both, but here's the output:
unzipping the wheel and running
file
on the .so:not sure why pip is mad. I'm assuming conda is angry with me for not really knowing how to use it, but I don't understand how a .so for arm64 doesn't run on an M1 laptop all of the sudden...
oh. that explains it.
I'm submitting this as a solved bug. I'm not a conda pro, so I figured
conda update --all
was self referential. alas. "all" sometimes means "all but the interpreter"The fix is:
Your Python version (
python -V
)Python 3.10.4
Your pip version (
pip -V
)pip 21.2.4
What bindings you're using
cffi
Does
cargo build
work?If on windows, have you checked that you aren't accidentally using unix path (those with the forward slash
/
)?Steps to Reproduce
listed above, this is just a bug showing how an old anaconda on an M1 machine can install a x86 python and make a working rust build seem like its broken!
The text was updated successfully, but these errors were encountered: