daemon: Use deterministic $TMPDIR in chroot.
authorEelco Dolstra <eelco.dolstra@logicblox.com>
Wed, 2 Dec 2015 13:59:07 +0000 (14:59 +0100)
committerLudovic Courtès <ludo@gnu.org>
Wed, 9 Dec 2015 13:29:41 +0000 (14:29 +0100)
commitcb9601029ea164b86bdf997f7160d494c15d344b
treed3ee490acee71bf9199f7f2cd0426faeb2b6c419
parenta8d65643fb21fdf6c46b3d248bda411d970e53ab
daemon: Use deterministic $TMPDIR in chroot.

Rather than using $<host-TMPDIR>/nix-build-<drvname>-<number>, the
temporary directory is now always /tmp/nix-build-<drvname>-0. This
improves bitwise-exact reproducibility for builds that store $TMPDIR
in their build output. (Of course, those should still be fixed...)

* nix/libstore/build.cc (DerivationGoal)[tmpDirInSandbox]: New field.
(DerivationGoal::startBuilder): Initialize 'useChroot' earlier.  Compute
'tmpDirInSandbox', and use it when populating 'dirsInChroot'.
* doc/guix.texi (Build Environment Setup): Document it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
doc/guix.texi
nix/libstore/build.cc