aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-02-24 13:39:52 +0000
committerChristopher Baines <mail@cbaines.net>2020-03-28 09:36:03 +0000
commit30fdd4a8ad4ed4a076317af6329eb31a150c15bb (patch)
treec9b63939e15f3969605f85271f2a07a97c3c173a
parenta0801652dc649cd8e688a3d5cadb9e0d49e5cd83 (diff)
downloadguix-30fdd4a8ad4ed4a076317af6329eb31a150c15bb.tar
guix-30fdd4a8ad4ed4a076317af6329eb31a150c15bb.tar.gz
inferior: Add a shared-directory field to <inferior>
-rw-r--r--guix/inferior.scm25
1 files changed, 14 insertions, 11 deletions
diff --git a/guix/inferior.scm b/guix/inferior.scm
index c9a5ee5129..fc348c427a 100644
--- a/guix/inferior.scm
+++ b/guix/inferior.scm
@@ -108,14 +108,15 @@
;; Inferior Guix process.
(define-record-type <inferior>
- (inferior pid socket close version packages table)
+ (inferior pid socket close shared-directory version packages table)
inferior?
- (pid inferior-pid)
- (socket inferior-socket)
- (close inferior-close-socket) ;procedure
- (version inferior-version) ;REPL protocol version
- (packages inferior-package-promise) ;promise of inferior packages
- (table inferior-package-table)) ;promise of vhash
+ (pid inferior-pid)
+ (socket inferior-socket)
+ (close inferior-close-socket) ;procedure
+ (shared-directory inferior-shared-directory)
+ (version inferior-version) ;REPL protocol version
+ (packages inferior-package-promise) ;promise of inferior packages
+ (table inferior-package-table)) ;promise of vhash
(define* (inferior-pipe directory command error-port)
"Return an input/output pipe on the Guix instance in DIRECTORY. This runs
@@ -149,7 +150,7 @@ it's an old Guix."
((@ (guix repl) machine-repl))))))))
pipe)))
-(define* (port->inferior pipe #:optional (close close-port))
+(define* (port->inferior pipe shared-directory #:optional (close close-port))
"Given PIPE, an input/output port, return an inferior that talks over PIPE.
PIPE is closed with CLOSE when 'close-inferior' is called on the returned
inferior."
@@ -157,7 +158,8 @@ inferior."
(match (read pipe)
(('repl-version 0 rest ...)
- (letrec ((result (inferior 'pipe pipe close (cons 0 rest)
+ (letrec ((result (inferior 'pipe pipe close shared-directory
+ (cons 0 rest)
(delay (%inferior-packages result))
(delay (%inferior-package-table result)))))
@@ -187,7 +189,7 @@ equivalent. Return #f if the inferior could not be launched."
(define pipe
(inferior-pipe directory command error-port))
- (port->inferior pipe close-pipe))
+ (port->inferior pipe #f close-pipe))
(define (close-inferior inferior)
"Close INFERIOR."
@@ -560,7 +562,8 @@ thus be the code of a one-argument procedure that accepts a store."
(&store-protocol-error (message message)
(status 1)))))
(('result result)
- result))))))
+ result))))
+ #:base-directory (inferior-shared-directory inferior)))
(define* (inferior-package-derivation store package
#:optional