Skip to content

Fix build.sh silently aborting when no signing identity is present - #2

Open
sjmadministration-hub wants to merge 1 commit into
msllrs:mainfrom
sjmadministration-hub:fix/build-sh-pipefail-abort
Open

Fix build.sh silently aborting when no signing identity is present#2
sjmadministration-hub wants to merge 1 commit into
msllrs:mainfrom
sjmadministration-hub:fix/build-sh-pipefail-abort

Conversation

@sjmadministration-hub

Copy link
Copy Markdown

Bug

scripts/build.sh silently aborts right after Assembling .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

IDENTITY=$(security find-identity -v -p codesigning 2>/dev/null \
    | grep -oE '"(Developer ID Application|Apple Development)[^"]*"' \
    | head -1 | tr -d '"')

The script runs under set -euo pipefail. When grep finds no match it exits 1, which — under pipefail — makes the whole pipeline (and therefore the IDENTITY=$(...) assignment) exit 1. Under set -e that 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.sh on 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 || true to the pipeline so a missing identity just leaves IDENTITY empty and falls through to the intended ad-hoc signing branch, instead of aborting the script.

Tested locally: with the fix, scripts/install.sh completes end-to-end (build, ad-hoc sign, install to /Applications, hook + settings.json setup) on a machine with no signing identity.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant