-
Notifications
You must be signed in to change notification settings - Fork 536
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 changes to support building arm64 macos wheels #1383
Add changes to support building arm64 macos wheels #1383
Conversation
pyproject-tensorflow.toml
Outdated
@@ -39,6 +39,19 @@ before-all = [ | |||
test-command = "python -c 'import essentia; import essentia.standard; import essentia.streaming; from essentia.standard import MonoLoader, MetadataReader, YamlInput, Chromaprinter, TensorflowPredict'" | |||
|
|||
|
|||
[[tool.cibuildwheel.overrides]] | |||
select = "*arm64*" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make the override select
more specific so that it only triggers macos builds (to avoid a conflict with future arm64 Linux builds).
I think this won't work because we rely on homebrew to install dependencies (and those would still be x86). |
You are right. I was exploring this hack to force installing arm64 libs for the cross-build case. |
In theory, Apple Silicon wheels can be cross-compiled from the intel mac machines (however the can't be tested): https://cibuildwheel.readthedocs.io/en/stable/faq/#apple-silicon Additionally, we replace `os.system` calls by `subprocess.run` so that we can notice when one of these subprocesses fail.
- Use brew reinstall instead of brew install. - Remove incorrect brew install command.
src/3rdparty/nnls/nnls.c was not cross-built for arm64 because the arch flag was not set for .c files.
The wheel building process should be informed of the arch we are building for. If this operation works we should implement a mechanism to tell setup.py when we are cross-compiling. Maybe via env variable.
according to GHs' blog, setting `runs-on` to `macos-14` automatically provides an M2 machine. Changes: - discard setting `CIBW_ARCHS_MACOS: arm64` to cross-compile - set `os` to `macos-14`. TODO: recover `macos-11` when this works. - discard forcing arm64 brew bottles since it shoudn't be needed anymore. (https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/)
According to GH's doc MacOS-14 arm64 machines comes without pipx installed -> https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
2a937b2
to
574aefe
Compare
Node.js 16 actions are deprecated -> github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/
This version was previously skipped because we found errors when building wheels locally. We accidentally missed a leading * and found that the wheels could be created flawlessly in Actions. Restoring these wheels for now.
cibuildwheel 2.16.5 takes care of pipx in macos-14 so that we don't have to manually install it. https://github.com/pypa/cibuildwheel/releases/tag/v2.16.5
After the release of the native arm64 MacOS worker (macos-14), this PR has been updated to use it directly instead of cross-compiling from an intel machine. Main changes:
|
There is an error in building the arm64 essentia-tensorflow wheels for MacOS. The |
In theory, Apple Silicon wheels can be cross-compiled from the intel mac machines (however the can't be tested):
https://cibuildwheel.readthedocs.io/en/stable/faq/#apple-silicon
Additionally, we replace
os.system
calls bysubprocess.run
so that we can notice when one of these subprocesses fail.