Fix build.sh silently aborting when no signing identity is present - #2
Open
sjmadministration-hub wants to merge 1 commit into
Open
Conversation
Under set -euo pipefail, the IDENTITY assignment's pipeline (security find-identity | grep | head | tr) returns exit code 1 when grep finds no matching Developer ID/Apple Development identity — the common case for anyone without a signing cert installed. This aborts the whole script immediately after 'Assembling .app bundle...' with no error message, before the ad-hoc signing fallback below ever runs. Add '|| true' so an absent identity falls through to the intended ad-hoc signing path.
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.
Bug
scripts/build.shsilently aborts right afterAssembling .app bundle...when the machine has no Developer ID Application / Apple Development signing identity installed — i.e. the common case for anyone building without a paid Apple Developer account.Cause
The script runs under
set -euo pipefail. Whengrepfinds no match it exits 1, which — underpipefail— makes the whole pipeline (and therefore theIDENTITY=$(...)assignment) exit 1. Underset -ethat terminates the script immediately, before the ad-hoc signing fallback a few lines below ever runs. No error message is printed, so it just looks like the script hung or exited for no reason.Reproduced via
scripts/install.shon a clean machine with no signing certs: build completes, "Assembling .app bundle..." prints, then the process exits with status 1 and nothing after that line.Fix
Append
|| trueto the pipeline so a missing identity just leavesIDENTITYempty and falls through to the intended ad-hoc signing branch, instead of aborting the script.Tested locally: with the fix,
scripts/install.shcompletes end-to-end (build, ad-hoc sign, install to /Applications, hook + settings.json setup) on a machine with no signing identity.