mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
gexp: Correctly handle #$output in 'gexp->approximate-sexp'.
This addresses the following backtrace from "guix lint -c wrapper-inputs hostapd": Backtrace:ostapd@2.10 [wrapper-inputs]... [...] 174:9 3 (gexp->approximate-sexp #<gexp (modify-phases %standard?>) In srfi/srfi-1.scm: 586:17 2 (map1 (#<gexp-output out> #<gexp-input "pkg-config":o?>)) In guix/gexp.scm: 175:16 1 (_ _) In ice-9/boot-9.scm: 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: Throw to key `match-error' with args `("match" "no matching pattern" #<gexp-output out>)'. * guix/gexp.scm (gexp->approximate-sexp): Handle the case where 'reference' is a <gexp-output>,, by returning (*approximate*). * tests/gexp.scm ("gexp->approximate-sexp, outputs"): Test it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
5aec62ee0f
commit
2e5c3d91fe
2 changed files with 7 additions and 1 deletions
|
@ -181,7 +181,8 @@ (define (gexp-like? thing)
|
|||
(#true
|
||||
;; Simply returning 'thing' won't work in some
|
||||
;; situations; see 'write-gexp' below.
|
||||
'(*approximate*))))))
|
||||
'(*approximate*))))
|
||||
(($ <gexp-output>) '(*approximate*))))
|
||||
(gexp-references gexp))))
|
||||
|
||||
(define (write-gexp gexp port)
|
||||
|
|
|
@ -148,6 +148,11 @@ (define defmod 'define-module) ;fool Geiser
|
|||
(null? (gexp-inputs exp))
|
||||
(gexp->sexp* exp))))
|
||||
|
||||
(test-equal "gexp->approximate-sexp, outputs"
|
||||
'(list 'out:foo (*approximate*) 'out:bar (*approximate*))
|
||||
(gexp->approximate-sexp
|
||||
#~(list 'out:foo #$output:foo 'out:bar #$output:bar)))
|
||||
|
||||
(test-equal "unquote"
|
||||
'(display `(foo ,(+ 2 3)))
|
||||
(let ((exp (gexp (display `(foo ,(+ 2 3))))))
|
||||
|
|
Loading…
Reference in a new issue