unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Manolis Ragkousis <manolis837@gmail.com>
To: Guix-devel <Guix-devel@gnu.org>
Subject: [PATCH] daemon: Check for HAVE_CHROOT instead of CHROOT_ENABLED.
Date: Mon, 10 Aug 2015 21:15:10 +0300	[thread overview]
Message-ID: <CAFtzXzPS96w1F1T4mKdHRE2tL-m5b9pab7CLLMccAiBW1iNXEA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 627 bytes --]

Hello everyone,

There is an issue with the chrooted builds on Hurd. In
nix/libstore/build.cc CHROOT_ENABLED
is false because HAVE_UNSHARE && HAVE_SYS_MOUNT_H are not defined on Hurd.

The part that we are interested from build.cc is at line 1768. The
part of the code in that if, is used by the daemon for chrooted
builds. At this specific part of the daemon we only need
 HAVE_CHROOT to be defined, which is true on hurd, for the builds to
work. With this workaround,
things seem to work for me until now. WDYT?

I am sending this patch in order to discuss what could be done and see
if anyone has any better ideas.

Manolis

[-- Attachment #2: 0001-daemon-Check-for-HAVE_CHROOT-instead-of-CHROOT_ENABL.patch --]
[-- Type: text/x-patch, Size: 1084 bytes --]

From 9fd91c191d47d77f4abeee41c6846462badb5762 Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis837@gmail.com>
Date: Mon, 10 Aug 2015 20:56:03 +0300
Subject: [PATCH] daemon: Check for HAVE_CHROOT instead of CHROOT_ENABLED.

* nix/libstore/build.cc (DerivationGoal::startBuilder): Check only if HAVE_CHROOT is
  defined in order to enable chrooted builds on Hurd.
---
 nix/libstore/build.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index a9eedce..db85df3 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -1765,7 +1765,8 @@ void DerivationGoal::startBuilder()
     useChroot = settings.useChroot;
 
     if (useChroot) {
-#if CHROOT_ENABLED
+#if HAVE_CHROOT /* We only need chroot at this time and with this chroot builds are 
+                   enabled on Hurd*/
         /* Create a temporary directory in which we set up the chroot
            environment using bind-mounts.  We put it in the Nix store
            to ensure that we can create hard-links to non-directory
-- 
2.5.0


             reply	other threads:[~2015-08-10 18:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-10 18:15 Manolis Ragkousis [this message]
2015-08-11  0:04 ` [PATCH] daemon: Check for HAVE_CHROOT instead of CHROOT_ENABLED Mark H Weaver
2015-08-18 16:48   ` Ludovic Courtès
2015-08-19 10:10     ` Manolis Ragkousis
2015-08-19 12:22       ` Manolis Ragkousis
2015-08-28  9:34       ` Ludovic Courtès

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

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFtzXzPS96w1F1T4mKdHRE2tL-m5b9pab7CLLMccAiBW1iNXEA@mail.gmail.com \
    --to=manolis837@gmail.com \
    --cc=Guix-devel@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 public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).