Skip to content
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

Add support for Apple Silicon macOS #396

Merged
merged 1 commit into from
Jan 8, 2021
Merged

Add support for Apple Silicon macOS #396

merged 1 commit into from
Jan 8, 2021

Conversation

LER0ever
Copy link
Contributor

This PR adds support for building and developing PyO3 extensions in macOS on Apple Silicon (aarch64-apple-darwin).
Before this PR, maturin gives out an error while guessing the current architecture on arm64 mac.

This PR includes:

This PR does NOT include Universal 2 binary format support, and only produces native arm64 binary wheels on M1 machines.

A screenshot of before and after:

Screen Shot 2020-12-29 at 12 01 35 AM


The target whl filename will include binary format string
`macosx_11_0_arm64` as indicated in the CPython packaging PR that added
support for Apple Silicon: https://github.com/pypa/packaging/pull/319

The dot so file will have the same extension suffix as x86_64 darwin,
specified at
https://docs.python.org/3/whatsnew/3.5.html#build-and-c-api-changes

Updated `platforms` crates to 1.1.0 to include the PR for apple silicon
support, so that guessing platform will not throw an unsupported error.
Ref: https://github.com/RustSec/platforms-crate/pull/32

Signed-off-by: LER0ever <[email protected]>

The target whl filename will include binary format string
`macosx_11_0_arm64` as indicated in the CPython packaging PR that added
support for Apple Silicon: pypa/packaging#319

The dot so file will have the same extension suffix as x86_64 darwin,
specified at
https://docs.python.org/3/whatsnew/3.5.html#build-and-c-api-changes

Updated `platforms` crates to 1.1.0 to include the PR for apple silicon
support, so that guessing platform will not throw an unsupported error.
Ref: https://github.com/RustSec/platforms-crate/pull/32

Signed-off-by: LER0ever <[email protected]>
@konstin
Copy link
Member

konstin commented Jan 8, 2021

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants