Skip to contentSkip to conversation

Makefile: don't export GZIP environment variable

PATCH New Atharva Lele 2 participants 4 messages Jul 3, 2019 – Jul 14, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Makefile: don't export GZIP environment variable

We export GZIP = -n so that GZIP does not record original name and timestamps. However..

GZIP environment variable is deprecated and soon will not be supported in future GZIP versions. GZIP suggests the use of a wrapper to pass options globally but it might be difficult to implement in Buildroot. For now, we don't export the variable and fix reproducibility issues per package as they show up in Autobuilder.

---
 Makefile | 1 -
 1 file changed, 1 deletion(-)
Makefile +0 -1
index c98a0ed87e..9cce934990 100644
@@ -248,7 +248,6 @@ ifeq ($(BR2_REPRODUCIBLE),y)
 export TZ = UTC
 export LANG = C
 export LC_ALL = C
-export GZIP = -n
 endif
 
 # To put more focus on warnings, be less verbose as default
Signature · 1 line
2.22.0
#1 lore raw

PATCH 2/2 fs/common.mk: do not store original names and timestamps when creating GZIP rootfs

We don't use the GZIP environment variable to store GZIP options, so explicitly add -n argument here to increase reproducibility.

---
 fs/common.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/common.mk +1 -1
index fceb38c5b9..ca46a331d6 100644
@@ -115,7 +115,7 @@ ROOTFS_$(2)_FINAL_RECURSIVE_DEPENDENCIES = $$(sort \
 
 ifeq ($$(BR2_TARGET_ROOTFS_$(2)_GZIP),y)
 ROOTFS_$(2)_COMPRESS_EXT = .gz
-ROOTFS_$(2)_COMPRESS_CMD = gzip -9 -c
+ROOTFS_$(2)_COMPRESS_CMD = gzip -9 -c -n
 endif
 ifeq ($$(BR2_TARGET_ROOTFS_$(2)_BZIP2),y)
 ROOTFS_$(2)_COMPRESS_EXT = .bz2
Signature · 1 line
2.22.0
#2 lore raw

PATCH 2/2 fs/common.mk: do not store original names and timestamps when creating GZIP rootfs

Atharva, All,

On 2019-07-03 22:09 +0530, Atharva Lele spake thusly:

Quoted 2 lines

We don't use the GZIP environment variable to store GZIP options, so explicitly add -n argument here to increase reproducibility.

This patch should come before the previous patch removing 'export GZIP'.

Otherwise:

Regards,
Yann E. MORIN.

Quoted 25 lines
---
 fs/common.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/common.mk +1 -1
index fceb38c5b9..ca46a331d6 100644
@@ -115,7 +115,7 @@ ROOTFS_$(2)_FINAL_RECURSIVE_DEPENDENCIES = $$(sort \
 
 ifeq ($$(BR2_TARGET_ROOTFS_$(2)_GZIP),y)
 ROOTFS_$(2)_COMPRESS_EXT = .gz
-ROOTFS_$(2)_COMPRESS_CMD = gzip -9 -c
+ROOTFS_$(2)_COMPRESS_CMD = gzip -9 -c -n
 endif
 ifeq ($$(BR2_TARGET_ROOTFS_$(2)_BZIP2),y)
 ROOTFS_$(2)_COMPRESS_EXT = .bz2
Signature · 6 lines
2.22.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/2 Makefile: don't export GZIP environment variable

In reply to Atharva Lele

Atharva, All,

On 2019-07-03 22:09 +0530, Atharva Lele spake thusly:

Quoted 9 lines

We export GZIP = -n so that GZIP does not record original name and timestamps. However..

GZIP environment variable is deprecated and soon will not be supported in future GZIP versions. GZIP suggests the use of a wrapper to pass options globally but it might be difficult to implement in Buildroot. For now, we don't export the variable and fix reproducibility issues per package as they show up in Autobuilder.

This patch must be applied after all caller of gzip have been converted to use -n.

So far, we identified only fs/comon.mk that calls gzip without -n, and this is fixed in the following patch.

So, provided the order of these two patches are inversed when applying:

Regards,
Yann E. MORIN.

Quoted 24 lines
---
 Makefile | 1 -
 1 file changed, 1 deletion(-)
Makefile +0 -1
index c98a0ed87e..9cce934990 100644
@@ -248,7 +248,6 @@ ifeq ($(BR2_REPRODUCIBLE),y)
 export TZ = UTC
 export LANG = C
 export LC_ALL = C
-export GZIP = -n
 endif
 
 # To put more focus on warnings, be less verbose as default
Signature · 6 lines
2.22.0

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'