mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
shepherd: Remove dependency on (guix utils).
Since commit 8ce6f4dc28
, importing this
module in a gexp would pull in (guix config) from the host, thereby
leading to non-reproducible derivations. Users in (gnu services ...) do
not expect that so simply remove the (guix utils) dependency for now.
* gnu/build/shepherd.scm (fork+exec-command/container)[strip-pid]: New
procedure.
Use it instead of 'strip-keyword-arguments'.
This commit is contained in:
parent
ca465a9c84
commit
e6934c0429
1 changed files with 14 additions and 2 deletions
|
@ -21,7 +21,6 @@ (define-module (gnu build shepherd)
|
|||
#:use-module (gnu system file-systems)
|
||||
#:use-module (gnu build linux-container)
|
||||
#:use-module (guix build utils)
|
||||
#:use-module (guix utils)
|
||||
#:use-module (srfi srfi-1)
|
||||
#:use-module (srfi srfi-26)
|
||||
#:use-module (ice-9 match)
|
||||
|
@ -199,11 +198,24 @@ (define* (fork+exec-command/container command
|
|||
"This is a variant of 'fork+exec-command' procedure, that joins the
|
||||
namespaces of process PID beforehand. If there is no support for containers,
|
||||
on Hurd systems for instance, fallback to direct forking."
|
||||
(define (strip-pid args)
|
||||
;; TODO: Replace with 'strip-keyword-arguments' when that no longer pulls
|
||||
;; in (guix config).
|
||||
(let loop ((args args)
|
||||
(result '()))
|
||||
(match args
|
||||
(()
|
||||
(reverse result))
|
||||
((#:pid _ . rest)
|
||||
(loop rest result))
|
||||
((head . rest)
|
||||
(loop rest (cons head result))))))
|
||||
|
||||
(let ((container-support?
|
||||
(file-exists? "/proc/self/ns"))
|
||||
(fork-proc (lambda ()
|
||||
(apply fork+exec-command command
|
||||
(strip-keyword-arguments '(#:pid) args)))))
|
||||
(strip-pid args)))))
|
||||
(if container-support?
|
||||
(container-excursion* pid fork-proc)
|
||||
(fork-proc))))
|
||||
|
|
Loading…
Reference in a new issue