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

Build universal2 wheel for Apple Silicon support #2021

Closed
wants to merge 1 commit into from

Conversation

kainjow
Copy link

@kainjow kainjow commented Nov 20, 2021

Summary

  • OS: macOS
  • Bug fix: no
  • Type: wheels
  • Fixes:

Description

A universal2 binary, new with Python 3.9.1, is a macOS binary that contains Intel and Apple Silicon code. This allows macOS apps to be built and distributed on either architecture and run natively on either.

@giampaolo giampaolo marked this pull request as ready for review November 20, 2021 13:28
@kainjow
Copy link
Author

kainjow commented Nov 20, 2021

I will verify later today whether this worked or not.

@kainjow
Copy link
Author

kainjow commented Nov 21, 2021

Looks like it worked. I downloaded the wheels file and there are several universal2 files. I unzipped psutil-5.8.1-cp39-cp39-macosx_10_9_universal2.whl and ran lipo to verify:

$ lipo -info /Users/kainjow/Downloads/wheels/psutil-5.8.1-cp39-cp39-macosx_10_9_universal2.whl/psutil/_psutil_osx.cpython-39-darwin.so /Users/kainjow/Downloads/wheels/psutil-5.8.1-cp39-cp39-macosx_10_9_universal2.whl/psutil/_psutil_posix.cpython-39-darwin.so 
Architectures in the fat file: /Users/kainjow/Downloads/wheels/psutil-5.8.1-cp39-cp39-macosx_10_9_universal2.whl/psutil/_psutil_osx.cpython-39-darwin.so are: x86_64 arm64 
Architectures in the fat file: /Users/kainjow/Downloads/wheels/psutil-5.8.1-cp39-cp39-macosx_10_9_universal2.whl/psutil/_psutil_posix.cpython-39-darwin.so are: x86_64 arm64 

giampaolo pushed a commit that referenced this pull request Oct 18, 2022
)

This commit updates the build workflow to use the latest cibuildwheel as a GitHub Action.
cibuildwheel configuration is now in its own file (as there's no `pyproject.toml` yet)

Signed-off-by: mayeut <[email protected]>
@giampaolo
Copy link
Owner

New psutil 5.9.3 is out with macOS arm64 binaries which should fix this issue.

ddelange added a commit to ddelange/psutil that referenced this pull request Oct 28, 2022
* 'master' of https://github.com/giampaolo/psutil:
  add windows test for free physical mem giampaolo#2074
  fix OSX tests broken by accident
  update HISTORY + give CREDITS for @arossert, @smoofra, @mayeut for giampaolo#2102, giampaolo#2156, giampaolo#2010
  build fix for Mac OS, Apple Silicon (giampaolo#2010)
  Linux: fix missing SPEED_UNKNOWN definition (giampaolo#2156)
  Use system-level values for Windows virtual memory (giampaolo#2077)
  feature: use ABI3 for cp36+ (giampaolo#2102)
  fix py2 compatibility
  improve API speed benchmark script giampaolo#2102
  fix: linter issues from giampaolo#2146 (giampaolo#2155)
  chore: skip test_cpu_freq on macOS arm64 (giampaolo#2146)
  pre-release + give CREDITS to @mayeut (PR giampaolo#2040) and @eallrich (new supporter)
  Fix a typo (giampaolo#2047)
  move isort and coverage config into pyproject.toml
  fix giampaolo#2021, fix giampaolo#1954, provide OSX arm64 bins + add pyproject.toml (giampaolo#2040)
  refactor git_log.py
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