-
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 to build_wheels.py #382
Conversation
This has been on my todo list for a while, actually, but life has been busy recently, so I didn't yet get around to it. Can you verify that the resulting wheel works on arm64 linux? |
Thanks for asking. I checked the wheel content:
To my surprise, its size is quite small compared with the amd64 binary: I think we need to change the
|
Since you seem to have access to an ARM linux device, I'd be grateful for your help in creating a binary wheel for it. |
@bastibe @imWildCat After some additional fixes, the problem #382 (comment) (installation issue) was fixed in my own build. Main points of fixes
Experimental binary wheel build: https://github.com/aoirint/python-soundfile/releases/tag/0.12.2.dev1%2Baoirint.addlinuxarm64 However, this binary wheel does not pass I created an issue about it. Shortened Error Log of pytest
Full Error Log of pytest$ python -m pytest
===================================================== test session starts =====================================================
platform linux -- Python 3.11.6, pytest-7.4.2, pluggy-1.3.0
rootdir: /code
collected 324 items
tests/test_argspec.py .... [ 1%]
tests/test_soundfile.py ............................................................................................... [ 30%]
....................................................................................................................... [ 67%]
................................................................................................FF........ [100%]
========================================================== FAILURES ===========================================================
___________________________________________________ test_available_formats ____________________________________________________
def test_available_formats():
formats = sf.available_formats()
assert 'WAV' in formats
> assert 'OGG' in formats
E AssertionError: assert 'OGG' in {'AIFF': 'AIFF (Apple/SGI)', 'AU': 'AU (Sun/NeXT)', 'AVR': 'AVR (Audio Visual Research)', 'CAF': 'CAF (Apple Core Audio File)', ...}
tests/test_soundfile.py:1005: AssertionError
___________________________________________________ test_available_subtypes ___________________________________________________
def test_available_subtypes():
subtypes = sf.available_subtypes()
assert 'PCM_24' in subtypes
assert 'FLOAT' in subtypes
> assert 'VORBIS' in subtypes
E AssertionError: assert 'VORBIS' in {'ALAC_16': '16 bit ALAC', 'ALAC_20': '20 bit ALAC', 'ALAC_24': '24 bit ALAC', 'ALAC_32': '32 bit ALAC', ...}
tests/test_soundfile.py:1013: AssertionError
====================================================== warnings summary =======================================================
tests/test_soundfile.py::test_extra_info[fd]
/home/user/.local/lib/python3.11/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored from cffi callback <function SoundFile._init_virtual_io.<locals>.vio_write at 0x5518d100e0>: None
Traceback (most recent call last):
File "/home/user/.local/lib/python3.11/site-packages/_pytest/fixtures.py", line 596, in _get_active_fixturedef
return self._fixture_defs[argname]
~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'request'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/code/soundfile.py", line 1261, in vio_write
written = file.write(data)
^^^^^^^^^^^^^^^^
ValueError: I/O operation on closed file
warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=================================================== short test summary info ===================================================
FAILED tests/test_soundfile.py::test_available_formats - AssertionError: assert 'OGG' in {'AIFF': 'AIFF (Apple/SGI)', 'AU': 'AU (Sun/NeXT)', 'AVR': 'AVR (Audio Visual Research)', ...
FAILED tests/test_soundfile.py::test_available_subtypes - AssertionError: assert 'VORBIS' in {'ALAC_16': '16 bit ALAC', 'ALAC_20': '20 bit ALAC', 'ALAC_24': '24 bit ALAC', 'ALAC_32...
========================================== 2 failed, 322 passed, 1 warning in 5.65s =========================================== If you are using Docker, you may test my aarch64 wheel build/fix on x86_64 machine with QEMU CPU emulation. Commands
# On host machine
git clone https://github.com/aoirint/python-soundfile.git
cd python-soundfile
git checkout 5f2f5b37cd210005f0510f3d11cd9e4e0efa06e4
git submodule update --init
sudo docker run --rm -it --volume ".:/code" --platform "linux/arm64" arm64v8/python:3.11 bash # As root user in Docker container
useradd --uid 1000 --create-home user
su -l user -s /bin/bash # As general user in Docker container
cd /code
python build_wheels.py
pip install ./dist/soundfile-0.12.2.dev1+aoirint.addlinuxarm64-py2.py3-none-manylinux_2_17_aarch64.whl
pip install numpy pytest
python -m pytest |
After Experimental binary wheel build: https://github.com/aoirint/python-soundfile/releases/tag/0.12.2.dev2%2Baoirint.addlinuxarm64 Full log of pytest after .so file replaced$ python -m pytest
================================================= test session starts ==================================================
platform linux -- Python 3.11.6, pytest-7.4.2, pluggy-1.3.0
rootdir: /code
collected 324 items
tests/test_argspec.py .... [ 1%]
tests/test_soundfile.py ........................................................................................ [ 28%]
................................................................................................................ [ 62%]
................................................................................................................ [ 97%]
........ [100%]
=================================================== warnings summary ===================================================
tests/test_soundfile.py::test_file_truthiness[obj]
/home/user/.local/lib/python3.11/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored from cffi callback <function SoundFile._init_virtual_io.<locals>.vio_write at 0x5518f63ec0>: None
Traceback (most recent call last):
File "/home/user/.local/lib/python3.11/site-packages/_pytest/fixtures.py", line 596, in _get_active_fixturedef
return self._fixture_defs[argname]
~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'request'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/.local/lib/python3.11/site-packages/_pytest/fixtures.py", line 599, in _get_active_fixturedef
fixturedef = self._getnextfixturedef(argname)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/lib/python3.11/site-packages/_pytest/fixtures.py", line 473, in _getnextfixturedef
raise FixtureLookupError(argname, self)
_pytest.fixtures.FixtureLookupError: ('request', <SubRequest 'file_w' for <Function test_file_truthiness[obj]>>)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/code/soundfile.py", line 1261, in vio_write
written = file.write(data)
^^^^^^^^^^^^^^^^
ValueError: I/O operation on closed file
warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================ 324 passed, 1 warning in 3.49s ============================================ |
@aoirint sorry for the late response. Yes, please take over it. |
@imWildCat @bastibe |
#381
I found it would be very straightforward to add
arm64
support for linux because we already have prebuilt binary for it.