Skip to content

Commit b6c5ba6

Browse files
jameskermodeclaude
andcommitted
Fix macOS wheel bundling by setting DYLD_LIBRARY_PATH for delocate
The delocate-wheel command was failing to find QUIP shared libraries because DYLD_LIBRARY_PATH wasn't set. This caused the fallback to copy the wheel as-is, resulting in broken wheels that couldn't find liblibAtoms.dylib and other QUIP libraries at runtime. Fix by: - Setting QUIP_LIB_PATH environment variable with paths to QUIP libraries - Using DYLD_LIBRARY_PATH in the repair command so delocate can find them - Removing the fallback that produced broken wheels 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e09d3eb commit b6c5ba6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/build-wheels.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,18 +113,18 @@ jobs:
113113
CIBW_ENVIRONMENT_LINUX: >
114114
PKG_CONFIG_PATH="/usr/lib64/pkgconfig:/usr/local/lib64/pkgconfig"
115115
116-
# macOS: Add paths for openblas
116+
# macOS: Add paths for openblas and QUIP libraries
117+
# QUIP_LIB_PATH is used by the repair command to find QUIP shared libraries
117118
CIBW_ENVIRONMENT_MACOS: >
118119
PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
119120
PKG_CONFIG_PATH="/opt/homebrew/opt/openblas/lib/pkgconfig:/usr/local/opt/openblas/lib/pkgconfig"
121+
QUIP_LIB_PATH="$GITHUB_WORKSPACE/builddir/src/libAtoms:$GITHUB_WORKSPACE/builddir/src/fox:$GITHUB_WORKSPACE/builddir/src/GAP:$GITHUB_WORKSPACE/builddir/src/Potentials:$GITHUB_WORKSPACE/builddir/src/Utils"
120122
121-
# macOS: Custom repair command to handle duplicate libgfortran libraries
122-
# delocate has issues with multiple libgfortran.dylib paths from QUIP's multiple libraries
123-
# Try repair with arch check, then without, then skip repair (copy wheel as-is)
123+
# macOS: Custom repair command to bundle QUIP libraries into wheel
124+
# Set DYLD_LIBRARY_PATH so delocate can find QUIP shared libraries
124125
CIBW_REPAIR_WHEEL_COMMAND_MACOS: >
125-
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel} ||
126-
delocate-wheel -w {dest_dir} -v {wheel} ||
127-
cp {wheel} {dest_dir}/
126+
DYLD_LIBRARY_PATH="$QUIP_LIB_PATH:$DYLD_LIBRARY_PATH"
127+
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
128128
129129
# Build with meson-python (already configured in pyproject.toml)
130130
CIBW_BUILD_FRONTEND: "build"

0 commit comments

Comments
 (0)