From 04ef2406be6e411bd567752bf85d597807a87555 Mon Sep 17 00:00:00 2001 From: Robin Candau Date: Thu, 23 Apr 2026 19:42:41 +0200 Subject: [PATCH] Fix usage of Archive repo snapshot We were not patching the correct mirrorlist and therefore the Archive repo snapshot was not honored in the build... Also adding some debug visibility to ease future debug sessions --- scripts/make-dockerfile.sh | 3 +++ scripts/make-rootfs.sh | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/make-dockerfile.sh b/scripts/make-dockerfile.sh index 4def246..afee8a4 100755 --- a/scripts/make-dockerfile.sh +++ b/scripts/make-dockerfile.sh @@ -9,6 +9,9 @@ declare -r DOWNLOAD="$4" declare -r TITLE="$5" declare -rx SOURCE_DATE_EPOCH="$6" +# For eventual debugging purposes +echo "SOURCE_DATE_EPOCH: ${SOURCE_DATE_EPOCH}" + # Do not use these directly in the sed below - it will mask git failures BUILD_VERSION="${BUILD_VERSION:-dev}" CI_COMMIT_SHA="${CI_COMMIT_SHA:-$(git rev-parse HEAD)}" diff --git a/scripts/make-rootfs.sh b/scripts/make-rootfs.sh index 6359de5..1f39f3b 100755 --- a/scripts/make-rootfs.sh +++ b/scripts/make-rootfs.sh @@ -10,6 +10,9 @@ declare -r OUTPUTDIR="$3" declare -r ARCHIVE_SNAPSHOT="$4" declare -rx SOURCE_DATE_EPOCH="$5" +# For eventual debugging purposes +echo -e "ARCHIVE_SNAPSHOT: ${ARCHIVE_SNAPSHOT}\nSOURCE_DATE_EPOCH: ${SOURCE_DATE_EPOCH}" + mkdir -vp "$BUILDDIR/alpm-hooks/usr/share/libalpm/hooks" find /usr/share/libalpm/hooks -exec ln -sf /dev/null "$BUILDDIR/alpm-hooks"{} \; @@ -37,7 +40,7 @@ ln -fs /usr/lib/os-release "$BUILDDIR/etc/os-release" # Use archived repo snapshot from archive.archlinux.org for reproducible builds if [[ "$GROUP" == "repro" ]]; then - sed -i "1iServer = https://archive.archlinux.org/repos/$ARCHIVE_SNAPSHOT/\\\$repo/os/\\\$arch" "$BUILDDIR/etc/pacman.d/mirrorlist" + sed -i "1iServer = https://archive.archlinux.org/repos/$ARCHIVE_SNAPSHOT/\\\$repo/os/\\\$arch" rootfs/etc/pacman.d/mirrorlist repro_pacman_options=( --logfile /dev/null ) @@ -57,8 +60,6 @@ $WRAPPER -- chroot "$BUILDDIR" pacman-key --init $WRAPPER -- chroot "$BUILDDIR" pacman-key --populate if [[ "$GROUP" == "repro" ]]; then - # Remove archived repo snapshot from the mirrorlist - sed -i '1d' "$BUILDDIR/etc/pacman.d/mirrorlist" # Clear pacman keyring for reproducible builds rm -rf "$BUILDDIR"/etc/pacman.d/gnupg/* # Normalize mtimes