Compare commits

..
4 Commits
Author SHA1 Message Date
ryujin 640061db21 Merge pull request 'Fix CI build failures from GitHub release asset HTTP 618 errors' (#4) from fix/ci-github-asset-download-618 into main
CI & Pak Build / test (push) Successful in 48s
CI & Pak Build / build-pak (push) Successful in 2m45s
2026-12-01 14:26:01 +00:00
ryujin 59ff86d30f Fix GitHub release asset HTTP 618 failures in build-pak.sh
CI & Pak Build / test (pull_request) Successful in 49s
CI & Pak Build / build-pak (pull_request) Successful in 2m46s
GitHub /releases/download/ URLs return a 302 redirect to
release-assets.githubusercontent.com with a 5-minute signed JWT.
When an intermediate HTTP cache/proxy caches that 302 response past the
JWT expiration (ignoring Cache-Control: no-cache), curl immediately fails
with exit code 22 (HTTP 618 jwt:expired).

- Append a unique cache-busting query parameter per attempt in
  download_if_missing() so each request receives a fresh 302 redirect
  and unexpired JWT
- Add retry logic with backoff, explicit timeouts, and atomic temp-file
  writes so transient download failures do not break CI or leave partial
  binaries behind
- Log platform/binary name (e.g. tg5040/minui-list) for clearer CI logs

Fixes #3
2026-12-01 14:20:20 +00:00
ryujin 134110d8e2 Merge pull request 'Fix minui-presenter freeze by correcting --timeout values' (#2) from fix/presenter-timeout into main
CI & Pak Build / test (push) Successful in 47s
CI & Pak Build / build-pak (push) Failing after 2m37s
Reviewed-on: #2
2026-12-01 03:51:27 +00:00
ryujin a4ed74c6b3 Fix minui-presenter freeze by correcting --timeout values
CI & Pak Build / test (pull_request) Successful in 48s
CI & Pak Build / build-pak (pull_request) Failing after 2m36s
In minui-presenter, --timeout -1 disables all button input (intended for backgrounded loading screens), while --timeout 0 waits indefinitely for a button press (intended for interactive prompts).

- Use --timeout 0 in show_message() so Press A / B responds normally
- Use --timeout -1 in start_busy() so background status screens ignore stray input until killed
- Add EXIT/INT/TERM trap to ensure stop_busy cleans up any background presenter

Fixes #1
2026-11-30 22:41:55 -05:00
2 changed files with 53 additions and 7 deletions

No files matched your search

+49 -5
View File
@@ -42,12 +42,56 @@ fi
download_if_missing() {
local url="$1"
local dest="$2"
if [ ! -s "$dest" ]; then
echo "==> Downloading $(basename "$dest")..."
mkdir -p "$(dirname "$dest")"
curl -fsSL "$url" -o "$dest"
chmod +x "$dest"
local label
label="$(basename "$(dirname "$dest")")/$(basename "$dest")"
if [ -s "$dest" ]; then
return 0
fi
mkdir -p "$(dirname "$dest")"
local max_attempts=5
local attempt=1
local tmp="${dest}.tmp.$$"
while [ "$attempt" -le "$max_attempts" ]; do
local sep="?"
case "$url" in
*\?*) sep="&" ;;
esac
# GitHub release download URLs 302-redirect to short-lived (5m) JWT asset URLs.
# A unique cache-busting query parameter ensures intermediate HTTP caches/proxies
# cannot serve a stale 302 redirect with an expired JWT (HTTP 618 / curl exit 22).
local req_url="${url}${sep}cb=$(date +%s)-$$-${RANDOM:-0}-${attempt}"
if [ "$attempt" -eq 1 ]; then
echo "==> Downloading ${label}..."
else
echo "==> Retrying ${label} (attempt ${attempt}/${max_attempts})..."
fi
rm -f "$tmp"
if curl -fsSL \
--connect-timeout 15 \
--max-time 120 \
-H "Cache-Control: no-cache" \
-H "Pragma: no-cache" \
"$req_url" -o "$tmp" && [ -s "$tmp" ]; then
chmod +x "$tmp"
mv "$tmp" "$dest"
return 0
fi
rm -f "$tmp"
if [ "$attempt" -lt "$max_attempts" ]; then
sleep $((attempt * 2))
fi
attempt=$((attempt + 1))
done
echo "ERROR: Failed to download ${label} from ${url} after ${max_attempts} attempts." >&2
return 1
}
echo "==> Fetching NextUI UI binaries (minui-list $MINUI_LIST_VER & minui-presenter $MINUI_PRESENTER_VER)..."
+4 -2
View File
@@ -54,7 +54,7 @@ show_message() {
--confirm-show \
--confirm-button A \
--confirm-text "$BTN" \
--timeout -1 >> "$LOG_FILE" 2>&1
--timeout 0 >> "$LOG_FILE" 2>&1
else
echo "$MSG" >> "$LOG_FILE"
fi
@@ -64,7 +64,7 @@ BUSY_PID=""
start_busy() {
stop_busy
if [ -n "$MINUI_PRESENTER" ]; then
"$MINUI_PRESENTER" --message "$1" --timeout 0 >> "$LOG_FILE" 2>&1 &
"$MINUI_PRESENTER" --message "$1" --timeout -1 >> "$LOG_FILE" 2>&1 &
BUSY_PID=$!
fi
}
@@ -77,6 +77,8 @@ stop_busy() {
fi
}
trap stop_busy EXIT INT TERM
# Runs minui-list using --write-location (reliable across all NextUI platforms)
pick_from_list() {
LIST_FILE="$1"