Hi! Manolis Ragkousis <manolis...@gmail.com> skribis:
> From aea4bf23b699b7ef5d7007b81f296b77324d5b6c Mon Sep 17 00:00:00 2001 > From: Manolis Ragkousis <manolis...@gmail.com> > Date: Sun, 7 Aug 2016 17:48:30 +0300 > Subject: [PATCH] daemon: Break CHROOT_ENABLED into smaller macros. > > We need to check for CLONE_NEWNS only when we want to use the > Linux specific clone(). Otherwise we use fork(). Also we define > pivot_root() only if SYS_pivot_root is defined. Nipick: it’s enough to write 'clone', without parentheses (info "(standards) GNU Manuals"). > * nix/libstore/build.cc (CHROOT_ENABLED): Break into CHROOT_ENABLED > and CLONE_ENABLED. Define pivot_root() only if SYS_pivot_root is defined. > (DerivationGoal::startBuilder): Replace CHROOT_ENABLED with CLONE_ENABLED. [...] > --- a/nix/libstore/build.cc > +++ b/nix/libstore/build.cc > @@ -51,7 +51,12 @@ > #include <linux/fs.h> > #endif > > -#define CHROOT_ENABLED HAVE_CHROOT && HAVE_SYS_MOUNT_H && defined(MS_BIND) > && defined(MS_PRIVATE) && defined(CLONE_NEWNS) && defined(SYS_pivot_root) > +#define CHROOT_ENABLED HAVE_CHROOT && HAVE_SYS_MOUNT_H && defined(MS_BIND) > && defined(MS_PRIVATE) > +#define CLONE_ENABLED defined(CLONE_NEWNS) This a misleading name, and I think it’s best to directly use #ifdef CLONE_NEWNS. > +#if defined(SYS_pivot_root) > +#define pivot_root(new_root, put_old) (syscall(SYS_pivot_root, > new_root,put_old)) ^ Insert space here. > - The UTS namespace ensures that builders see a hostname of > localhost rather than the actual hostname. > */ > -#if CHROOT_ENABLED > +#if CLONE_ENABLED #ifdef CLONE_NEWNS. Could you send an updated patch? Thank you for being patient enough! Ludo’.