Fix macOS wheel bundling by setting DYLD_LIBRARY_PATH for delocate - #698
Merged
Conversation
The wheels were broken because delocate (macOS) and auditwheel (Linux) couldn't find QUIP shared libraries during wheel repair. Fix for macOS: - Add QUIP_LIB_PATH environment variable with paths to QUIP libraries - Set DYLD_LIBRARY_PATH in the repair command so delocate can find them - Remove the fallback that produced broken wheels Fix for Linux: - Add LD_LIBRARY_PATH with QUIP library paths so auditwheel can find them 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
jameskermode
force-pushed
the
fix-macos-wheel-bundling
branch
from
December 22, 2025 10:22
b6c5ba6 to
56accc1
Compare
Use CIBW_ENVIRONMENT_PASS_MACOS to pass through GITHUB_WORKSPACE so it's available when constructing QUIP_LIB_PATH for the delocate repair command. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Find GCC's libgfortran.5.dylib location and put it first in DYLD_LIBRARY_PATH so delocate finds it from only one consistent location, avoiding the "Already planning to copy library with same basename" error. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The find command was failing silently. Use brew --prefix gcc which is more reliable on GitHub Actions macOS runners. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The Homebrew-installed gcc and openblas libraries on macOS 14 runners have a minimum target of macOS 14.0. Without setting this, delocate fails with: "Library dependencies do not satisfy target MacOS version 11.0" Tested locally: delocate successfully bundles all QUIP and Fortran libraries. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- macos-14 (ARM64): Homebrew libs need macOS 14.0 - macos-15-intel (x86_64): Homebrew libs need macOS 15.0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
albapa
pushed a commit
that referenced
this pull request
Jan 29, 2026
) * Fix macOS and Linux wheel bundling with library paths The wheels were broken because delocate (macOS) and auditwheel (Linux) couldn't find QUIP shared libraries during wheel repair. Fix for macOS: - Add QUIP_LIB_PATH environment variable with paths to QUIP libraries - Set DYLD_LIBRARY_PATH in the repair command so delocate can find them - Remove the fallback that produced broken wheels Fix for Linux: - Add LD_LIBRARY_PATH with QUIP library paths so auditwheel can find them 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix GITHUB_WORKSPACE not expanding in cibuildwheel environment Use CIBW_ENVIRONMENT_PASS_MACOS to pass through GITHUB_WORKSPACE so it's available when constructing QUIP_LIB_PATH for the delocate repair command. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix delocate duplicate libgfortran detection Find GCC's libgfortran.5.dylib location and put it first in DYLD_LIBRARY_PATH so delocate finds it from only one consistent location, avoiding the "Already planning to copy library with same basename" error. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Use brew --prefix to find GCC library path The find command was failing silently. Use brew --prefix gcc which is more reliable on GitHub Actions macOS runners. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Set MACOSX_DEPLOYMENT_TARGET=14.0 to match Homebrew libraries The Homebrew-installed gcc and openblas libraries on macOS 14 runners have a minimum target of macOS 14.0. Without setting this, delocate fails with: "Library dependencies do not satisfy target MacOS version 11.0" Tested locally: delocate successfully bundles all QUIP and Fortran libraries. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Use runner-specific MACOSX_DEPLOYMENT_TARGET - macos-14 (ARM64): Homebrew libs need macOS 14.0 - macos-15-intel (x86_64): Homebrew libs need macOS 15.0 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The v0.10.0 wheels are broken - they can't be imported because the QUIP shared libraries weren't bundled into the wheels.
macOS issue:
delocate-wheelcouldn't find the QUIP libraries becauseDYLD_LIBRARY_PATHwasn't set. The fallback (cp {wheel} {dest_dir}/) silently produced broken wheels.Linux issue:
auditwheelcouldn't find the QUIP libraries becauseLD_LIBRARY_PATHwasn't set.Fix
macOS:
QUIP_LIB_PATHenvironment variable pointing to QUIP library directoriesDYLD_LIBRARY_PATHin the repair command so delocate can find the librariesLinux:
LD_LIBRARY_PATHwith QUIP library paths so auditwheel can find themTest plan
import quippyworksimport quippyworks🤖 Generated with Claude Code