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: Thu, 22 Dec 2016 19:11:18 -0500 Message-ID: <20161223001118.GA15208@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]:58369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cKDSv-0001Ts-M4 for bug-guix@gnu.org; Thu, 22 Dec 2016 19:12:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cKDSs-0001tk-G6 for bug-guix@gnu.org; Thu, 22 Dec 2016 19:12:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:36548) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cKDSs-0001tX-D9 for bug-guix@gnu.org; Thu, 22 Dec 2016 19:12:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cKDSs-00033Z-2m for bug-guix@gnu.org; Thu, 22 Dec 2016 19:12:02 -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: > 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? > > 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"); Yes, this does fix the problem! I wonder if I should commit this while Ludo is away?