[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
21/31: daemon: Do not use clone on the Hurd.
From: |
guix-commits |
Subject: |
21/31: daemon: Do not use clone on the Hurd. |
Date: |
Sun, 15 Mar 2020 14:23:13 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd
in repository guix.
commit f9e0f85bbc9493a1755e7feed097e8c353ba8eef
Author: Manolis Ragkousis <address@hidden>
AuthorDate: Sun Aug 7 17:48:30 2016 +0300
daemon: Do not use clone on the Hurd.
Checking for CLONE_NEWNS is only needed for using tha Linux specific
clone(2),
otherwise we can use fork(2). Using clone on the Hurd needs some work, only
support LINUX for now. See
https://lists.gnu.org/archive/html/guix-devel/2020-03/msg00190.html
* nix/libstore/build.cc (CHROOT_ENABLED): Break into CHROOT_ENABLED
and CLONE_ENABLED.
(DerivationGoal::startBuilder): Replace CHROOT_ENABLED with __linux__.
(DerivationGoal::runChild): Only define pivot_root() if SYS_pivot_root is
defined.
Co-authored-by: Jan Nieuwenhuizen <address@hidden>
---
nix/libstore/build.cc | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index 17e92c6..29266f1 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -52,7 +52,12 @@
#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)
+
+#if defined(SYS_pivot_root)
+#define pivot_root(new_root, put_old) (syscall(SYS_pivot_root,
new_root,put_old))
+#endif
#if CHROOT_ENABLED
#include <sys/socket.h>
@@ -2005,7 +2010,7 @@ void DerivationGoal::startBuilder()
- The UTS namespace ensures that builders see a hostname of
localhost rather than the actual hostname.
*/
-#if CHROOT_ENABLED
+#if __linux__
if (useChroot) {
char stack[32 * 1024];
int flags = CLONE_NEWPID | CLONE_NEWNS | CLONE_NEWIPC | CLONE_NEWUTS |
SIGCHLD;
@@ -2186,10 +2191,8 @@ void DerivationGoal::runChild()
if (mkdir("real-root", 0) == -1)
throw SysError("cannot create real-root directory");
-#define pivot_root(new_root, put_old) (syscall(SYS_pivot_root, new_root,
put_old))
if (pivot_root(".", "real-root") == -1)
throw SysError(format("cannot pivot old root directory onto
'%1%'") % (chrootRootDir + "/real-root"));
-#undef pivot_root
if (chroot(".") == -1)
throw SysError(format("cannot change root directory to '%1%'")
% chrootRootDir);
- 04/31: gnu: glibc: Add and update patches for the Hurd., (continued)
- 04/31: gnu: glibc: Add and update patches for the Hurd., guix-commits, 2020/03/15
- 11/31: gnu: make: Support for the Hurd., guix-commits, 2020/03/15
- 13/31: gnu: commencement: hurd-headers-boot0: Build from tarball., guix-commits, 2020/03/15
- 09/31: gnu: bootstrap: Add support for the Hurd., guix-commits, 2020/03/15
- 19/31: gnu: commencement: glibc-final: Allow gnumach-headers references., guix-commits, 2020/03/15
- 01/31: gnu: flex-2.6.1: Build fix for the Hurd., guix-commits, 2020/03/15
- 05/31: gnu: glibc: Add signal SA_SIGINFO support for the Hurd., guix-commits, 2020/03/15
- 17/31: gnu: commencement: gnumach-headers-boot0: Update to 1.8-116-g28b53508., guix-commits, 2020/03/15
- 08/31: gnu: bootstrap: gcc-static: Use gcc-5., guix-commits, 2020/03/15
- 20/31: gnu: hurd: Update to hurd-headers version: 0.9-91a51672., guix-commits, 2020/03/15
- 21/31: daemon: Do not use clone on the Hurd.,
guix-commits <=
- 23/31: gnu: less: Build fix for the Hurd., guix-commits, 2020/03/15
- 15/31: gnu: commencement: glibc-intermediate: Build fixes for the Hurd., guix-commits, 2020/03/15
- 16/31: gnu: commencement: hurd-source: Update to latest git., guix-commits, 2020/03/15
- 18/31: gnu: commencement: static-bash-for-glibc: Hurd build fix., guix-commits, 2020/03/15
- 22/31: daemon: Avoid kill -1 bug on the Hurd., guix-commits, 2020/03/15
- 24/31: gnu: fontconfig: Build fix for the Hurd., guix-commits, 2020/03/15
- 26/31: gnu: pciutils: Build fixes for the Hurd., guix-commits, 2020/03/15
- 30/31: gnu: shadow: Build fix for the Hurd., guix-commits, 2020/03/15
- 27/31: gnu: shepherd: Build fix for the Hurd., guix-commits, 2020/03/15
- 29/31: gnu: screen: Build fix for the Hurd., guix-commits, 2020/03/15