Skip to content

Build wheels for Apple Silicon #10114

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

Closed
JukkaL opened this issue Feb 19, 2021 · 5 comments
Closed

Build wheels for Apple Silicon #10114

JukkaL opened this issue Feb 19, 2021 · 5 comments

Comments

@JukkaL
Copy link
Collaborator

JukkaL commented Feb 19, 2021

Currently we don't generate binary wheels for macs with Apple Silicon, and the only option is to use the slower, interpreted version of mypy when using an ARM CPython build. A compiled wheel could up to 4x faster than the interpreted one.

cibuildwheel (https://github.com/joerick/cibuildwheel), which we use to compile wheels, now supports cross-compiling arm64 wheels for Apple Silicon on Intel. We should generate arm64 wheels for macOS. We can support at least Python 3.9 and possibly 3.8 (https://bugs.python.org/msg382939). Just supporting 3.9 would be okay.

Building the wheels happens in a GitHub action here.

Would anybody to like to try this out? If you can generate the wheels, I can help test them, since I have a Mac with Apple Silicon.

@97littleleaf11
Copy link
Collaborator

Hey @JukkaL, I briefly went through the workflows/build.yml just now. What should I do next, to modifymypy/misc/build_wheel.py or build wheels locally?

@JukkaL
Copy link
Collaborator Author

JukkaL commented Feb 23, 2021

@97littleleaf11 You can modify misc/build_wheel.py to also generate arm64 wheels when running on macOS and Python 3.9. I think that you can use CIBW_ARCHS_MACOS to define the platforms. We don't want universal wheels, since they will be much bigger. If you will create a PR, I can try the wheel generation manually.

@97littleleaf11
Copy link
Collaborator

@JukkaL I just made a PR about it.

JukkaL pushed a commit that referenced this issue Feb 27, 2021
@JukkaL
Copy link
Collaborator Author

JukkaL commented Feb 27, 2021

@97littleleaf11 Thanks for the PR! This seems to work great based on some quick experiments, with about 4.3x performance improvement. Here is a Python 3.9 arm64 wheel for the current GitHub master. More recent builds will appear here.

@JukkaL JukkaL closed this as completed Feb 27, 2021
@henryiii
Copy link
Contributor

henryiii commented Mar 4, 2021

That wheel works correctly for me on AS as well, thanks! (sorry for the delay, haven't had a chance to boot my AS machine back up till today 👶 )

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

No branches or pull requests

3 participants