Skip to content

feat: enable building of arm64 macOS builds#1384

Merged
bdraco merged 3 commits into
python-zeroconf:masterfrom
devbanu:master
Aug 27, 2024
Merged

feat: enable building of arm64 macOS builds#1384
bdraco merged 3 commits into
python-zeroconf:masterfrom
devbanu:master

Conversation

@devbanu
Copy link
Copy Markdown
Contributor

@devbanu devbanu commented Jul 9, 2024

This PR is related to issues #1376 and #1380.

Enabling building for macOS arm64 builds is simple, because the newest macOS runners build in arm64 by default. Hence the addition of macos-latest to the matrix.

Also, since macos-11 runners are deprecated (see [1]), switched to macos-12 for the x86_64 builds.

Incidentally, it seems current Ubuntu runners don't include apt-get by default, so switched to using apt command.

So to summarize:

  • macos-12 runners will continue building macOS x86_64 builds
  • macos-latest runners will now build macOS arm64 builds

The new files look like this:

  zeroconf-0.132.2-cp310-cp310-macosx_14_0_arm64.whl          4,683 kB
  zeroconf-0.132.2-cp311-cp311-macosx_14_0_arm64.whl          4,685 kB
  zeroconf-0.132.2-cp312-cp312-macosx_14_0_arm64.whl          4,704 kB
  zeroconf-0.132.2-cp39-cp39-macosx_14_0_arm64.whl            1,727 kB
  zeroconf-0.132.2-pp310-pypy310_pp73-macosx_14_0_arm64.whl   4,428 kB
  zeroconf-0.132.2-pp38-pypy38_pp73-macosx_14_0_arm64.whl     4,423 kB
  zeroconf-0.132.2-pp39-pypy39_pp73-macosx_14_0_arm64.whl     4,425 kB

Note that it seems impossible to build cp38 for arm64 so excluded that configuration, while pp38 seems fine.

Unrelated, but it seem all wheels after cp39 include .c source code in them, making the wheels larger. This should probably addressed in a separate PR.

[1] https://github.blog/changelog/2024-05-20-actions-upcoming-changes-to-github-hosted-macos-runners/

Because of deprecation of macos-11 runners, switched to macos-12 for x86_64 builds.

Also switched from using `apt-get install` to `apt install` command for Ubuntu, since apt-get seem to not be available any more.
@devbanu
Copy link
Copy Markdown
Contributor Author

devbanu commented Aug 13, 2024

Just to clarify, is there anything else I need to do here?

It seems the failed check is about the format of the commit message. Any way to fix that without new PR?

@bdraco bdraco changed the title Enable building of arm64 macOS builds feat: enable building of arm64 macOS builds Aug 27, 2024
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Aug 27, 2024

GitHub prevented pre-commit.ci from autofixing this pr due to autofixes to a workflow file

Please run pre-commit install
and pre-commit run --all-files locally

@bdraco bdraco merged commit 0df2ce0 into python-zeroconf:master Aug 27, 2024
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Aug 27, 2024

Unrelated, but it seem all wheels after cp39 include .c source code in them, making the wheels larger. This should probably addressed in a separate PR.

@devbanu

setup_kwargs["exclude_package_data"] = {pkg: ["*.c"] for pkg in setup_kwargs["packages"]}

It looks like this stopped working on newer python. Any thoughts on a solution?

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