-
Notifications
You must be signed in to change notification settings - Fork 112
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
ABI mode to API mode transition on cffi #338
base: master
Are you sure you want to change the base?
Conversation
Build error on win32 due to the declaration: """ SNDFILE* sf_wchar_open (const wchar_t *wpath, int mode, SF_INFO *sfinfo); """ Perhaps it should be removed. Tested on Macbook Pro M1
I've accidentally removed |
Could you give a summary of what you are doing here? |
from _soundfile import lib
@_ffi.callback("?") with: @_ffi.def_extern()
ffibuilder.set_source("_soundfile", None) with : ffibuilder.set_source('_soundfile', '''
#include <sndfile.h>
''', libraries=['sndfile'])
'''
extern "Python" sf_count_t vio_get_filelen (void *user_data) ;
extern "Python" sf_count_t vio_seek (sf_count_t offset, int whence, void *user_data) ;
extern "Python" sf_count_t vio_read (void *ptr, sf_count_t count, void *user_data) ;
extern "Python" sf_count_t vio_write (const void *ptr, sf_count_t count, void *user_data) ;
extern "Python" sf_count_t vio_tell (void *user_data) ;
''' Any other changes can be ignored. There was a problem compiling for win32 (see my first comment) |
Thank you for providing a prototype implementation of the ABI mode. It seems that there is some more work to do to get the test suite to run correctly with this change. To be frank, I currently have very little time to invest into this. I'll try to come back to it once 0.11 has been released. |
it seems the issue comes from the |
Probably. Would you like to try to fix it? |
I'll work on it this weekend, god willing. |
Great! Please don't feel pressured to rush. It's completely acceptable for things to take time. |
Is there a way to solve the "ffi.callback() cause MemoryError on macOS M1" and allow soundfile to continue to use the ABI mode of CFFI? The CPython and PyPy ecosystems are rapidly evolving. The ABI mode allows a soundfile release to work with new CPython and PyPy versions released later. A large community of users depend on soundfile, and the owner of the soundfile project (@bastibe) may not always have time to release new builds quickly. |
Added cffi requirement
libsndfile1 -> libsndfile1-dev
I got it to work on Ubuntu and macOS. https://github.com/aghriss/python-soundfile/actions/runs/2770259758 |
Thank you for working on this! Compiling on Windows is always a headache. |
windows actions
The thing I'm stuck with is how to add include paths for a Windows action. |
Adding includes manually
Adding library dirs manually
Build error on win32 due to the declaration:
"""
SNDFILE* sf_wchar_open (const wchar_t *wpath, int mode, SF_INFO *sfinfo);
"""
Perhaps it should be removed.
Tested on Macbook Pro M1 and works with no issues.
Find wheel here: https://github.com/aghriss/python-soundfile/releases/tag/0.11.1