summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-12-29 18:17:21 +0100
committerLudovic Courtès <ludo@gnu.org>2016-12-29 18:22:49 +0100
commit8ecc3c6c447765b1f7c15b980f985d1826f48659 (patch)
tree28dbdf5c13151e211fac64f6667cf676ddbda1ca
parent681a555b837d766848baacbed5750e9d30314709 (diff)
downloadguix-8ecc3c6c447765b1f7c15b980f985d1826f48659.tar.gz
daemon: Allow fixed-output derivation builds with TMPDIR set.
Fixes <http://bugs.gnu.org/25242>.
Reported by Leo Famulari <leo@famulari.name>.
The regression was introduced in 94d92c7796a3dd50c27d532315f7d497ac99f08e.

* nix/libstore/build.cc (DerivationGoal::startBuilder): Set 'useChroot'
as a function 'of isBuiltin(drv)'.
(DerivationGoal::runChild): Use 'useChroot' instead of
'useChroot && !isBuiltin(drv)'.
-rw-r--r--nix/libstore/build.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index e823001788..38048ceebc 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -1680,7 +1680,11 @@ void DerivationGoal::startBuilder()
             % drv.platform % settings.thisSystem % drvPath);
     }
 
-    useChroot = settings.useChroot;
+    /* Note: built-in builders are *not* running in a chroot environment so
+       that we can easily implement them in Guile without having it as a
+       derivation input (they are running under a separate build user,
+       though).  */
+    useChroot = settings.useChroot && !isBuiltin(drv);
 
     /* Construct the environment passed to the builder. */
     env.clear();
@@ -2048,12 +2052,7 @@ void DerivationGoal::runChild()
         commonChildInit(builderOut);
 
 #if CHROOT_ENABLED
-	/* Note: built-in builders are *not* running in a chroot environment
-	   so that we can easily implement them in Guile without having it as
-	   a derivation input (they are running under a separate build user,
-	   though).  */
-
-        if (useChroot && !isBuiltin(drv)) {
+        if (useChroot) {
             /* Initialise the loopback interface. */
             AutoCloseFD fd(socket(PF_INET, SOCK_DGRAM, IPPROTO_IP));
             if (fd == -1) throw SysError("cannot open IP socket");