fix(build): code-sign the OpenSSL dylibs the app embeds - #2369
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
A Debug build fails on any machine with a signing identity configured. Second piece of #2358 fallout, after #2367.
#2358 put
libssl.3.dylibandlibcrypto.3.dylibintoContents/Frameworksthrough a plain copy-files phase. A copy-files phase does not re-sign what it copies, andcreate-openssl-dylibs.shleaves them ad-hoc signed:codesignrefuses a bundle whose nested code carries a different identity from the app, so the app never gets signed and the build stops.Why nobody has hit it yet
Two reasons, and they are the interesting part.
CI cannot see it. Every macOS CI build passes
CODE_SIGNING_ALLOWED=NO, so the signing step that fails never runs there.It is latent until the dylibs are regenerated. Whatever was in
Libs/dylibsbefore #2358 happened to carry a real signature, so the copy produced a valid bundle.scripts/download-libs.shends by runningcreate-openssl-dylibs.sh, which rewrites them ad-hoc. I hit this by runningdownload-libs.sh --forcefor unrelated reasons, and every Debug build afterwards failed. Anyone doing a fresh setup in the documented order gets the ad-hoc pair from the start, which is to say every new checkout is already broken.CLAUDE.md tells developers to put
TABLEPRO_DEVELOPMENT_TEAMinConfigs/Secrets.xcconfig, so the affected configuration is the documented one.Fix
The two dylibs become embedded framework dependencies, which is what
Sparkle,TableProPluginKitandmcp-serverin the same file already do:codeSign: truere-signs on copy with the app's own identity.link: falseis deliberate: a framework dependency links by default, which would add both to Link Binary With Libraries and change what the app links against. Verified in the generated project, before and after:The app reaches them through
@rpathfromTablePro.debug.dyliband the plugins, exactly as before.Verification
With a real Apple Development identity:
The app still launches, which is the bug #2358 existed to fix:
QueryExecutorTestsruns through the app host and passes. All 14 bundled plugins stilldlopen(scripts/ci/verify-plugin-loads.sh). The only rpaths in the built binary are@executable_path,@loader_path, the DerivedDataPackageFrameworkspath Xcode adds, and@executable_path/../Frameworks: no absolute path into the source tree.The release path is unaffected.
build-release.sh:332copies both dylibs into the embed directory itself withcp -fand then re-signs the whole bundle with Developer ID, so Xcode placing them there first is overwritten and re-signed either way.