fix(release): source the notarization library create-dmg.sh calls into - #2371
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.
v0.67.1 is blocked. Both
Build arm64andBuild x86_64fail inPackage artifacts:127 is "command not found". The command is
notarize_and_staple, and I introduced the call in #2365 without thesourceline that defines it.The app half of the same change worked, in the same job, a minute earlier:
How it got in
I inserted the
sourceline into all three callers with a script that keyed on the shebang block:build-release.shandbuild-plugin.shboth openset -euo pipefail.create-dmg.shopensset -e. No match, nothing inserted, and unlike the other two edits in that script I asserted nothing afterwards. The one-line fix is thesourceline.Why nothing caught it
Every tool the repo runs was happy:
bash -nparses the file fine; a call to an undefined function is valid syntax.shellcheck -xcannot tell a shell function from a command onPATH, sonotarize_and_staple "$FINAL_DMG" openreads exactly likedittoorcodesign.create-dmg.sh.Which leaves the release as the first thing to execute the line. That is the worst possible place to find out, so this PR also adds the check.
scripts/ci/check-lib-sourcing.pyreads the function names eachscripts/lib/*.shdefines and fails on any script that calls one without sourcing the library. It runs in repo-hygiene, on Linux, in well under a second.Sourcing is resolved transitively, which is what makes it useful rather than noisy:
macos.shsourcescommon.sh, so the five build scripts that sourcemacos.shand callrun_quietare correct, and an earlier version of this check reported all five. It matches the sourced file by basename so it works whether a script writeslib/common.shor, asmacos.shdoes from insidelib/, justcommon.sh.Mutation-tested against the actual bug:
What this does not tell us
The DMG notarization path in #2365 has still never run. This fix gets it to the point of running; the next release tag is the first real exercise of it. Everything before that line in the job is known good: the app notarizes, staples and passes Gatekeeper through the same shared function, and the DMG is built and signed.