diff mbox

[v2,03/15] reproducible: add '-n' to gzip invocations

Message ID 1479460224-6119-4-git-send-email-jezz@sysmic.org
State Superseded
Headers show

Commit Message

Jérôme Pouiller Nov. 18, 2016, 9:10 a.m. UTC
Default invocation to gzip include timestamp in output file. This feature is
incompatible with BR2_REPRODUCIBLE. It is possible to disable it with '-n'.

The environment variable GZIP can hold a set of default options for gzip. So
instead to find all gzip invocation in build process, we just export 'GZIP=-n'.

Notice bzip2, lzma and xz are impacted by this problem. On the other hand, lzop
include timestamp and does not provide any way to disable it.

This work was sponsored by `BA Robotic Systems'.

Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

Comments

Thomas Petazzoni Nov. 18, 2016, 11:38 a.m. UTC | #1
Hello,

On Fri, 18 Nov 2016 10:10:12 +0100, Jérôme Pouiller wrote:
> Default invocation to gzip include timestamp in output file. This feature is
> incompatible with BR2_REPRODUCIBLE. It is possible to disable it with '-n'.
> 
> The environment variable GZIP can hold a set of default options for gzip. So
> instead to find all gzip invocation in build process, we just export 'GZIP=-n'.
> 
> Notice bzip2, lzma and xz are impacted by this problem. On the other hand, lzop
> include timestamp and does not provide any way to disable it.
> 
> This work was sponsored by `BA Robotic Systems'.
> 
> Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>

Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

If nobody complains about this patch, I'm going to apply it to the next
branch soon.

Thomas
Arnout Vandecappelle Nov. 19, 2016, 9:02 a.m. UTC | #2
On 18-11-16 10:10, Jérôme Pouiller wrote:
> Default invocation to gzip include timestamp in output file. This feature is
> incompatible with BR2_REPRODUCIBLE. It is possible to disable it with '-n'.
> 
> The environment variable GZIP can hold a set of default options for gzip. So
> instead to find all gzip invocation in build process, we just export 'GZIP=-n'.
> 
> Notice bzip2, lzma and xz are impacted by this problem. On the other hand, lzop

 Unless I'm very mistaken, they are NOT impacted by this problem.

> include timestamp and does not provide any way to disable it.
 ^ does include a timestamp and does not...

> 
> This work was sponsored by `BA Robotic Systems'.
> 
> Signed-off-by: Jérôme Pouiller <jezz@sysmic.org>
> ---
>  Makefile | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Makefile b/Makefile
> index 17e49e4..c21ba4a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -249,6 +249,7 @@ ifeq ($(BR2_REPRODUCIBLE),y)
>  export TZ=UTC
>  export LANG=C
>  export LC_ALL=C
> +export GZIP=-n
>  export SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH)

 In this whole hunk, there are spaces missing:

export LC_ALL = C
export GZIP = -n
...

You only need to fix the ones you add of course.

 All of the above can be fixed up while applying, so:

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

 Regards,
 Arnout

>  SOURCE_DATE_GIT = $(shell GIT_DIR=$(TOPDIR)/.git $(GIT) log -1 --format=%at)
>  SOURCE_DATE_CHANGES = $(shell date -d `echo $(BR2_VERSION) | sed 's/^\(....\)\.\(..\).*/\1-\2-01T23:59:59/'` +%s)
>
Jérôme Pouiller Nov. 19, 2016, 1:49 p.m. UTC | #3
Hello,

On Saturday 19 November 2016 10:02:46 Arnout Vandecappelle wrote:
> 
> On 18-11-16 10:10, Jérôme Pouiller wrote:
> > Default invocation to gzip include timestamp in output file. This feature is
> > incompatible with BR2_REPRODUCIBLE. It is possible to disable it with '-n'.
> > 
> > The environment variable GZIP can hold a set of default options for gzip. So
> > instead to find all gzip invocation in build process, we just export 'GZIP=-n'.
> > 
> > Notice bzip2, lzma and xz are impacted by this problem. On the other hand, lzop
> 
>  Unless I'm very mistaken, they are NOT impacted by this problem.

Sure!

BR,
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 17e49e4..c21ba4a 100644
--- a/Makefile
+++ b/Makefile
@@ -249,6 +249,7 @@  ifeq ($(BR2_REPRODUCIBLE),y)
 export TZ=UTC
 export LANG=C
 export LC_ALL=C
+export GZIP=-n
 export SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH)
 SOURCE_DATE_GIT = $(shell GIT_DIR=$(TOPDIR)/.git $(GIT) log -1 --format=%at)
 SOURCE_DATE_CHANGES = $(shell date -d `echo $(BR2_VERSION) | sed 's/^\(....\)\.\(..\).*/\1-\2-01T23:59:59/'` +%s)