From 5d53d926e09909c83b61faeb940d133125aaea87 Mon Sep 17 00:00:00 2001 From: James Maes Date: Wed, 13 May 2026 09:28:53 -0500 Subject: [PATCH] fix(ci): surface real xcodebuild errors on App target failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous `-quiet 2>&1 | tail -5` collapsed every diagnostic into `** BUILD FAILED **`, leaving App target failures (e.g., the unhandled-resource error fixed in #169) effectively undebuggable from CI logs alone — we had to repro locally. Capture xcodebuild output to a tempfile instead; on success print only the tail (preserving current quietness), on failure print every `error:` / `fatal error:` line plus the last 80 lines of output for context. Local behaviour on a passing build is unchanged. Co-Authored-By: Claude Opus 4.7 --- scripts/check-app-builds.sh | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/scripts/check-app-builds.sh b/scripts/check-app-builds.sh index a122b2f..d0a5718 100755 --- a/scripts/check-app-builds.sh +++ b/scripts/check-app-builds.sh @@ -32,18 +32,36 @@ fi # via Logger.critical with "JarvisEntitlementsVerified missing/false". # Isolation eliminates the race entirely; bundle launches cleanly. echo "[check-app-builds] xcodebuild build (Debug, arm64, isolated DerivedData)..." + +# Capture the full xcodebuild log to a tempfile so we can summarise errors +# on failure. `-quiet` + `tail -5` previously suppressed every signal except +# `** BUILD FAILED **`, making CI failures undebuggable without re-running +# locally. The set-pipefail + tee ensures we keep both a streamed (quiet) +# console view and the full log for grep'ing. +LOG="$(mktemp -t check-app-builds-XXXXXX.log)" +trap 'rm -f "$LOG"' EXIT + +set +e xcodebuild build \ -project Jarvis.xcodeproj \ -scheme Jarvis \ -destination 'platform=macOS,arch=arm64' \ -configuration Debug \ -derivedDataPath "$REPO_ROOT/build" \ - -quiet 2>&1 | tail -5 + > "$LOG" 2>&1 +status=$? +set -e -if [ "${PIPESTATUS[0]}" -eq 0 ]; then +if [ "$status" -eq 0 ]; then + tail -5 "$LOG" echo "[check-app-builds] PASS — App target compiles cleanly" exit 0 -else - echo "[check-app-builds] FAIL — App target compile errors above" >&2 - exit 1 fi + +# Failure path: surface every `error:` line plus a generous tail for context. +echo "[check-app-builds] FAIL — xcodebuild exited $status. Error lines:" >&2 +grep -E "error:|fatal error:|: error " "$LOG" >&2 || true +echo >&2 +echo "[check-app-builds] Last 80 lines of xcodebuild output:" >&2 +tail -80 "$LOG" >&2 +exit 1 -- 2.54.0