avoid encoding mtime in standalone scripts
PATCH 1/1 avoid encoding mtime in standalone scripts
Reproducible builds aid in caching builds and tests. Ideally rebuilding the same source produces identical outputs.
The standalone kvm test scripts contain base64 encoded gzip compressed test binaries. Compression and encoding is done with
"gzip -c FILE | base64" which stores FILE's name and mtime in the compressed output.
Binaries are expanded with
base64 -d << 'BIN_EOF' | zcat > OUTPUT
This expansion pipeline ignores the gzip stored name and mtime.
Use "gzip -n" to avoid saving mtime in the output. This makes the standalone test scripts reproducible. Their contents are the same regardless of when they are built.
--- scripts/mkstandalone.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/mkstandalone.sh +2 -1
@@ -16,7 +16,8 @@ temp_file () echo "cleanup=\"\$$var \$cleanup\"" echo "base64 -d << 'BIN_EOF' | zcat > \$$var || exit 2" - gzip -c "$file" | base64 + # For reproductible builds avoid saving $file mtime with -n + gzip -nc "$file" | base64 echo "BIN_EOF" echo "chmod +x \$$var"
Signature · 1 line
2.39.0.rc0.267.gcb52ba06e7-goog
Quoted 38 lines · Greg Thelen
Reproducible builds aid in caching builds and tests. Ideally rebuilding the same source produces identical outputs.
The standalone kvm test scripts contain base64 encoded gzip compressed test binaries. Compression and encoding is done with
"gzip -c FILE | base64" which stores FILE's name and mtime in the compressed output.Binaries are expanded with
base64 -d << 'BIN_EOF' | zcat > OUTPUT
This expansion pipeline ignores the gzip stored name and mtime.Use "gzip -n" to avoid saving mtime in the output. This makes the standalone test scripts reproducible. Their contents are the same regardless of when they are built.
Signed-off-by Greg Thelen <[email protected]>--- scripts/mkstandalone.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)scripts/mkstandalone.sh +2
-1@@ -16,7 +16,8 @@ temp_file () echo "cleanup=\"\$$var \$cleanup\"" echo "base64 -d << 'BIN_EOF' | zcat > \$$var || exit 2" - gzip -c "$file" | base64 + # For reproductible builds avoid saving $file mtime with -n + gzip -nc "$file" | base64 echo "BIN_EOF" echo "chmod +x \$$var"Signature · 1 line
2.39.0.rc0.267.gcb52ba06e7-goog