FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Rewrite the install_name of the ZLIB-NG library on macOS by freakboy3742 · Pull Request #8673 · python-pillow/Pillow · GitHub

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

Merged
radarhere merged 2 commits into
python-pillow:mainfrom
freakboy3742:zlib-ng-with-sip
Feb 15, 2025
Merged

Rewrite the install_name of the ZLIB-NG library on macOS#8673
radarhere merged 2 commits into
python-pillow:mainfrom
freakboy3742:zlib-ng-with-sip

Conversation

freakboy3742 commented Jan 8, 2025
edited
Loading

Copy link
Copy Markdown
Contributor

EDIT: I believe #8743 is an even better solution, as it fixes the problem at the source.

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 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

Copy link
Copy Markdown
Contributor Author

Gentle nudge on this (and/or #8672) - is there something preventing a merge on one of these two fixes for #8671?

hugovk added this to the 11.2.0 milestone Feb 6, 2025

Copy link
Copy Markdown
Contributor Author

I believe #8743 is an even better solution, as it fixes the problem at the source; and, with any luck, eventually the patch won't be needed.

radarhere merged commit 1650425 into python-pillow:main Feb 15, 2025
freakboy3742 deleted the zlib-ng-with-sip branch February 16, 2025 01:07

Copy link
Copy Markdown
Member

I've created #9312 to upgrade to zlib-ng 2.3.1, which now includes zlib-ng/zlib-ng#1867.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delocate error when building Pillow on macOS

3 participants


Back | FazBrowse Home | New Git URL