-
Notifications
You must be signed in to change notification settings - Fork 108
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 Linux ARM64 (aarch64) wheel support #415
base: master
Are you sure you want to change the base?
Conversation
Awesome to see progress on this! The changes so far look entirely reasonable. Are you working on the aarch64 build scripts over in libsndfile-binaries as well? |
We don't need any new build script for libsndfile-binaries. It has already been merged in the pull request below. It seems you just need to run the GitHub Actions workflow manually, then upload/push the Linux ARM64 build artifact |
Thank you for the heads-up! I probably won't have time to look into this in the next few days, but next weekend or so looks promising. |
I have just updated libsndfile-binaries to the newest version of libsndfile, which should include support for Vorbis in ARM64 in #423. However, in order to test these things, we'd need a test suite that runs uses the precompiled binaries, in addition to the platform-supplied libsndfile. Would you, by any chance, like to contribute such a test suite? I'm afraid I don't have enough time to do that in my spare time at the moment. |
Thanks for creating the updated shared libraries.
OK. I will try work on it.
Also, python-soundfile is not currently tested for the ARM64 platform. We should test this if possible.
However, it is complicated to test ARM64 on GitHub Actions because there are only the x64-native CI runners. We have some options. If you don't mind, I prefer to use Docker because it is easier to implement for me.
Example implementation using Docker: docker run --name "emulator" --volume ".:/code" --platform "linux/arm64" --detach arm64v8/python:3.11 tail -f
docker exec "emulator" useradd --create-home user
docker exec "emulator" apt-get update
docker exec "emulator" apt-get install -y libsndfile1
docker exec -u user "emulator" pip install numpy pytest cffi>=1.0
docker exec -u user "emulator" python soundfile_build.py
docker exec -u user -w /code "emulator" pip install --editable . --verbose
docker exec -u user -w /code "emulator" python -m pytest . |
Thank you very much! This is highly appreciated!
Indeed, that is a problem. The use of docker for this is absolutely fine. Thank you for bringing this up, I wasn't aware of that option. Do you want to address this as part of this PR, or in a new PR? Out of curiosity, does it run faster than the |
This pull request is taking over #382. Thanks @imWildCat ( #382 (comment) )!
Add Linux ARM64 (aarch64) wheel to
build_wheels.py
and fix some platform dependent code.Here is the main points of fixes.
aarch64
(PEP 600)(the 3rd return value ofbdist_wheel.get_tag()
, setup.py#L82).so
filename in bastibe/libsndfile-binaries asarm64
(PYSOUNDFILE_ARCHITECTURE
, setup.py#L24).["aarch64", "aarch64_be", "armv8b", "armv8l"]
is referred to this StackOverflow answer (platform.machine()
returnsuname -m
value on Linux).With only this pull request, pytest is not passed due to an issue of
libsndfile_arm64.so
distributed in bastibe/libsndfile-binaries. Please see the GitHub Issue below.libsndfile_arm64.so
is not compiled with libogg and libvorbis libsndfile-binaries#29Currently, this pull request does not update the submodule
_soundfile_data
to keep the reference for bastibe's repository.Updating submodule after bastibe/libsndfile-binaries#29 fixed is required for working properly either before or after merging this pull request.
Here is an experimental ARM64 (aarch64) binary wheel build using my own
libsndfile_arm64.so
binary ( bastibe/libsndfile-binaries#29 fixed one). This binary successfully passespytest
.soundfile-0.12.2.dev2+aoirint.addlinuxarm64-py2.py3-none-manylinux_2_17_aarch64.whl
Full log of pytest using the experimental wheel (successfully passed)
If you are using Docker, you may test my ARM64 (aarch64) wheel build/fix on x86_64 machine with QEMU CPU emulation.
Commands
# As root user in Docker container useradd --uid 1000 --create-home user su -l user -s /bin/bash