GNU bug report logs - #34638
[PATCH 0/4] Isolated inferiors.

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Sun, 24 Feb 2019 16:13:02 UTC

Severity: normal

Tags: patch

Full log


Message #23 received at 34638 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: 34638 <at> debbugs.gnu.org
Subject: Re: [bug#34638] [PATCH 2/4] linux-container: Add
 'start-child-in-container'.
Date: Thu, 14 Mar 2019 19:17:43 +0100
Hello!

Christopher Baines <mail <at> cbaines.net> skribis:

> This new procedure is similar to open-pipe* in (ice-9 popen), but using
> run-container from (gnu build linux-container).
>
> * gnu/build/linux-container.scm (start-child-in-container): New procedure.

[...]

 +(define* (start-child-in-container command
> +                                   #:key read? write?
> +                                   (root 'temporary)
> +                                   (mounts '())
> +                                   (namespaces %namespaces)
> +                                   (host-uids 1)
> +                                   (extra-environment-variables '()))

We could even call that ‘open-pipe/container’, for clarity.

> +  (define (with-root-directory f)
> +    (if (eq? root 'temporary)
> +        (call-with-temporary-directory f)
> +        (f root)))
> +
> +  ;; (ice-9 popen) internals
> +  (define make-rw-port (@@ (ice-9 popen) make-rw-port))
> +  (define pipe-guardian (@@ (ice-9 popen) pipe-guardian))
> +  (define make-pipe-info (@@ (ice-9 popen) make-pipe-info))

So this is the funky part.  ;-)

What if we did something like:

  (call-with-container mounts
    (lambda ()
      ;; Somehow act as a proxy between the output process
      ;; and the one spawned by ‘open-pipe*’.
      (open-pipe* …)))

?  Would that work?

That’s create an extra process, but if it works, it’s probably safer and
a lesser maintenance burden.

Now, I think that Guile should expose some of the popen internals
somehow so we can do things like you did, but that’s another story.

Ludo’.




This bug report was last modified 5 years and 78 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.