fix(build): generalize the lcms2 dylib-collision check to the whole macOS bundle - #841
Merged
marcinz606 merged 1 commit intoAug 15, 2026
Conversation
…acOS bundle cv2, PIL, rawpy and imagecodecs each vendor their own copies of common dylibs (libjpeg, libpng, libtiff, ...) under identical filenames, and PyInstaller keeps only one arbitrary pick as the canonical @rpath target for all of them -- the exact bug class that broke ICC export in marcinz606#833. check_bundled_dylib_collisions() scans every same-basename collision in Contents/Frameworks instead of a curated list of known-risky basenames, which caught a real libjpeg.8.3.2.dylib collision a manual pass missed. Verified against the real local .app: passes clean, and correctly raises when a canonical symlink is forced to point at a copy missing a symbol a sibling consumer needs. Deliberately does not touch the libomp.dylib/numba gap noted alongside this follow-up -- that's absence, not a collision, and still has no evidence of user impact. Co-Authored-By: Claude Sonnet 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
fix_lcms2_dylib_collision()(fix(export): restore ICC color management on Flat/Print exports #833) hardened onlyliblcms2.2.dylibagainst PyInstaller's habit of collapsing same-basename dylibs vendored by multiple packages (cv2/PIL/rawpy/imagecodecs) into one arbitrary canonical copy — the bug that silently broke ICC-managed exports on arm64.LIBLCMS2_DYLIB_COLLISION.md) flagged this as a general bug class, not an lcms2-specific one, and named it as a follow-up worth building.check_bundled_dylib_collisions()generalizes the same symbol-closure check to every same-basename collision underContents/Frameworks, instead of a curated list of "risky" library names — a manual pass reasoning about which libraries might collide missed a real one (three packages vendor byte-different copies oflibjpeg.8.3.2.dylib). The scan also found real, currently-benign collisions onlibpng16.16.dylibandlibtiff.6.dylib(cv2 vs PIL).fix_lcms2_dylib_collision(); raises (fails the build) rather than warns, matching that function's precedent.libomp.dylib/numbaomppoolgap noted in the same doc — that's PyInstaller not bundling a library at all, a different failure mode than a collision between multiple bundled copies, and there's still no evidence it affects NegPy (numba's OpenMP pool is optional with a runtime fallback).Test plan
make lint/make typecleanpyopticfilmdep in this environment, from Add Plustek (USB) scanner backend for OpticFilm 8200i SE and enable the Scan tab on Windows #783)check_bundled_dylib_collisions()against the real local packaged.app— passes cleanlibtiff.6.dylibcanonical symlink to point at a copy missing a symbol a real consumer needs, confirmed it raises with the right detail, restored it