From a3344c249b448e4349987729f8727120e2f19f49 Mon Sep 17 00:00:00 2001 From: Josh Knapp Date: Sun, 4 Oct 2026 18:49:25 -0700 Subject: [PATCH] fix(ci): run apt non-interactively so needrestart can't hang a runner The v0.1.2 Linux release job sat for 15+ minutes on a self-hosted Debian runner: after apt-get install, needrestart prompted for which daemons to restart and waited on a terminal CI does not have. Co-Authored-By: Claude Opus 5.5 (1M context) --- .gitea/scripts/linux-deps.sh | 12 ++++++++++-- .gitea/workflows/release.yml | 3 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.gitea/scripts/linux-deps.sh b/.gitea/scripts/linux-deps.sh index 26da8ae..815b69d 100755 --- a/.gitea/scripts/linux-deps.sh +++ b/.gitea/scripts/linux-deps.sh @@ -3,5 +3,13 @@ # both need the exact same Linux build dependencies. Edit once, here. set -euo pipefail -sudo apt-get update -qq -sudo apt-get install -y -qq cmake ninja-build libobs-dev libcurl4-openssl-dev +# Non-interactive, or a self-hosted Debian runner hangs forever: after an +# install, needrestart asks which daemons to restart ("1. postfix.service +# 2. none of the above") and waits on a terminal CI does not have. That +# stalled the v0.1.2 Linux release job on 2026-10-05. NEEDRESTART_MODE=a +# answers it; DEBIAN_FRONTEND covers debconf prompts. Passed through sudo +# explicitly, since sudo drops the caller's environment by default. +APT=(sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get) + +"${APT[@]}" update -qq +"${APT[@]}" install -y -qq cmake ninja-build libobs-dev libcurl4-openssl-dev diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 0ac86d6..e4f3ee1 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -41,7 +41,8 @@ jobs: # zip is not guaranteed present on a minimal self-hosted runner # image (unlike GitHub-hosted ubuntu-24.04, which build.yml's # deps script doesn't need to care about). - command -v zip >/dev/null || sudo apt-get install -y -qq zip + # Non-interactive for the same reason as .gitea/scripts/linux-deps.sh. + command -v zip >/dev/null || sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get install -y -qq zip out="streamer-tools-camera-${GITEA_REF_NAME}-linux-x64.zip" root="$(pwd)"