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

ujson could not be found on Apple Silicon #456

Closed
muuvmuuv opened this issue Mar 28, 2021 · 5 comments · Fixed by #491
Closed

ujson could not be found on Apple Silicon #456

muuvmuuv opened this issue Mar 28, 2021 · 5 comments · Fixed by #491

Comments

@muuvmuuv
Copy link

What did you do?

  1. pyenv virtualenv 3.9.1 test
  2. pip install ujson
  3. import ujson

What did you expect to happen?

What actually happened?

It appears that on silicon it does not correctly install any version:

Bildschirmfoto 2021-03-28 um 12 22 25

What versions are you using?

  • OS: macOS 11.2
  • Python: 3.9.1
  • UltraJSON: 4.0.2

Please include code that reproduces the issue.

The best reproductions are self-contained scripts with minimal dependencies.

code goes here
@bwoodsend
Copy link
Collaborator

This issue is to be expected because all of the wheels built for macOS are x86_64 only. We need to build either arm64 or universal2 (x86_64 and armd64combined into one file) wheels. PyPA (or more precisely, one specific member of PyPA) are very much pushing towards universal2. The fix for this is simultaneously easy and difficult. It's easy because universal2 wheels are produced automatically if you use a universal2 build of Python to build them. It's difficult because that is the only way to produce them (which is a shame because Apple and clang have done a pretty good job of making x86_64, arm64 and universal2 binaries easy to (cross) compile on either architecture - it's just the Python end that falls short).

I'm fairly certain that the only universal2 builds of Python are those labelled macOS 64-bit universal2 installer from python.org/downloads. Both brew and the Pythons set up by actions/setup-python use single arch x86_64 which are useless to us.

So our choices are:

  • Pester actions/setup-python to add an option for universal2 builds.
  • Replace our usage of actions/setup-python with some curl https://www.python.org/ftp/python/3.9.7/python-3.9.7-macos11.pkg skullduggery to manually install a universal2 Python for macOS + Python>=3.9.
  • Do what most of the Python world have done and switch to https://github.com/pypa/cibuildwheel which uses option 2 uinder the hood.

@rajasimon

This comment has been minimized.

@hugovk

This comment has been minimized.

@hugovk
Copy link
Member

hugovk commented Nov 27, 2021

This option sounds the best, and I've been hearing good things about cibuldwheel.

@bwoodsend Would you be able to put together a PR at some point?

We'll be dropping Python 3.6 soon (#490) in case that simplifies things or if this should be bundled with a major version bump.

Thanks!

@bwoodsend
Copy link
Collaborator

Will do.

bwoodsend added a commit to bwoodsend/ultrajson that referenced this issue Nov 28, 2021
This will enable the building of macOS ARM64 compatible wheels, fixing ultrajson#456 (and
also lets us delete lots of code!!!).
bwoodsend added a commit to bwoodsend/ultrajson that referenced this issue Nov 28, 2021
This will enable the building of macOS ARM64 compatible wheels, fixing ultrajson#456 (and
also lets us delete lots of code!!!).
bwoodsend added a commit to bwoodsend/ultrajson that referenced this issue Nov 28, 2021
This will enable the building of macOS ARM64 compatible wheels, fixing ultrajson#456 (and
also lets us delete lots of code!!!).
bwoodsend added a commit to bwoodsend/ultrajson that referenced this issue Nov 28, 2021
This will enable the building of macOS ARM64 compatible wheels, fixing ultrajson#456 (and
also lets us delete lots of code!!!).
bwoodsend added a commit to bwoodsend/ultrajson that referenced this issue Nov 28, 2021
This will enable the building of macOS ARM64 compatible wheels, fixing ultrajson#456 (and
also lets us delete lots of code!!!).
bwoodsend added a commit to bwoodsend/ultrajson that referenced this issue Nov 28, 2021
This will enable the building of macOS ARM64 compatible wheels, fixing ultrajson#456 (and
also lets us delete lots of code!!!).
bwoodsend added a commit to bwoodsend/ultrajson that referenced this issue Nov 28, 2021
This will enable the building of macOS ARM64 compatible wheels, fixing ultrajson#456 (and
also lets us delete lots of code!!!).
bwoodsend added a commit to bwoodsend/ultrajson that referenced this issue Nov 28, 2021
This will enable the building of macOS ARM64 compatible wheels, fixing ultrajson#456 (and
also lets us delete lots of code!!!).
bwoodsend added a commit to bwoodsend/ultrajson that referenced this issue Nov 28, 2021
This will enable the building of macOS ARM64 compatible wheels, fixing ultrajson#456 (and
also lets us delete lots of code!!!).
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 a pull request may close this issue.

4 participants