GNU bug report logs -
#25242
Cannot build source derivations with a custom TMPDIR
Previous Next
Reported by: Leo Famulari <leo <at> famulari.name>
Date: Wed, 21 Dec 2016 08:23:02 UTC
Severity: normal
Done: ludo <at> gnu.org (Ludovic Courtès)
Bug is archived. No further changes may be made.
Full log
Message #25 received at 25242-done <at> debbugs.gnu.org (full text, mbox):
Leo Famulari <leo <at> famulari.name> skribis:
> 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!
Awesome!
> I wonder if I should commit this while Ludo is away?
You could have done it. :-)
I’ve just pushed it as 8ecc3c6c447765b1f7c15b980f985d1826f48659.
Thank you!
Ludo’.
This bug report was last modified 8 years and 146 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.