Package: gzip
Version: 1.9-2
Severity: normal
Tags: patch
User: m...@linux.it
Usertags: usrmerge

Dear Maintainer,

According to reproducible build tests gzip gets built differently
on a merged-usr system vs a non-merged system.

It turns out that the zgrep script embeds the full path of grep
(as found via AC_PROG_GREP). Since PATH defaults to /usr/bin before
/bin, the first will be used on a usrmerged system where they're
both essentially the same thing, but /usr/bin/grep does not
exist on non-merged systems.

Hypothetically this could be anything found via PATH on the
build system, including /usr/local/bin/... or ~/bin/... etc,
so explicitly setting the path is likely desireable anyhow.

The attached patch uses the GREP environment variable to
explicitly set the path, as documented in the AC_PROG_GREP
documentation.

Regards,
Andreas Henriksson


-- System Information:
Debian Release: buster/sid
  APT prefers testing-debug
  APT policy: (500, 'testing-debug'), (500, 'testing'), (500, 'stable'), (400, 
'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.18.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages gzip depends on:
ii  dpkg   1.19.2
ii  libc6  2.27-8

gzip recommends no packages.

Versions of packages gzip suggests:
ii  less  487-0.1+b1

-- no debconf information
diff -Nru gzip-1.9/debian/changelog gzip-1.9/debian/changelog
--- gzip-1.9/debian/changelog   2018-09-29 18:28:06.000000000 +0200
+++ gzip-1.9/debian/changelog   2018-11-28 14:45:33.000000000 +0100
@@ -1,3 +1,10 @@
+gzip (1.9-2.2) UNRELEASED; urgency=medium
+
+  * Explicitly set GREP to /bin/grep to make build reproducible
+    between merged-usr and non-merged systems. (Closes: #-1)
+
+ -- Andreas Henriksson <andr...@fatal.se>  Wed, 28 Nov 2018 14:45:33 +0100
+
 gzip (1.9-2.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru gzip-1.9/debian/rules gzip-1.9/debian/rules
--- gzip-1.9/debian/rules       2018-09-29 18:24:07.000000000 +0200
+++ gzip-1.9/debian/rules       2018-11-28 14:42:29.000000000 +0100
@@ -66,6 +66,12 @@
 CONFIGURE_ARGS+=       --host=${DEB_HOST_GNU_TYPE}
 endif
 
+# AC_PROG_GREP will look for grep in PATH and thus find
+# /usr/bin/grep before /bin/grep on merged-usr systems.
+# Thus building binaries that won't work on non-merged systems.
+# Explicitly set the path to avoid that.
+export GREP=/bin/grep
+
 reconf-stamp:
        cp -f /usr/share/misc/config.sub build-aux/config.sub
        cp -f /usr/share/misc/config.guess build-aux/config.guess

Reply via email to