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
From 9fd91c191d47d77f4abeee41c6846462badb5762 Mon Sep 17 00:00:00 2001 From: Manolis Ragkousis <manolis...@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