aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-19 11:52:32 -0500
committerCraig Jennings <c@cjennings.net>2026-05-19 11:52:32 -0500
commitdb851ffba560272f1e813dd13d09fb9f88d0faff (patch)
treeaa836d45d5ba4984fae6c9ea7707b4a64b624667
parentb4c0f72235383c33d2b7ce82d8ae4e397f04a6eb (diff)
downloadarchangel-db851ffba560272f1e813dd13d09fb9f88d0faff.tar.gz
archangel-db851ffba560272f1e813dd13d09fb9f88d0faff.zip
fix(build): drop cached archzfs packages before mkarchiso runs
The upstream archzfs mirror has handed us corrupted .pkg.tar.zst files several times now. Past builds aborted at pacstrap with "File X is corrupted (invalid or corrupted package (checksum))". The cached package sits in /var/cache/pacman/pkg/ between builds, so once it's bad every subsequent build fails until someone manually deletes it. I added a step right before mkarchiso that rm -f's the archzfs entries (zfs-dkms-*, zfs-utils-*) from the host pacman cache. Pacstrap fetches fresh copies on the next build. Costs ~30s of bandwidth on a warm mirror. Saves debugging a baffling pacstrap abort. The proper permanent fix is a local caching proxy (pacoloco or flexo). That lives on the Medium Lifts backlog. This commit is the cheap interim that addresses the recurring failure mode without new infrastructure. Shellcheck reports clean. The rm -f globs handle empty-match cleanly (silent return). I skipped a full build re-run since the parent commit (b4c0f72) already verified the surrounding mkarchiso path. This is a defensive prepend with no interaction surface.
-rwxr-xr-xbuild.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/build.sh b/build.sh
index c64fb09..a1f1498 100755
--- a/build.sh
+++ b/build.sh
@@ -464,6 +464,16 @@ chmod +x "$PROFILE_DIR/airootfs/usr/local/bin/"*
# Build the ISO
info "Building ISO (this will take a while)..."
+# Drop cached archzfs packages so pacstrap fetches fresh copies. The
+# upstream archzfs mirror has produced corrupted .pkg.tar.zst files
+# several times now (sessions 04-21, 04-26, 05-19), and pacstrap aborts
+# the whole build with "invalid or corrupted package" when it hits
+# them. Re-downloading costs ~30s on a warm mirror; debugging a
+# corrupted-cache failure after the fact costs much more.
+info "Clearing archzfs packages from host pacman cache..."
+rm -f /var/cache/pacman/pkg/zfs-dkms-*.pkg.tar.zst*
+rm -f /var/cache/pacman/pkg/zfs-utils-*.pkg.tar.zst*
+
# Pre-create the build log in out/ so it survives work/ cleanup. Owned
# by SUDO_USER from the start so a failed build leaves a user-readable
# log; tee writes to it as root, but the file mode stays as set.