[llvm] [Release] Pass -n to gzip so the release tarball is reproducible (PR #216533)
Larry Meadows via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 15 20:58:58 PDT 2026
https://github.com/lfmeadow updated https://github.com/llvm/llvm-project/pull/216533
>From ea1d588a6c0fee288b2b4dab454654615ad90297 Mon Sep 17 00:00:00 2001
From: Larry Meadows <Lawrence.Meadows at amd.com>
Date: Sat, 15 Aug 2026 22:58:48 -0500
Subject: [PATCH] [Release] Pass -n to gzip so the release tarball is
reproducible
test-release.sh -use-gzip packages the release with
tar cf - $Package | gzip -9c > $BuildDir/$Package.tar.gz
GNU gzip writes a zero timestamp into the gzip header when its input is a
pipe, so the tarball is already reproducible there. pigz, which is often
installed in place of gzip, writes the current time instead, and the
tarball then differs from run to run over identical input. Debian's
lintian reports that as package-contains-timestamped-gzip and recommends
-n.
Pass -n at both call sites so the field is zeroed explicitly. It is a
no-op for GNU gzip and busybox gzip, and it makes pigz's output
byte-identical to gzip's.
Co-authored-by: Jonathan Luu <jonatluu at amd.com>
Co-authored-by: Cursor <cursoragent at cursor.com>
---
llvm/utils/release/test-release.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/llvm/utils/release/test-release.sh b/llvm/utils/release/test-release.sh
index 20fbf83ce90a9..3c1d7ef4c2091 100755
--- a/llvm/utils/release/test-release.sh
+++ b/llvm/utils/release/test-release.sh
@@ -369,7 +369,7 @@ function build_with_cmake_cache() {
pushd $BuildDir/Release
mv $InstallDir/usr/local $Package
if [ "$use_gzip" = "yes" ]; then
- tar cf - $Package | gzip -9c > $BuildDir/$Package.tar.gz
+ tar cf - $Package | gzip -9c -n > $BuildDir/$Package.tar.gz
else
tar cf - $Package | xz -9ce -T $NumJobs > $BuildDir/$Package.tar.xz
fi
@@ -613,7 +613,7 @@ function package_release() {
cd $BuildDir/Phase3/Release
mv llvmCore-$Release-$RC.install/usr/local $Package
if [ "$use_gzip" = "yes" ]; then
- tar cf - $Package | gzip -9c > $BuildDir/$Package.tar.gz
+ tar cf - $Package | gzip -9c -n > $BuildDir/$Package.tar.gz
else
tar cf - $Package | xz -9ce -T $NumJobs > $BuildDir/$Package.tar.xz
fi
More information about the llvm-commits
mailing list