From a73bb661cfa3c3d14a23bca6581986c05ef49001 Mon Sep 17 00:00:00 2001 From: TuringLambdaAI Date: Thu, 22 Oct 2026 21:44:45 +0800 Subject: [PATCH 1/4] ci(linux): allow bounded cold GTK4 apt installs to complete --- .github/scripts/apt-retry.sh | 11 ++++++++-- .github/scripts/test-apt-retry.sh | 35 +++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 2 deletions(-) mode change 100644 => 100755 .github/scripts/apt-retry.sh mode change 100644 => 100755 .github/scripts/test-apt-retry.sh diff --git a/.github/scripts/apt-retry.sh b/.github/scripts/apt-retry.sh old mode 100644 new mode 100755 index e972a1a..b34fee1 --- a/.github/scripts/apt-retry.sh +++ b/.github/scripts/apt-retry.sh @@ -14,7 +14,15 @@ fi (( $# > 0 )) || usage attempts="${RIVET_APT_RETRY_ATTEMPTS:-2}" -timeout_seconds="${RIVET_APT_TIMEOUT_SECONDS:-180}" +# A complete GTK4/libsecret install can fetch 100+ packages on cold hosted +# runners. A 180-second attempt interrupts healthy downloads mid-flight. +# Update remains short; install gets a larger but still bounded window. +operation="$1" +case "$operation" in + install) default_timeout_seconds=480 ;; + *) default_timeout_seconds=180 ;; +esac +timeout_seconds="${RIVET_APT_TIMEOUT_SECONDS:-$default_timeout_seconds}" delay_seconds="${RIVET_APT_RETRY_DELAY_SECONDS:-10}" apt_get="${RIVET_APT_GET:-apt-get}" timeout_command="${RIVET_TIMEOUT_COMMAND:-timeout}" @@ -41,7 +49,6 @@ if [[ "$use_sudo" == true ]]; then apt_command=(sudo -n "${apt_command[@]}") fi -operation="$1" for (( attempt = 1; attempt <= attempts; attempt++ )); do echo "apt-retry: $operation attempt $attempt/$attempts (timeout ${timeout_seconds}s)" if "$timeout_command" --foreground --signal=TERM --kill-after=30s \ diff --git a/.github/scripts/test-apt-retry.sh b/.github/scripts/test-apt-retry.sh old mode 100644 new mode 100755 index c10530d..921f2f6 --- a/.github/scripts/test-apt-retry.sh +++ b/.github/scripts/test-apt-retry.sh @@ -23,6 +23,9 @@ case "$FAKE_APT_MODE" in timeout) sleep 5 ;; + success) + exit 0 + ;; *) exit 64 ;; @@ -51,3 +54,35 @@ if bash "$script_dir/apt-retry.sh" update; then echo "apt-retry test expected the bounded command to fail" >&2 exit 1 fi + +# Distinguish large install budgets from update without ever disabling +# timeout enforcement. An explicit caller override still takes precedence. +fake_timeout="$work/fake-timeout" +cat >"$fake_timeout" <<'SH' +#!/usr/bin/env bash +set -euo pipefail +printf '%s\n' "$*" >>"$FAKE_TIMEOUT_ARGS" +while (( $# > 0 )); do + case "$1" in + --foreground|--signal=*|--kill-after=*) shift ;; + *s) shift; break ;; + *) exit 64 ;; + esac +done +"$@" +SH +chmod +x "$fake_timeout" +export RIVET_TIMEOUT_COMMAND="$fake_timeout" +export FAKE_TIMEOUT_ARGS="$work/timeout-arguments" +export FAKE_APT_MODE=success +export RIVET_APT_RETRY_ATTEMPTS=1 +unset RIVET_APT_TIMEOUT_SECONDS +bash "$script_dir/apt-retry.sh" install --yes example-package +grep -Fq -- '480s' "$FAKE_TIMEOUT_ARGS" +: >"$FAKE_TIMEOUT_ARGS" +bash "$script_dir/apt-retry.sh" update +grep -Fq -- '180s' "$FAKE_TIMEOUT_ARGS" +: >"$FAKE_TIMEOUT_ARGS" +export RIVET_APT_TIMEOUT_SECONDS=9 +bash "$script_dir/apt-retry.sh" install --yes example-package +grep -Fq -- '9s' "$FAKE_TIMEOUT_ARGS" From 4d8ce56d4f600f1a015e089994c405fa8b90a04f Mon Sep 17 00:00:00 2001 From: TuringLambdaAI Date: Thu, 22 Oct 2026 21:45:45 +0800 Subject: [PATCH 2/4] chore(ci): preserve original shell test and wrapper file modes --- .github/scripts/apt-retry.sh | 0 .github/scripts/test-apt-retry.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 .github/scripts/apt-retry.sh mode change 100755 => 100644 .github/scripts/test-apt-retry.sh diff --git a/.github/scripts/apt-retry.sh b/.github/scripts/apt-retry.sh old mode 100755 new mode 100644 diff --git a/.github/scripts/test-apt-retry.sh b/.github/scripts/test-apt-retry.sh old mode 100755 new mode 100644 From 952581829a5ff75cb411d5c789dec8b47a78a5b4 Mon Sep 17 00:00:00 2001 From: jrtxio Date: Thu, 22 Oct 2026 23:20:33 +0800 Subject: [PATCH 3/4] ci(linux): install headless weston without recommended packages Cold runners paid for weston's full recommended media stack (codecs, speech, bluray) that a headless Wayland launch test never uses; the recommends cut keeps the bounded install budget inside one attempt even on a slow mirror. xwayland is installed explicitly because it is recommendation-only and the compositor logs errors without it. --- .github/workflows/linux-installers.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux-installers.yml b/.github/workflows/linux-installers.yml index 59dbff5..bea5be0 100644 --- a/.github/workflows/linux-installers.yml +++ b/.github/workflows/linux-installers.yml @@ -128,7 +128,8 @@ jobs: - name: Install headless Wayland compositor run: | bash .github/scripts/apt-retry.sh --sudo update - bash .github/scripts/apt-retry.sh --sudo install --yes weston + bash .github/scripts/apt-retry.sh --sudo install --yes --no-install-recommends \ + weston xwayland - name: Launch AppImage outside the build tree shell: bash env: From 8f4541abe3fa8d4d35244e78069958e9b45c145c Mon Sep 17 00:00:00 2001 From: jrtxio Date: Fri, 23 Oct 2026 00:14:47 +0800 Subject: [PATCH 4/4] ci(linux): survive slow mirrors on dev-stack installs too The GTK4 dev stack on a cold runner fetches 100+ packages including recommendations-only documentation tooling; with today's mirror throughput even the raised 480-second window loses twice. Install now defaults to three bounded, cache-resuming attempts (update stays at two), every dev-stack install drops recommended packages, and the headless weston lists carry xwayland explicitly like the AppImage job. The apt-retry self-test pins the per-operation attempt defaults and the override. --- .github/scripts/apt-retry.sh | 11 ++++++----- .github/scripts/test-apt-retry.sh | 20 ++++++++++++++++++++ .github/workflows/architectures.yml | 2 +- .github/workflows/linux-installers.yml | 2 +- .github/workflows/native-ui.yml | 4 ++-- .github/workflows/roundtrip.yml | 4 ++-- 6 files changed, 32 insertions(+), 11 deletions(-) diff --git a/.github/scripts/apt-retry.sh b/.github/scripts/apt-retry.sh index b34fee1..9468d1d 100644 --- a/.github/scripts/apt-retry.sh +++ b/.github/scripts/apt-retry.sh @@ -13,15 +13,16 @@ if [[ "${1:-}" == "--sudo" ]]; then fi (( $# > 0 )) || usage -attempts="${RIVET_APT_RETRY_ATTEMPTS:-2}" # A complete GTK4/libsecret install can fetch 100+ packages on cold hosted -# runners. A 180-second attempt interrupts healthy downloads mid-flight. -# Update remains short; install gets a larger but still bounded window. +# runners. A 180-second attempt interrupts healthy downloads mid-flight, and +# two attempts cannot outlast a slow mirror. Update remains short; install +# gets a larger window and one more bounded, cache-resuming attempt. operation="$1" case "$operation" in - install) default_timeout_seconds=480 ;; - *) default_timeout_seconds=180 ;; + install) default_timeout_seconds=480 ; default_attempts=3 ;; + *) default_timeout_seconds=180 ; default_attempts=2 ;; esac +attempts="${RIVET_APT_RETRY_ATTEMPTS:-$default_attempts}" timeout_seconds="${RIVET_APT_TIMEOUT_SECONDS:-$default_timeout_seconds}" delay_seconds="${RIVET_APT_RETRY_DELAY_SECONDS:-10}" apt_get="${RIVET_APT_GET:-apt-get}" diff --git a/.github/scripts/test-apt-retry.sh b/.github/scripts/test-apt-retry.sh index 921f2f6..0bb4076 100644 --- a/.github/scripts/test-apt-retry.sh +++ b/.github/scripts/test-apt-retry.sh @@ -55,6 +55,26 @@ if bash "$script_dir/apt-retry.sh" update; then exit 1 fi +# Install attempts default higher than update; explicit override still wins. +: >"$FAKE_APT_STATE" +export FAKE_APT_MODE=fail +export RIVET_APT_RETRY_ATTEMPTS=1 +bash "$script_dir/apt-retry.sh" install --yes example-package || true +[[ "$(cat "$FAKE_APT_STATE")" == 1 ]] +unset RIVET_APT_RETRY_ATTEMPTS +: >"$FAKE_APT_STATE" +if bash "$script_dir/apt-retry.sh" install --yes example-package; then + echo "apt-retry test expected the bounded command to fail" >&2 + exit 1 +fi +[[ "$(cat "$FAKE_APT_STATE")" == 3 ]] +: >"$FAKE_APT_STATE" +if bash "$script_dir/apt-retry.sh" update; then + echo "apt-retry test expected the bounded command to fail" >&2 + exit 1 +fi +[[ "$(cat "$FAKE_APT_STATE")" == 2 ]] + # Distinguish large install budgets from update without ever disabling # timeout enforcement. An explicit caller override still takes precedence. fake_timeout="$work/fake-timeout" diff --git a/.github/workflows/architectures.yml b/.github/workflows/architectures.yml index 795c72b..9731bae 100644 --- a/.github/workflows/architectures.yml +++ b/.github/workflows/architectures.yml @@ -177,7 +177,7 @@ jobs: - name: Install GTK4 development files and rpm tooling run: | bash .github/scripts/apt-retry.sh --sudo update - bash .github/scripts/apt-retry.sh --sudo install --yes \ + bash .github/scripts/apt-retry.sh --sudo install --yes --no-install-recommends \ libgtk-4-dev rpm desktop-file-utils - name: Compile full schema matrix, package, and verify a GTK4 app shell: bash diff --git a/.github/workflows/linux-installers.yml b/.github/workflows/linux-installers.yml index bea5be0..23bfef6 100644 --- a/.github/workflows/linux-installers.yml +++ b/.github/workflows/linux-installers.yml @@ -25,7 +25,7 @@ jobs: run: | set -euo pipefail bash .github/scripts/apt-retry.sh --sudo update - bash .github/scripts/apt-retry.sh --sudo install --yes \ + bash .github/scripts/apt-retry.sh --sudo install --yes --no-install-recommends \ desktop-file-utils libgtk-4-dev libsecret-1-dev rpm raco pkg install --auto --no-docs --name rivet --link "$PWD" - name: Build release artifacts diff --git a/.github/workflows/native-ui.yml b/.github/workflows/native-ui.yml index e1646a0..e5c2648 100644 --- a/.github/workflows/native-ui.yml +++ b/.github/workflows/native-ui.yml @@ -25,9 +25,9 @@ jobs: run: | set -euo pipefail bash .github/scripts/apt-retry.sh --sudo update - bash .github/scripts/apt-retry.sh --sudo install --yes \ + bash .github/scripts/apt-retry.sh --sudo install --yes --no-install-recommends \ at-spi2-core dbus-x11 libgtk-4-dev libsecret-1-dev \ - python3-pyatspi weston + python3-pyatspi weston xwayland raco pkg install --auto --no-docs --name rivet --link "$PWD" - name: Package and exercise the GTK4 Taskboard on native Wayland shell: bash diff --git a/.github/workflows/roundtrip.yml b/.github/workflows/roundtrip.yml index c9920b8..5ccf8b5 100644 --- a/.github/workflows/roundtrip.yml +++ b/.github/workflows/roundtrip.yml @@ -25,8 +25,8 @@ jobs: - name: Install Linux development files run: | bash .github/scripts/apt-retry.sh --sudo update - bash .github/scripts/apt-retry.sh --sudo install --yes \ - desktop-file-utils libglib2.0-dev libsecret-1-dev libgtk-4-dev weston + bash .github/scripts/apt-retry.sh --sudo install --yes --no-install-recommends \ + desktop-file-utils libglib2.0-dev libsecret-1-dev libgtk-4-dev weston xwayland - name: Build backend and integration runner shell: bash run: |