From b13d6cd0815e1e8f9fd88c621a39452cf7f16b94 Mon Sep 17 00:00:00 2001 From: lotherk Date: Sun, 22 Nov 2026 16:33:54 +0000 Subject: [PATCH] mcde-dist: archive the tree, not the commit git archive COMMIT writes "52 comment=" as a pax_global_header into the tar, 38 bytes that change with every commit. Two commits with the same source tree therefore gave different archives, and a rebuild from a cleared DISTDIR produced a checksum pkgsrc refuses against the distinfo in the tree: 4fead8a3 (the merge) 67,122,036 bytes, BLAKE2s bb9d08d3... c6441410 (+ pkgsrc/distinfo) 67,122,047 bytes, BLAKE2s ecad6283... The .key check hid it: the key hashes ls-tree, which does not see the commit id, so the tool said "archive unchanged" and never rebuilt. The archive now comes from SRCREV^{tree}, the object that holds exactly what goes into the package and carries no header. Measured 2026-11-22 on the build host: both commits give 67,121,814 bytes, BLAKE2s dd809aaa06af65128886c0741088174178a9dabb76cbb3a813da77d8557c04b7, byte-identical across two runs with distfiles/ emptied in between. ext-dist.sh is not affected: it archives REV:ext/src/NAME, a path, and git writes no header for those (2,099,200 bytes twice, no pax_global_header). --- tools/mcde-dist.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/mcde-dist.sh b/tools/mcde-dist.sh index 4f208acc06..6e0379541c 100755 --- a/tools/mcde-dist.sh +++ b/tools/mcde-dist.sh @@ -125,7 +125,7 @@ else # change. -6, not -9: 6.0 s instead of 15.7 s for 0.9 % more bytes # (67069914 against 66472043, measured 2026-11-17). git -C "$SUB" archive --format=tar --mtime="@$MTIME" --prefix="$NAME/" \ - "$SRCREV" ':(exclude)pkgsrc' ':(exclude)pkgsrc-*' > "$OUT.tar.tmp" + "$SRCREV^{tree}" ':(exclude)pkgsrc' ':(exclude)pkgsrc-*' > "$OUT.tar.tmp" gzip -n -6 < "$OUT.tar.tmp" > "$OUT.tmp" rm -f "$OUT.tar.tmp" mv "$OUT.tmp" "$OUT"