From c1ba17c8af0a0d5409e84ee7d451b8bb9bbeff20 Mon Sep 17 00:00:00 2001 From: vxtls <187420201+vxtls@users.noreply.github.com> Date: Sun, 12 Apr 2026 23:11:28 -0400 Subject: [PATCH] fix(guix-bootstrap): split x86_64 and i686 bootstrap guile seeds --- steps-guix/guix-1.5.0/pass2.sh | 3 +- .../patches/bootstrap-local-seeds.patch.in | 22 ++++---- steps-guix/improve/guix-1.5.0.sh | 54 ++++++++++++++++--- steps-guix/improve/guix-daemon-and-pull.sh | 3 +- 4 files changed, 65 insertions(+), 17 deletions(-) diff --git a/steps-guix/guix-1.5.0/pass2.sh b/steps-guix/guix-1.5.0/pass2.sh index c5ffb3a6..9349c1e9 100755 --- a/steps-guix/guix-1.5.0/pass2.sh +++ b/steps-guix/guix-1.5.0/pass2.sh @@ -25,7 +25,8 @@ src_prepare() { -e "s|@EXEC_TAR_HASH@|${EXEC_TAR_HASH}|g" \ -e "s|@EXEC_XZ_HASH@|${EXEC_XZ_HASH}|g" \ -e "s|@STATIC_BINARIES_SEED_HASH@|${STATIC_BINARIES_SEED_HASH}|g" \ - -e "s|@GUILE_SEED_HASH@|${GUILE_SEED_HASH}|g" \ + -e "s|@GUILE_I686_SEED_HASH@|${GUILE_I686_SEED_HASH}|g" \ + -e "s|@GUILE_X86_64_SEED_HASH@|${GUILE_X86_64_SEED_HASH}|g" \ -e "s|@MES_MINIMAL_SEED_HASH@|${MES_MINIMAL_SEED_HASH}|g" \ -e "s|@MESCC_TOOLS_SEED_HASH@|${MESCC_TOOLS_SEED_HASH}|g" \ "${patch_template}" > "${rendered_patch}" diff --git a/steps-guix/guix-1.5.0/patches/bootstrap-local-seeds.patch.in b/steps-guix/guix-1.5.0/patches/bootstrap-local-seeds.patch.in index d1a05fca..44e37ed0 100644 --- a/steps-guix/guix-1.5.0/patches/bootstrap-local-seeds.patch.in +++ b/steps-guix/guix-1.5.0/patches/bootstrap-local-seeds.patch.in @@ -36,26 +36,30 @@ ("powerpc64le-linux" (string-append system "/20210106/" program)) ("i586-gnu" (string-append system "/20200326/" program)) ("x86_64-gnu" (string-append system "/20241122/" program)) -@@ -388,15 +385,15 @@ +@@ -387,6 +387,10 @@ + ("powerpc64le-linux" + "/20210106/guile-static-stripped-2.0.14-powerpc64le-linux-gnu.tar.xz") ("riscv64-linux" "/20210725/guile-3.0.2.tar.xz") ++ ("x86_64-linux" ++ "/guile-static-stripped-2.0.9-x86_64-linux.tar.xz") ++ ("i686-linux" ++ "/guile-static-stripped-2.0.9-i686-linux.tar.xz") (_ -- "/20131110/guile-2.0.9.tar.xz")))) -+ "/guile-static-stripped-2.0.9-i686-linux.tar.xz")))) - - (define (bootstrap-guile-hash system) + "/20131110/guile-2.0.9.tar.xz")))) +@@ -394,9 +398,9 @@ "Return the SHA256 hash of the Guile bootstrap tarball for SYSTEM." (match system ("x86_64-linux" - (base32 "1w2p5zyrglzzniqgvyn1b55vprfzhgk8vzbzkkbdgl5248si0yq3")) -+ (base32 "@GUILE_SEED_HASH@")) ++ (base32 "@GUILE_X86_64_SEED_HASH@")) ("i686-linux" - (base32 "0im800m30abgh7msh331pcbjvb4n02smz5cfzf1srv0kpx3csmxp")) -+ (base32 "@GUILE_SEED_HASH@")) ++ (base32 "@GUILE_I686_SEED_HASH@")) ("mips64el-linux" (base32 "0fzp93lvi0hn54acc0fpvhc7bvl0yc853k62l958cihk03q80ilr")) ("armhf-linux" -@@ -625,16 +622,16 @@ +@@ -625,16 +626,16 @@ ("riscv64-linux" "/20210725/static-binaries.tar.xz") (_ @@ -75,7 +79,7 @@ ("armhf-linux" (base32 "0gf0fn2kbpxkjixkmx5f4z6hv6qpmgixl69zgg74dbsfdfj8jdv5")) -@@ -989,11 +1022,15 @@ +@@ -989,11 +1026,15 @@ ;; own packages. (match (%current-system) ((or "i686-linux" "x86_64-linux") diff --git a/steps-guix/improve/guix-1.5.0.sh b/steps-guix/improve/guix-1.5.0.sh index 70b94426..e68bbb80 100755 --- a/steps-guix/improve/guix-1.5.0.sh +++ b/steps-guix/improve/guix-1.5.0.sh @@ -5,6 +5,7 @@ set -e dist="${DISTFILES:-/external/distfiles}" env_out="/tmp/guix-bootstrap-seeds.env" +work="/tmp/guix-bootstrap-seed-variants" required_files=" ${dist}/static-binaries-0-i686-linux.tar.xz @@ -17,6 +18,30 @@ ${dist}/bootstrap-exec-tar-i686-linux ${dist}/bootstrap-exec-xz-i686-linux " +reset_tree_timestamps() { + find "$1" -print0 | xargs -0 touch -h -t 197001010000.00 +} + +make_repro_tar_xz() { + src_dir="$1" + out_file="$2" + tmp_tar="$(mktemp /tmp/guix-seed-tarball.XXXXXX.tar)" + + mkdir -p "$(dirname "${out_file}")" + + reset_tree_timestamps "${src_dir}" + ( + cd "${src_dir}" + tar --sort=name --hard-dereference \ + --numeric-owner --owner=0 --group=0 --mode=go=rX,u+rw \ + -cf "${tmp_tar}" . + ) + touch -t 197001010000.00 "${tmp_tar}" + xz -T1 -c "${tmp_tar}" > "${out_file}" + touch -t 197001010000.00 "${out_file}" + rm -f "${tmp_tar}" +} + for f in ${required_files}; do if [ ! -e "${f}" ]; then echo "Missing required seed artifact: ${f}" >&2 @@ -30,15 +55,29 @@ if [ ! -x /usr/bin/guix-hash-compat ]; then fi # Prepare file layout expected by bootstrap.scm for i686/x86_64. +rm -rf "${work}" mkdir -p "${dist}/i686-linux" "${dist}/x86_64-linux" cp -f "${dist}/static-binaries-0-i686-linux.tar.xz" \ "${dist}/i686-linux/static-binaries-0-i686-linux.tar.xz" cp -f "${dist}/static-binaries-0-i686-linux.tar.xz" \ "${dist}/x86_64-linux/static-binaries-0-i686-linux.tar.xz" -cp -f "${dist}/guile-static-stripped-2.0.9-i686-linux.tar.xz" \ +# Guix interns both x86_64 and i686 bootstrap Guile seeds during its self-build. +# Keep the payload effectively identical but make the archives distinct so they +# do not collapse to the same store item and GC root name. +rm -rf "${work}/i686-linux" +mkdir -p "${work}/i686-linux" +xz -dc "${dist}/guile-static-stripped-2.0.9-i686-linux.tar.xz" | tar -xf - -C "${work}/i686-linux" +printf '%s\n' "i686-linux" > "${work}/i686-linux/i686.txt.planceholder" +make_repro_tar_xz \ + "${work}/i686-linux" \ "${dist}/i686-linux/guile-static-stripped-2.0.9-i686-linux.tar.xz" -cp -f "${dist}/guile-static-stripped-2.0.9-i686-linux.tar.xz" \ - "${dist}/x86_64-linux/guile-static-stripped-2.0.9-i686-linux.tar.xz" +rm -rf "${work}/x86_64-linux" +mkdir -p "${work}/x86_64-linux" +xz -dc "${dist}/guile-static-stripped-2.0.9-i686-linux.tar.xz" | tar -xf - -C "${work}/x86_64-linux" +printf '%s\n' "x86_64-linux" > "${work}/x86_64-linux/x86_64.txt.planceholder" +make_repro_tar_xz \ + "${work}/x86_64-linux" \ + "${dist}/x86_64-linux/guile-static-stripped-2.0.9-x86_64-linux.tar.xz" cp -f "${dist}/bootstrap-exec-bash-i686-linux" \ "${dist}/i686-linux/bootstrap-exec-bash-i686-linux" cp -f "${dist}/bootstrap-exec-mkdir-i686-linux" \ @@ -49,7 +88,8 @@ cp -f "${dist}/bootstrap-exec-xz-i686-linux" \ "${dist}/i686-linux/bootstrap-exec-xz-i686-linux" static_binaries_hash="$(/usr/bin/guix-hash-compat "${dist}/static-binaries-0-i686-linux.tar.xz")" -guile_seed_hash="$(/usr/bin/guix-hash-compat "${dist}/guile-static-stripped-2.0.9-i686-linux.tar.xz")" +guile_seed_i686_hash="$(/usr/bin/guix-hash-compat "${dist}/i686-linux/guile-static-stripped-2.0.9-i686-linux.tar.xz")" +guile_seed_x86_64_hash="$(/usr/bin/guix-hash-compat "${dist}/x86_64-linux/guile-static-stripped-2.0.9-x86_64-linux.tar.xz")" mes_minimal_hash="$(/usr/bin/guix-hash-compat "${dist}/mes-minimal-stripped-0.19-i686-linux.tar.xz")" mescc_tools_hash="$(/usr/bin/guix-hash-compat "${dist}/mescc-tools-static-stripped-0.5.2-i686-linux.tar.xz")" exec_bash_hash="$(/usr/bin/guix-hash-compat -r "${dist}/bootstrap-exec-bash-i686-linux")" @@ -61,8 +101,10 @@ cat > "${env_out}" < "${rendered_patch}"