Skip to content

Commit 7ae0f4b

Browse files
mkitticlaude
andcommitted
Strip duplicate LC_RPATH from extensions on macOS
The conda-forge compilers inject -Wl,-rpath,$PREFIX/lib three times per link, producing duplicate LC_RPATH load commands. macOS 15's dyld rejects duplicate LC_RPATH at load time, so the freshly switched macos-15-large runners failed every test with an ImportError on dlopen. macos-14's older dyld tolerated the duplicates. Add a macOS-only post-build step that uses install_name_tool to remove the redundant LC_RPATH entries from numcodecs/*.so. Co-Authored-By: Claude Opus 4.8 <[email protected]>
1 parent 64eade5 commit 7ae0f4b

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,22 @@ jobs:
5252
export DISABLE_NUMCODECS_AVX2=""
5353
python -m pip install -v -e .[test,test_extras,msgpack,crc32c,pcodec,zfpy]
5454
55+
- name: Deduplicate LC_RPATH entries
56+
# The conda-forge compilers inject -Wl,-rpath,$PREFIX/lib multiple
57+
# times, producing duplicate LC_RPATH load commands. macOS 15's dyld
58+
# rejects duplicate LC_RPATH at load time, so strip the extras.
59+
if: runner.os == 'macOS'
60+
run: |
61+
rpaths() { otool -l "$1" | awk '/ LC_RPATH$/{getline; getline; print $2}'; }
62+
for so in numcodecs/*.so; do
63+
for rp in $(rpaths "$so" | sort | uniq -d); do
64+
while [ "$(rpaths "$so" | grep -cx "$rp")" -gt 1 ]; do
65+
echo "Removing duplicate LC_RPATH '$rp' from $so"
66+
install_name_tool -delete_rpath "$rp" "$so"
67+
done
68+
done
69+
done
70+
5571
- name: Install zarr-python
5672
# Since zarr v3 requires numpy >= 1.25, on Python 3.11 leave it out
5773
# so we can have some tests of our minimum version of numpy (1.24)

0 commit comments

Comments
 (0)