From: Robert Sturla Date: Thu, 25 Dec 2025 18:02:13 +0000 (+0000) Subject: compressor_command: Use gzip -n for reproducible output X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F4091%2Fhead;p=thirdparty%2Fmkosi.git compressor_command: Use gzip -n for reproducible output The gzip format includes an MTIME field in its header that stores the modification time of the original file. This causes compressed archives to differ between builds even when the uncompressed content is identical. Add the --no-name flag to gzip which suppresses storing the original filename and timestamp, making gzip output reproducible. Signed-off-by: Robert Sturla --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 976fb399e..deac0ef33 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -2349,7 +2349,7 @@ def compressor_command(context: Context, compression: Compression) -> list[PathS """Returns a command suitable for compressing archives.""" if compression == Compression.gz: - return [gzip_binary(context), f"-{context.config.compress_level}", "--stdout", "-"] + return [gzip_binary(context), "--no-name", f"-{context.config.compress_level}", "--stdout", "-"] elif compression == Compression.xz: return ["xz", "--check=crc32", f"-{context.config.compress_level}", "-T0", "--stdout", "-"] elif compression == Compression.zstd: