Files
buzz/desktop/scripts
Matt TooheyandClaude Fable 5 fbb9f1b94e fix(desktop): warn instead of swallowing ad-hoc codesign failures in ACP staging
codesign_if_darwin ran `codesign ... >/dev/null 2>&1 || true`, discarding
both the exit status and the error output. An unsigned nested Mach-O
therefore never surfaced at stage time — it surfaced much later as
Gatekeeper killing a subprocess mid-session, the exact failure mode the
nested-Mach-O signing scan exists to prevent, with nothing in the build
output to connect the two.

Keep the failure non-fatal (an unsignable Mach-O fragment that never
executes should not sink the stage, and release builds re-sign with the
real identity anyway) but make it visible: capture codesign's combined
output and, on non-zero exit, print a stderr warning naming the file
plus codesign's own diagnostics.

Addresses the swallowed-codesign-failure finding from the
bundling-series code review (review 2ed3d00d on b52a665a).

Verification:
- Forced failure (Mach-O in a read-only directory): warning with file
  path and codesign's "internal error in Code Signing subsystem" on
  stderr; script continues under set -e, exit 0.
- Notable non-failure probed while testing: codesign xattr-signs
  non-Mach-O and even corrupt-header files successfully, so the
  realistic trigger is filesystem/permission trouble, not file(1)
  false positives.
- Full prepare-acp-tools-resource.sh run: no warnings, both manifests
  written, all 5 staged Mach-Os pass codesign --verify.
- bash -n: syntax OK.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Matt Toohey <contact@matttoohey.com>
2026-07-15 13:52:14 +10:00
..