[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/03: daemon: Allow fixed-output derivation builds with TMPDIR set.
From: |
Ludovic Courtès |
Subject: |
03/03: daemon: Allow fixed-output derivation builds with TMPDIR set. |
Date: |
Thu, 29 Dec 2016 17:23:07 +0000 (UTC) |
civodul pushed a commit to branch master
in repository guix.
commit 8ecc3c6c447765b1f7c15b980f985d1826f48659
Author: Ludovic Courtès <address@hidden>
Date: Thu Dec 29 18:17:21 2016 +0100
daemon: Allow fixed-output derivation builds with TMPDIR set.
Fixes <http://bugs.gnu.org/25242>.
Reported by Leo Famulari <address@hidden>.
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)'.
---
nix/libstore/build.cc | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index e823001..38048ce 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");