From b7006a7e091d139dae1630a1836083c34d08609b Mon Sep 17 00:00:00 2001 From: Amar Rasineni <52807662+amar-python@users.noreply.github.com> Date: Wed, 4 Nov 2026 22:39:38 +1100 Subject: [PATCH] Fail the offline bundle build when a dependency download fails (#182) build_bundle.sh ran `apt-get download $DEPS ... || true`, so a failed download was ignored. The only check after it covered the four top-level packages, so a bundle missing a dependency still reported success and failed later on the offline VM. - Skip virtual packages (Candidate: (none)) because they have nothing to download. - Download the remaining closure without `|| true`, so set -e stops the build. Verified on Ubuntu 24.04 (apt index reachable from the sandbox): - Real closure, 114 packages: download exit 0, 114 .deb files. - Small list with one real package, one virtual package and one bogus name: the virtual package is skipped and the bogus name exits 100. - Clean small list: exit 0. - Old code with a bogus dependency: exit 0 with no .deb for it. Not run: the full build_bundle.sh (npm, pip, frontend steps). Needs a run on the Ubuntu 24.04 WSL (runbook Phase A). Co-Authored-By: Claude Haiku 5.5 Claude-Session: https://claude.ai/code/session_011T6Wqk7v8qnw9h29hpqnnv --- scripts/offline/build_bundle.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/offline/build_bundle.sh b/scripts/offline/build_bundle.sh index 19edee0..7bec2f7 100755 --- a/scripts/offline/build_bundle.sh +++ b/scripts/offline/build_bundle.sh @@ -40,7 +40,13 @@ PKGS="postgresql-16 postgresql-client-16 python3.12-venv nodejs" # Ubuntu 24.04 already has; apt skips those on install. Prune if size matters. DEPS=$(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts \ --no-breaks --no-replaces --no-enhances $PKGS | grep '^[a-z0-9]' | sort -u) -( cd "$OUT/debs" && apt-get download $DEPS >/dev/null 2>&1 || true ) +# Virtual packages have no candidate and nothing to download, so skip them. Any real +# package that fails to download stops the build; the old `|| true` let a partial bundle pass (#182). +REAL=() +for p in $DEPS; do + apt-cache policy "$p" | grep -q 'Candidate: (none)' || REAL+=("$p") +done +( cd "$OUT/debs" && apt-get download "${REAL[@]}" >/dev/null ) for p in $PKGS; do ls "$OUT/debs/${p}_"*.deb >/dev/null || { echo "missing deb: $p" >&2; exit 1; }; done ( cd "$OUT/debs" && apt-ftparchive packages . > Packages ) # local apt repository index