~ruther/guix-local

8ecc3c6c447765b1f7c15b980f985d1826f48659 — Ludovic Courtès 9 years ago 681a555
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)'.
1 files changed, 6 insertions(+), 7 deletions(-)

M nix/libstore/build.cc
M nix/libstore/build.cc => nix/libstore/build.cc +6 -7
@@ 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");