fix(uno-q): grep binary directly in build-deploy verify-gate

`strings "$BIN" | grep -qm1 …` under `set -o pipefail` fails on a MATCH:
grep -q closes the pipe on first hit, `strings` dies with SIGPIPE, and
pipefail propagates the non-zero pipeline status — so the verify-gate
reported "peripheral tools MISSING" on a binary that actually had them.
Grep the binary directly with `grep -qa` (no pipe, no SIGPIPE).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
Omar Sobh
2026-07-05 16:20:02 -07:00
co-authored by Claude Opus 4.8
parent 5d53149da2
commit 9aaf0645a5
+5 -2
View File
@@ -53,9 +53,12 @@ echo "=== 1/4 cross-build (aarch64 musl, --features hardware) ==="
( cd "$ZC_REPO" && cargo zigbuild --target "$TARGET" --release --locked --features hardware --bin zeroclaw ) ( cd "$ZC_REPO" && cargo zigbuild --target "$TARGET" --release --locked --features hardware --bin zeroclaw )
echo "=== 2/4 verify artifact ===" echo "=== 2/4 verify artifact ==="
# grep the binary directly (grep -a) rather than `strings | grep -q`: under
# `set -o pipefail`, grep -q closes the pipe on first match and `strings` dies
# with SIGPIPE, making the pipeline exit non-zero even on a MATCH.
file "$BIN" | grep -q "aarch64" || { echo "✗ not an aarch64 binary"; exit 1; } file "$BIN" | grep -q "aarch64" || { echo "✗ not an aarch64 binary"; exit 1; }
strings "$BIN" | grep -qm1 "Uno Q tools added" || { echo "✗ peripheral tools MISSING — did the hardware feature build?"; exit 1; } grep -qa "Uno Q tools added" "$BIN" || { echo "✗ peripheral tools MISSING — did the hardware feature build?"; exit 1; }
strings "$BIN" | grep -qm1 "uno_q_flash" || { echo "✗ flash tool missing"; exit 1; } grep -qa "uno_q_flash" "$BIN" || { echo "✗ flash tool missing"; exit 1; }
echo "✓ $(ls -la "$BIN" | awk '{print $5}') bytes, peripheral+flash tools present, sha:$(shasum -a256 "$BIN" | cut -c1-16)" echo "✓ $(ls -la "$BIN" | awk '{print $5}') bytes, peripheral+flash tools present, sha:$(shasum -a256 "$BIN" | cut -c1-16)"
[ "${1:-}" = "--build-only" ] && { echo "build-only: done (artifact at $BIN)"; exit 0; } [ "${1:-}" = "--build-only" ] && { echo "build-only: done (artifact at $BIN)"; exit 0; }