From 8ef1986719b83330e4db8aa728b1997b6b313697 Mon Sep 17 00:00:00 2001 From: Tomaz Zaman Date: Mon, 10 Aug 2026 22:18:07 +0200 Subject: [PATCH 26/72] mono-update: drop the release tag on any failure, not just build An EXIT trap replaces the build-only cleanup: any nonzero exit after the tag is created - failed artifact staging, a dropped rsync to the publish host, a push error - now removes the tag. Previously a failed publish left the tag at branch head, so the next run saw it and concluded 'up to date', wedging the release until manual intervention. Now the next run recomputes the same revision and retries. Co-Authored-By: Claude Fable 5 --- scripts/mono-update.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/scripts/mono-update.sh b/scripts/mono-update.sh index 5cd5664a17..c4e233c011 100755 --- a/scripts/mono-update.sh +++ b/scripts/mono-update.sh @@ -73,19 +73,26 @@ fi # (mono-update-check reads it at build time). Dropped again on failure. git tag -f "$RELTAG" -cleanup_fail() { +# From here on ANY nonzero exit - build, artifact staging, publish, push - +# removes the tag, so the next run recomputes this same revision and +# retries instead of seeing a tag at branch head and skipping. Without +# this a failed rsync would leave the tag and wedge the release. set -e +# turns a failed command into an exit, which fires the trap. +on_exit() { + rc=$? + [ "$rc" -eq 0 ] && return 0 git tag -d "$RELTAG" >/dev/null 2>&1 || true - echo "mono-update: BUILD FAILED for $RELTAG" >&2 - exit 1 + echo "mono-update: FAILED ($RELTAG, rc=$rc) - tag dropped, will retry next run" >&2 } +trap on_exit EXIT cp configs/mono_gateway-dk.seed .config -make defconfig || cleanup_fail +make defconfig # mono-update-check bakes the release tag into /etc/mono_release at its # build time; force it fresh or every image ships the stale identity of # the package's first build (and auto-mode devices re-flash forever). -make package/mono/mono-update-check/clean package/mono/mono-update-check/compile || cleanup_fail -make -j"$(nproc)" world || cleanup_fail +make package/mono/mono-update-check/clean package/mono/mono-update-check/compile +make -j"$(nproc)" world OUT="releases/$RELTAG" BINDIR=bin/targets/layerscape/armv8_64b -- 2.47.3