Description
When attempting to install python-soxr on Termux (Android), the build fails during the stub generation phase.
The nanobind stub generation in CMakeLists.txt attempts to immediately import the newly compiled shared library (soxr_ext.abi3.so) into the build-time Python interpreter. On Termux, this triggers a dynamic linker error:
ImportError: dlopen failed: cannot locate symbol "PyExc_ImportError" referenced by .../soxr_ext.abi3.so
This occurs because the linker cannot resolve Python C-API symbols when loading the module at build time in an isolated context on Android.
Suggested Solution
Similar to the approach used in shap/shap#5067, could you make the stub generation optional via a CMake flag (e.g., SOXR_NO_STUBGEN)?
This would allow users in restricted environments like Termux to build the library successfully by setting:
pip install . -v --no-build-isolation -Ccmake.define.SOXR_NO_STUBGEN=ON
This approach is both elegant and highly compatible with restricted build environments. Thank you for your consideration.
Description
When attempting to install
python-soxron Termux (Android), the build fails during the stub generation phase.The
nanobindstub generation inCMakeLists.txtattempts to immediatelyimportthe newly compiled shared library (soxr_ext.abi3.so) into the build-time Python interpreter. On Termux, this triggers a dynamic linker error:ImportError: dlopen failed: cannot locate symbol "PyExc_ImportError" referenced by .../soxr_ext.abi3.soThis occurs because the linker cannot resolve Python C-API symbols when loading the module at build time in an isolated context on Android.
Suggested Solution
Similar to the approach used in
shap/shap#5067, could you make the stub generation optional via a CMake flag (e.g.,SOXR_NO_STUBGEN)?This would allow users in restricted environments like Termux to build the library successfully by setting:
pip install . -v --no-build-isolation -Ccmake.define.SOXR_NO_STUBGEN=ONThis approach is both elegant and highly compatible with restricted build environments. Thank you for your consideration.