Skip to content

Fix macOS wheel bundling by setting DYLD_LIBRARY_PATH for delocate - #698

Merged
jameskermode merged 6 commits into
publicfrom
fix-macos-wheel-bundling
Dec 22, 2025
Merged

Fix macOS wheel bundling by setting DYLD_LIBRARY_PATH for delocate#698
jameskermode merged 6 commits into
publicfrom
fix-macos-wheel-bundling

Conversation

@jameskermode

@jameskermode jameskermode commented Dec 22, 2025

Copy link
Copy Markdown
Member

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-wheel couldn't find the QUIP libraries because DYLD_LIBRARY_PATH wasn't set. The fallback (cp {wheel} {dest_dir}/) silently produced broken wheels.

Linux issue: auditwheel couldn't find the QUIP libraries because LD_LIBRARY_PATH wasn't set.

Fix

macOS:

  • Add QUIP_LIB_PATH environment variable pointing to QUIP library directories
  • Set DYLD_LIBRARY_PATH in the repair command so delocate can find the libraries
  • Remove the fallback that produced broken wheels (fail fast instead)

Linux:

  • Add LD_LIBRARY_PATH with QUIP library paths so auditwheel can find them

Test plan

  • CI wheel builds pass on all platforms
  • macOS wheel can be installed and import quippy works
  • Linux wheel can be installed and import quippy works
  • Tag v0.10.1 to release fixed wheels

🤖 Generated with Claude Code

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
jameskermode force-pushed the fix-macos-wheel-bundling branch from b6c5ba6 to 56accc1 Compare December 22, 2025 10:22
jameskermode and others added 5 commits December 22, 2025 10:46
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>
@jameskermode
jameskermode merged commit 56af6c8 into public Dec 22, 2025
14 checks passed
@jameskermode
jameskermode deleted the fix-macos-wheel-bundling branch December 22, 2025 12:20
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant