gexp: Correctly handle #$output in 'gexp->approximate-sexp'.
authorMaxime Devos <maximedevos@telenet.be>
Thu, 3 Mar 2022 14:14:22 +0000 (14:14 +0000)
committerLudovic Courtès <ludo@gnu.org>
Sun, 13 Mar 2022 22:20:07 +0000 (23:20 +0100)
commit2e5c3d91fea5b583c541d70b4c318c2f81554d43
treee71a9fa0119d38668047f4e26fff46c813c297df
parent5aec62ee0f69d691c1c1e322029463beb8bfc3cd
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>
guix/gexp.scm
tests/gexp.scm