GNU bug report logs - #32342
[PATCH] Do not store mtime when compressing stdin

Previous Next

Package: gzip;

Reported by: "Bernhard M. Wiedemann" <bwiedemann <at> suse.de>

Date: Wed, 1 Aug 2018 11:53:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Bernhard M. Wiedemann" <bwiedemann <at> suse.de>
To: Paul Eggert <eggert <at> cs.ucla.edu>, 32342 <at> debbugs.gnu.org
Subject: bug#32342: [PATCH] Do not store mtime when compressing stdin
Date: Thu, 2 Aug 2018 10:31:32 +0200
[Message part 1 (text/plain, inline)]
On 2018-08-02 08:47, Paul Eggert wrote:
> Bernhard M. Wiedemann wrote:
>> This allows for reproducible output of
>> echo foo | gzip | md5sum
> 
> gzip -n already does that, so we don't need to change the gzip source
> code to get reproducible output.

I know that it does, but patching hundreds of packages [1] (including
ones still to be created) doing
tar -czf $file
to do instead
tar -c | gzip -n > $file

is a lot more effort than this one-line patch.
It is also worth noting that the first variant works without a shell
involved, so is easier+safer to call from other programs via system(3).

Is there a good reason to want the current time in .gz in this situation?
I found that .bz2 and .xz dont carry it either.

If there is a good reason, we could probably make it so that
echo foo | gzip -N
triggers the old default behaviour again.


Another possible approach would be to use the $SOURCE_DATE_EPOCH
environment variable's value instead of the current time,
as defined in
https://reproducible-builds.org/specs/source-date-epoch/

This would leave the default behaviour as is, but fix reproducible
builds for us, because the variable is set in our package build environment.


I'd just really like to have it reproducible by default.


[1]
https://github.com/performancecopilot/pcp/pull/540
https://github.com/L1L1/cardpeek/pull/97
https://github.com/singularityware/singularity/pull/1083
https://sourceforge.net/p/x3270/code/merge-requests/1/
https://stat.ethz.ch/pipermail/r-devel/2017-April/074165.html

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 6 years and 344 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.