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

DOC: Document macOS 3.8 arm64 workaround #1871

Merged
merged 6 commits into from
Jun 27, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,16 @@ If you're building on an arm64 runner, you might notice something strange about

This is fine for simple C extensions, but for more complicated builds on arm64 it becomes an issue.

So, if the cross-compilation is an issue for you, there is an 'experimental' installer available that's built natively for arm64.
So, if you want to build macOS arm64 wheels on an arm64 runner (e.g., `macos-14`) on Python 3.8, before invoking cibuildwheel, you should install a native arm64 Python 3.8 interpreter on the runner. On GitHub actions you can set this up easily using the `setup-python` action with something like:
larsoner marked this conversation as resolved.
Show resolved Hide resolved

To use this installer and perform native CPython 3.8 building, before invoking cibuildwheel, install the universal2 version of Python on your arm64 runner, something like:
```yaml
- uses: actions/setup-python@v5
with:
python-version: 3.8
if: runner.os == 'macOS' && runner.arch == 'ARM64'
```

There is also an 'experimental' installer available that's built natively for arm64 that you can install manually with something like:
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't the workaround documented just below here already? The workaround shown installs the official build, rather than GitHub's recompilation with a higher MACOSX_DEPLOYMENT_TARGET. (Assuming they are recompiled, not sure they are anymore)

Copy link
Member

@mayeut mayeut Jun 13, 2024

Choose a reason for hiding this comment

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

It's the same experimental installer used on GHA for arm64.
arm64 on GHA always uses installers from python.org (this wasn't the case for x86_64 before python 3.11)

Copy link
Contributor

Choose a reason for hiding this comment

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

Would it speed up cibuildwheel for a user to pre-install these via setup-python, actually? Might be a bit of a micro-op, just thinking.

Copy link
Member

Choose a reason for hiding this comment

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

Would it speed up cibuildwheel for a user to pre-install these via setup-python, actually? Might be a bit of a micro-op, just thinking.

The only diff in speed I could see would be downloading from GitHub vs python.org for non pre-installed pythons. I don't think it would be noticeable given only 3.8 is not preinstalled on macos-14 (and might add another source of potential failure), we can see in the test workflow that for the action sample build, python 3.9+ cibuildwheel install time is 0s. The same goes for Python 3.11+ on x86_64.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If they're functionally equivalent then I'm happy to just change this doc to use setup-python and remove the manual install steps. It's more standard practice across GHA to use setup-python so if it's functionally equivalent or better to use it, it seems like the docs should suggest that rather than curl/sudo/sh steps suggested currently. I'll change the text to remove the old way, but if that's not preferred feel free to close!

Copy link
Contributor

Choose a reason for hiding this comment

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

The old way works on other CI systems, the GHA one is GHA only. I wonder if tabs here would be better? GHA and general.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, changed to tabs!


```bash
curl -o /tmp/Python38.pkg https://www.python.org/ftp/python/3.8.10/python-3.8.10-macos11.pkg
Expand Down