Bug#970874: nix: Embeds different paths when built on a usrmerge system

Vagrant Cascadian vagrant at reproducible-builds.org
Thu Sep 24 20:12:52 BST 2020


Source: nix
Severity: normal
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: usrmerge
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

When built on a system with usrmerge enabled, and a system without
usrmerge usrmerge enabled, A file in the nix-bin package embeds
different paths for bash, bzip2, gzip and tar:

./usr/share/nix/corepkgs/config.nix
Offset 1, 18 lines modified	Offset 1, 18 lines modified
1 	let	1 	let
2 	··fromEnv·=·var:·def:	2 	··fromEnv·=·var:·def:
3 	····let·val·=·builtins.getEnv·var;·in	3 	····let·val·=·builtins.getEnv·var;·in
4 	····if·val·!=·""·then·val·else·def;	4 	····if·val·!=·""·then·val·else·def;
5 	in·rec·{	5 	in·rec·{
6 	··shell·=·"/bin/bash";	6 	··shell·=·"/usr/bin/bash";
7 	··coreutils·=·"/usr/bin:/bin";	7 	··coreutils·=·"/usr/bin:/bin";
8 	··bzip2·=·"/bin/bzip2";	8 	··bzip2·=·"/usr/bin/bzip2";
9 	··gzip·=·"/bin/gzip";	9 	··gzip·=·"/usr/bin/gzip";
10 	··xz·=·"/usr/bin/xz";	10 	··xz·=·"/usr/bin/xz";
11 	··tar·=·"/bin/tar";	11 	··tar·=·"/usr/bin/tar";


I'm not sure if this file is used in a practical way for the installed
package, but if it does, a package built on a usrmerge system will not
correctly run on a non-usrmerge system.

The attached patch hard-codes these to use the compatible paths in /bin
for these binaries, which should be present on both a usrmerge and
non-usrmerge system, resulting in a backwards compatible and
reproducible build.

Another approach might be if this file is not needed during runtime to
exclude it from the package; I'm not familiar enough with nix to know if
that is viable or not.

Thanks for maintaining nix!


live well,
  vagrant
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-patch-to-fix-reproducible-builds-on-usrmerge-sys.patch
Type: text/x-diff
Size: 2423 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/reproducible-bugs/attachments/20200924/2b1a6b17/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/reproducible-bugs/attachments/20200924/2b1a6b17/attachment.sig>


More information about the Reproducible-bugs mailing list