From c4291ef903a5befc1aa4b5e424cbe8768eed4c41 Mon Sep 17 00:00:00 2001 From: "Michael C. Ferguson" Date: Tue, 15 Sep 2026 20:10:24 -0500 Subject: [PATCH] mk-release: anchor output/dist arguments to the caller's cwd release.yml calls `scripts/mk-release.sh output dist`, so $dist was the relative string "dist". Step 4 packs the archive from inside a subshell that has cd'd to release-work/release-stage, and 7z quietly CREATES a missing output directory and exits 0 -- so the pack "succeeded" into release-work/release-stage/dist/release_20260915.7z and dist/ never got the file. The next line's `wc -c` redirection failed inside a command substitution (which set -e does not catch), so the run limped on to the round-trip step before dying with a misleading "does not exist". Absolutize both arguments before anything changes directory, and make the pack step assert its own product so a future variant of this fails at the line that caused it. Found by the v2026.09.15-beta release run (actions run 35033662179); the stock payload fetch/verify was fine, nothing upstream was yanked. Co-Authored-By: Claude Opus 5 (1M context) --- scripts/mk-release.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/mk-release.sh b/scripts/mk-release.sh index 832684a..67090c7 100755 --- a/scripts/mk-release.sh +++ b/scripts/mk-release.sh @@ -24,8 +24,15 @@ set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" -out=${1:-$ROOT/output} -dist=${2:-$ROOT/dist} +# Anchor both directories to the caller's cwd BEFORE anything changes directory: +# step 4 packs the 7z from inside a `cd`-ed subshell, and release.yml passes +# them relative (`scripts/mk-release.sh output dist`). 7z silently CREATES a +# missing output directory and exits 0, so a relative $dist there does not fail +# the pack -- it writes the archive into the staging tree and everything +# downstream looks for a file that is not where it was asked to go. +abspath() { case $1 in /*) printf '%s\n' "$1" ;; *) printf '%s\n' "$PWD/$1" ;; esac; } +out=$(abspath "${1:-$ROOT/output}") +dist=$(abspath "${2:-$ROOT/dist}") work=$ROOT/release-work # shellcheck source=scripts/ci-lib.sh source "$ROOT/scripts/ci-lib.sh" @@ -82,6 +89,7 @@ cp -f "$out/images/linux.img" "$out/images/zImage_dtb" "$out/images/7za" "$work/ find "$work/release-stage/files/linux" -maxdepth 1 -printf ' %f\n' | sort # Plain solid LZMA2, no BCJ2: the on-device 7za (2016) cannot read BCJ2 streams. ( cd "$work/release-stage" && 7z a -mx=9 -m0=lzma2 -mf=off -ms=on "$dist/release_$release_date.7z" files/ >/dev/null ) +[ -f "$dist/release_$release_date.7z" ] || die "7z exited 0 but $dist/release_$release_date.7z does not exist" echo " wrote $dist/release_$release_date.7z ($(wc -c < "$dist/release_$release_date.7z") bytes)" # --- 5. round trip under the pinned ARM 7za ----------------------------------------