Bug: macOS ARM64 wheel 0.2.4 fails to load libSpinQInterface due to $ORIGIN rpath
Environment
- OS: macOS
- Architecture: Apple Silicon (ARM64)
- Python: 3.10
- SpinQit: 0.2.4
- Installation: PyPI wheel
- Wheel:
spinqit-0.2.4-cp310-cp310-macosx_13_0_arm64.whl
Problem
After installing SpinQit 0.2.4 from PyPI, importing the package fails with:
ImportError: dlopen(.../spinq_backends.cpython-310-darwin.so, 0x0002):
Library not loaded: @rpath/libSpinQInterface_darwin_arm_64.dylib
The required dynamic library is actually included in the installed package:
spinqit/
├── spinq_backends.cpython-310-darwin.so
└── libSpinQInterface_darwin_arm_64.dylib
However, otool shows that the extension uses $ORIGIN as its LC_RPATH:
$ otool -l spinq_backends.cpython-310-darwin.so | grep -A3 LC_RPATH
cmd LC_RPATH
cmdsize 24
path $ORIGIN (offset 12)
The dependency is:
$ otool -L spinq_backends.cpython-310-darwin.so
@rpath/libSpinQInterface_darwin_arm_64.dylib
Verification with the original PyPI wheel
I also downloaded the original PyPI wheel directly using:
pip download --only-binary=:all: --no-deps spinqit==0.2.4
After extracting the wheel, the same $ORIGIN rpath is present in the original wheel:
spinqit-0.2.4-cp310-cp310-macosx_13_0_arm64.whl
LC_RPATH
path $ORIGIN
The wheel contains both:
spinqit/spinq_backends.cpython-310-darwin.so
spinqit/libSpinQInterface_darwin_arm_64.dylib
Workaround
The import succeeds if I manually add the spinqit directory to DYLD_LIBRARY_PATH:
export DYLD_LIBRARY_PATH="$PWD/.venv/lib/python3.10/site-packages/spinqit:$DYLD_LIBRARY_PATH"
After that:
python -c "import spinqit"
works successfully.
Expected behavior
Since libSpinQInterface_darwin_arm_64.dylib is included in the same package directory as spinq_backends.cpython-310-darwin.so, I would expect the wheel to load the library without requiring users to manually configure DYLD_LIBRARY_PATH.
Could you please confirm whether the $ORIGIN LC_RPATH in the macOS ARM64 wheel is intentional?
If not, could the wheel be rebuilt with the appropriate macOS relative library path, such as @loader_path?
Thanks!
Bug: macOS ARM64 wheel 0.2.4 fails to load
libSpinQInterfacedue to$ORIGINrpathEnvironment
spinqit-0.2.4-cp310-cp310-macosx_13_0_arm64.whlProblem
After installing SpinQit 0.2.4 from PyPI, importing the package fails with:
The required dynamic library is actually included in the installed package:
However,
otoolshows that the extension uses$ORIGINas itsLC_RPATH:The dependency is:
Verification with the original PyPI wheel
I also downloaded the original PyPI wheel directly using:
After extracting the wheel, the same
$ORIGINrpath is present in the original wheel:The wheel contains both:
Workaround
The import succeeds if I manually add the
spinqitdirectory toDYLD_LIBRARY_PATH:After that:
python -c "import spinqit"works successfully.
Expected behavior
Since
libSpinQInterface_darwin_arm_64.dylibis included in the same package directory asspinq_backends.cpython-310-darwin.so, I would expect the wheel to load the library without requiring users to manually configureDYLD_LIBRARY_PATH.Could you please confirm whether the
$ORIGINLC_RPATHin the macOS ARM64 wheel is intentional?If not, could the wheel be rebuilt with the appropriate macOS relative library path, such as
@loader_path?Thanks!