Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite the install_name of the ZLIB-NG library on macOS #8673

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

freakboy3742
Copy link
Contributor

@freakboy3742 freakboy3742 commented Jan 8, 2025

Fixes #8671. Alternative to #8672

Changes proposed in this pull request:

  • Rewrites the install_name of the zlib-ng binary on macOS to be an absolute path.
  • Removes the override of DYLD_LIBRARY_PATH, since it won't be passed down to subshells.

When zlib-ng is compiled, it sets the install name of the libz.1.dylib to @rpath/libz.1.dylib. This means that any subsequent load requires a valid DYLD_LIBRARY_PATH to resolve the link.

Recent versions of macOS have a feature called System Integrity Protection (SIP) which (amongst other things) prevents DYLD_LIBRARY_PATH from being passed into subshells. As the build's dependencies aren't on the default library path on macOS, delocate-wheel is unable to resolve the libz library.

SIP is disabled on GitHub Actions configurations, so this problem isn't seen in CI; but is enabled by default on macOS machines, so individual developers building Pillow dependencies will get an error from cibuildwheel when the wheel is repaired.

By making the install_name of libz an absolute path, it removes the need to dynamically resolve the path.

@radarhere radarhere changed the title Rewrite the install_name of the ZLIB-NG library on macOS. Rewrite the install_name of the ZLIB-NG library on macOS Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delocate error when building Pillow on macOS
2 participants