Skip to content

Commit 50b4a73

Browse files
authored
Stopped apt-get update being the gate it was never meant to be (#7)
A release build went red because Google's Chrome apt repository served a Packages.gz that did not match its own Release file -- their CDN caught mid-publish, the index eight hours older than the manifest describing it. apt-get update fails if ANY configured repository serves a bad index, so install.sh failed three attempts running, and nothing was built. Verified as theirs rather than ours, from a second machine: the Release file asks for 233e56de and the Packages.gz they serve hashes to bc1428ab, which are the two hashes in the failing log. Not a runner glitch and not a network blip; retrying gets the same answer until they republish. Nothing in this project installs a browser. The runner image happens to carry that repository and Microsoft's, and one of them being broken is now enough to stop a build that needs neither. SO THE UPDATE WARNS AND THE INSTALL IS THE GATE. Nothing is weakened by that. apt-get install still fails hard on a package it cannot find, so an archive that is genuinely unreachable still stops the script -- one step later, and naming the package it could not get, which is a better diagnostic than a hash mismatch in a repository nobody asked for. THE OBVIOUS ALTERNATIVE IS WORSE AND IS NOT TAKEN. Disabling third-party sources before updating would make the update strict again, and this script also runs on a contributor's own machine, where silently rewriting their apt configuration to suit our CI would be a considerably worse thing to do than tolerating a stale index for a repository we do not read. Verified in both directions: a failing update warns and execution continues past it, and a genuine command failure still aborts under set -e. Assisted-by: Claude Code (Opus 5) <noreply@anthropic.com>
1 parent 667969d commit 50b4a73

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

scripts/install.sh

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,31 @@ retry() {
6464
return 1
6565
}
6666

67-
retry sudo "${TIMEOUT[@]}" apt-get "${APT_OPTIONS[@]}" update
67+
# THE UPDATE IS NOT THE GATE, AND IT MUST NOT BE. apt-get update fails if ANY
68+
# configured repository serves a bad index, including ones this project does
69+
# not use. On a GitHub runner the image carries Google's and Microsoft's
70+
# repositories, and a Hash Sum mismatch from Google's -- their CDN caught
71+
# mid-publish, index and Release file eight hours apart -- failed this script
72+
# three attempts running and turned a release build red over a browser nobody
73+
# was installing.
74+
#
75+
# The alternative of disabling third-party sources before updating is wrong
76+
# here: this script also runs on a contributor's own machine, where silently
77+
# rewriting their apt configuration would be a far worse thing to do than
78+
# tolerating a stale index.
79+
#
80+
# So a failed update WARNS and the install below is the gate. Nothing is
81+
# weakened by that: apt-get install still fails hard on a package it cannot
82+
# find, so an archive that is genuinely unreachable still stops the script --
83+
# one step later, and saying which package it could not get.
84+
if ! retry sudo "${TIMEOUT[@]}" apt-get "${APT_OPTIONS[@]}" update; then
85+
echo ""
86+
echo "install.sh: apt-get update did not fully succeed."
87+
echo "install.sh: continuing, because a repository this project does not"
88+
echo "install.sh: use can fail an update. The install below is the real"
89+
echo "install.sh: gate and fails if any package needed is unavailable."
90+
echo ""
91+
fi
6892
# gcc-14 and g++-14 EXPLICITLY, alongside build-essential.
6993
#
7094
# build-essential on ubuntu-24.04 is GCC 13, and GCC 14 is the compiler the

0 commit comments

Comments
 (0)