From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Famulari Subject: bug#25242: Cannot build source derivations with a custom TMPDIR Date: Wed, 21 Dec 2016 11:41:49 -0500 Message-ID: <20161221164149.GA5931@jasmine> References: <20161221082240.GA30326@jasmine> <20161221085421.GA32042@jasmine> <87r351myej.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJjxt-0004Il-2K for bug-guix@gnu.org; Wed, 21 Dec 2016 11:42:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJjxp-0006b4-VZ for bug-guix@gnu.org; Wed, 21 Dec 2016 11:42:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:35024) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cJjxp-0006ay-SS for bug-guix@gnu.org; Wed, 21 Dec 2016 11:42:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cJjxp-00075d-JV for bug-guix@gnu.org; Wed, 21 Dec 2016 11:42:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: Content-Disposition: inline In-Reply-To: <87r351myej.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 25242@debbugs.gnu.org On Wed, Dec 21, 2016 at 10:20:20AM +0100, Ludovic Courtès wrote: > Good catch! > > AFAICS the flaw is that there’s one place where I wrote: > > if (useChroot && !isBuiltin(drv)) > > while several other places just do something like: > > if (useChroot) > > Could the patch below solve the problem? I'm not sure how to test patches to the daemon. Does it require creating a new guix-devel snapshot? > 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"); > > Thanks! > > Ludo’.