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 macOS arm64 support and use latest runners for cibuildwheel #7548

Closed
wants to merge 1 commit into from

Conversation

xavier2k6
Copy link
Contributor

Bumped:

  • GHA CI OS Runner: macos-12 -> macos-latest
  • GHA CI OS Runner: windows-12 -> windows-latest
  • actions/checkout: v3 -> v4
  • docker/setup-qemu-action: v2 -> v3
  • pypa/cibuildwheel: v2.12.3 -> v2.16.2 (python 3.12 support)

@arvidn
Copy link
Owner

arvidn commented Nov 14, 2023

https://github.com/arvidn/libtorrent/actions/runs/6868842497/job/18680371514?pr=7548#step:5:85

cibuildwheel: No build identifiers selected: BuildSelector(build_config='cp37-*', skip_config='{pp*,}', requires_python=<SpecifierSet('>=3.7')>, prerelease_pythons=False)
Error: Process completed with exit code 3.

@xavier2k6
Copy link
Contributor Author

xavier2k6 commented Nov 14, 2023

@arvidn Can you kill all the runs?

The problem is there's no 3.7 for macOS - arm64

https://github.com/pypa/cibuildwheel/blob/v2.16.2/cibuildwheel/resources/build-platforms.toml#L87-L113

[macos]
python_configurations = [
  { identifier = "cp36-macosx_x86_64", version = "3.6", url = "https://www.python.org/ftp/python/3.6.8/python-3.6.8-macosx10.9.pkg" },
  { identifier = "cp37-macosx_x86_64", version = "3.7", url = "https://www.python.org/ftp/python/3.7.9/python-3.7.9-macosx10.9.pkg" },
  { identifier = "cp38-macosx_x86_64", version = "3.8", url = "https://www.python.org/ftp/python/3.8.10/python-3.8.10-macosx10.9.pkg" },
  { identifier = "cp38-macosx_arm64", version = "3.8", url = "https://www.python.org/ftp/python/3.8.10/python-3.8.10-macosx10.9.pkg" },
  { identifier = "cp38-macosx_universal2", version = "3.8", url = "https://www.python.org/ftp/python/3.8.10/python-3.8.10-macosx10.9.pkg" },
  { identifier = "cp39-macosx_x86_64", version = "3.9", url = "https://www.python.org/ftp/python/3.9.13/python-3.9.13-macos11.pkg" },
  { identifier = "cp39-macosx_arm64", version = "3.9", url = "https://www.python.org/ftp/python/3.9.13/python-3.9.13-macos11.pkg" },
  { identifier = "cp39-macosx_universal2", version = "3.9", url = "https://www.python.org/ftp/python/3.9.13/python-3.9.13-macos11.pkg" },
  { identifier = "cp310-macosx_x86_64", version = "3.10", url = "https://www.python.org/ftp/python/3.10.11/python-3.10.11-macos11.pkg" },
  { identifier = "cp310-macosx_arm64", version = "3.10", url = "https://www.python.org/ftp/python/3.10.11/python-3.10.11-macos11.pkg" },
  { identifier = "cp310-macosx_universal2", version = "3.10", url = "https://www.python.org/ftp/python/3.10.11/python-3.10.11-macos11.pkg" },
  { identifier = "cp311-macosx_x86_64", version = "3.11", url = "https://www.python.org/ftp/python/3.11.6/python-3.11.6-macos11.pkg" },
  { identifier = "cp311-macosx_arm64", version = "3.11", url = "https://www.python.org/ftp/python/3.11.6/python-3.11.6-macos11.pkg" },
  { identifier = "cp311-macosx_universal2", version = "3.11", url = "https://www.python.org/ftp/python/3.11.6/python-3.11.6-macos11.pkg" },
  { identifier = "cp312-macosx_x86_64", version = "3.12", url = "https://www.python.org/ftp/python/3.12.0/python-3.12.0-macos11.pkg" },
  { identifier = "cp312-macosx_arm64", version = "3.12", url = "https://www.python.org/ftp/python/3.12.0/python-3.12.0-macos11.pkg" },
  { identifier = "cp312-macosx_universal2", version = "3.12", url = "https://www.python.org/ftp/python/3.12.0/python-3.12.0-macos11.pkg" },
  { identifier = "pp37-macosx_x86_64", version = "3.7", url = "https://downloads.python.org/pypy/pypy3.7-v7.3.9-osx64.tar.bz2" },
  { identifier = "pp38-macosx_x86_64", version = "3.8", url = "https://downloads.python.org/pypy/pypy3.8-v7.3.11-macos_x86_64.tar.bz2" },
  { identifier = "pp38-macosx_arm64", version = "3.8", url = "https://downloads.python.org/pypy/pypy3.8-v7.3.11-macos_arm64.tar.bz2" },
  { identifier = "pp39-macosx_x86_64", version = "3.9", url = "https://downloads.python.org/pypy/pypy3.9-v7.3.13-macos_x86_64.tar.bz2" },
  { identifier = "pp39-macosx_arm64", version = "3.9", url = "https://downloads.python.org/pypy/pypy3.9-v7.3.13-macos_arm64.tar.bz2" },
  { identifier = "pp310-macosx_x86_64", version = "3.10", url = "https://downloads.python.org/pypy/pypy3.10-v7.3.13-macos_x86_64.tar.bz2" },
  { identifier = "pp310-macosx_arm64", version = "3.10", url = "https://downloads.python.org/pypy/pypy3.10-v7.3.13-macos_arm64.tar.bz2" },
]

{"os": "macos-12", "CIBW_BUILD": "cp37-*", "CIBW_ARCHS": "x86_64"},
{"os": "windows-2022", "CIBW_BUILD": "cp37-*", "CIBW_ARCHS": "AMD64"}
{"os": "macos-latest", "CIBW_BUILD": "cp37-*", "CIBW_ARCHS": "x86_64"},
{"os": "macos-latest", "CIBW_BUILD": "cp39-*", "CIBW_ARCHS": "arm64"},
Copy link

@efiop efiop Dec 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI fails on wheel repair, specifically

delocate.delocating.DelocationError: Some missing architectures in wheel
  Required arch arm64 missing from /usr/local/Cellar/openssl@3/3.1.4/lib/libssl.3.dylib
  Required arch arm64 missing from libtorrent/__init__.cpython-39-darwin.so

so it looks like libtorrent wasn't built with arm64 support and openssl doesn't have it either. Here's how pygit2 went about it https://github.com/libgit2/pygit2/blob/master/.github/workflows/wheels.yml#L41C16-L41C16 , it builds openssl and itself with arm64 support before creating wheels CIBW_BEFORE_ALL and then uses a custom CIBW_REPAIR_WHEEL_COMMAND_MACOS to repair them. Looks we'll have to do the same here. Also might as well build universal wheels here instead of just arm64, so that we can drop pure x86_64 later on (though maybe this is arguable).

@xavier2k6
Copy link
Contributor Author

I closed this as it looks like this needs to be done in 2 PR's....Cirrus CI & CI build wheel.

@arvidn Cirrus would probably need to migrate to:

Newer FreeBSD OS 14-0
OpenSSL 3 as 1.1.1 is EOL
Newer pypa/cibuildwheel action v2.16.2 (python 3.12 support)

Python 3.7 is now EOL & 3.8 only has 9 months left so unsure if you want to drop those??

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.

3 participants