mcde-dist: archive the tree, not the commit
git archive COMMIT writes "52 comment=<commit>" 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).
This commit is contained in:
1 parent
5fe3281496
commit
b13d6cd081
1 file changed
+1
-1
+1
-1
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user