Rewrite the install_name of the ZLIB-NG library on macOS #8673
+8 −1
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.
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:
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.dylibto@rpath/libz.1.dylib. This means that any subsequent load requires a validDYLD_LIBRARY_PATHto resolve the link.Recent versions of macOS have a feature called System Integrity Protection (SIP) which (amongst other things) prevents
DYLD_LIBRARY_PATHfrom being passed into subshells. As the build's dependencies aren't on the default library path on macOS,delocate-wheelis unable to resolve thelibzlibrary.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_nameoflibzan absolute path, it removes the need to dynamically resolve the path.