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 94d92c7796
.
* nix/libstore/build.cc (DerivationGoal::startBuilder): Set 'useChroot'
as a function 'of isBuiltin(drv)'.
(DerivationGoal::runChild): Use 'useChroot' instead of
'useChroot && !isBuiltin(drv)'.
master
parent
681a555b83
commit
8ecc3c6c44
|
@ -1680,7 +1680,11 @@ void DerivationGoal::startBuilder()
|
||||||
% drv.platform % settings.thisSystem % drvPath);
|
% 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. */
|
/* Construct the environment passed to the builder. */
|
||||||
env.clear();
|
env.clear();
|
||||||
|
@ -2048,12 +2052,7 @@ void DerivationGoal::runChild()
|
||||||
commonChildInit(builderOut);
|
commonChildInit(builderOut);
|
||||||
|
|
||||||
#if CHROOT_ENABLED
|
#if CHROOT_ENABLED
|
||||||
/* Note: built-in builders are *not* running in a chroot environment
|
if (useChroot) {
|
||||||
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)) {
|
|
||||||
/* Initialise the loopback interface. */
|
/* Initialise the loopback interface. */
|
||||||
AutoCloseFD fd(socket(PF_INET, SOCK_DGRAM, IPPROTO_IP));
|
AutoCloseFD fd(socket(PF_INET, SOCK_DGRAM, IPPROTO_IP));
|
||||||
if (fd == -1) throw SysError("cannot open IP socket");
|
if (fd == -1) throw SysError("cannot open IP socket");
|
||||||
|
|
Reference in New Issue