Repository navigation
fix: the HEIC download dialog looping in a signed macOS build - #81
Merged
Merged
Conversation
`codesign --options runtime` turns on library validation, and a process under it may only dlopen libraries signed by its own Team ID. No copy of libheif is: not Homebrew's, and not the decode-only build the app downloads, which is ad-hoc signed on arm64 and unsigned on x86_64. So in a signed build every candidate is refused, the retry after the install fails exactly like the first attempt did, and the consent dialog opens again -- and again. Unsigned dev builds do not enforce validation, which is why this only appeared once bundled. The entitlement is the fix. The rest is so that a library that will not load can never again present itself as one that is missing: `download_would_help` now says no once the pinned bytes are already on disk. Fetching the same five megabytes over the top cannot change the mind of a loader that has already refused them, so the failure falls through to the status line instead of back into the dialog. Bytes that merely exist do not count -- a hash that does not match the pin is an older managed build, which a download does replace. And what reaches that status line is now worth reading: `libheif()` kept only the last candidate's error, so the managed library's rejection was overwritten by the system library's "image not found" and the signature policy never surfaced. Every candidate reports. The test-skip predicate keeps the old meaning under its own name, `no_decoder_available`: a machine with no decoder should skip the fixtures whether or not a download would do anything about it.
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.
codesign --options runtimeturns on library validation, and a process under it may only dlopen libraries signed by its own Team ID. No copy of libheif is: not Homebrew's, and not the decode-only build the app downloads, which is ad-hoc signed on arm64 and unsigned on x86_64. So in a signed build every candidate is refused, the retry after the install fails exactly like the first attempt did, and the consent dialog opens again -- and again. Unsigned dev builds do not enforce validation, which is why this only appeared once bundled.The entitlement is the fix. The rest is so that a library that will not load can never again present itself as one that is missing:
download_would_helpnow says no once the pinned bytes are already on disk. Fetching the same five megabytes over the top cannot change the mind of a loader that has already refused them, so the failure falls through to the status line instead of back into the dialog. Bytes that merely exist do not count -- a hash that does not match the pin is an older managed build, which a download does replace.And what reaches that status line is now worth reading:
libheif()kept only the last candidate's error, so the managed library's rejection was overwritten by the system library's "image not found" and the signature policy never surfaced. Every candidate reports.The test-skip predicate keeps the old meaning under its own name,
no_decoder_available: a machine with no decoder should skip the fixtures whether or not a download would do anything about it.