me
/
guix
Archived
1
0
Fork 0

inferior: Add <inferior> printer.

This avoids printing the whole package table in backtraces and such.

* guix/inferior.scm (write-inferior): New procedure.
<top level>: Call 'set-record-type-printer!'.
master
Ludovic Courtès 2021-03-13 11:56:52 +01:00
parent faf271e96e
commit 2569bd994b
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 9 additions and 0 deletions

View File

@ -120,6 +120,15 @@
(packages inferior-package-promise) ;promise of inferior packages
(table inferior-package-table)) ;promise of vhash
(define (write-inferior inferior port)
(match inferior
(($ <inferior> pid _ _ version)
(format port "#<inferior ~a ~a ~a>"
pid version
(number->string (object-address inferior) 16)))))
(set-record-type-printer! <inferior> write-inferior)
(define* (inferior-pipe directory command error-port)
"Return an input/output pipe on the Guix instance in DIRECTORY. This runs
'DIRECTORY/COMMAND repl' if it exists, or falls back to some other method if