From: Leo Famulari <leo@famulari.name>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 25242@debbugs.gnu.org
Subject: bug#25242: Cannot build source derivations with a custom TMPDIR
Date: Wed, 21 Dec 2016 11:41:49 -0500 [thread overview]
Message-ID: <20161221164149.GA5931@jasmine> (raw)
In-Reply-To: <87r351myej.fsf@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’.
next prev parent reply other threads:[~2016-12-21 16:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-21 8:22 bug#25242: Cannot build source derivations with a custom TMPDIR Leo Famulari
2016-12-21 8:54 ` Leo Famulari
2016-12-21 9:20 ` Ludovic Courtès
2016-12-21 16:41 ` Leo Famulari [this message]
2016-12-21 21:29 ` Ludovic Courtès
2016-12-23 0:11 ` Leo Famulari
2016-12-29 17:23 ` Ludovic Courtès
2016-12-29 17:28 ` Leo Famulari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161221164149.GA5931@jasmine \
--to=leo@famulari.name \
--cc=25242@debbugs.gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.