guix build: Nicely report unbound variables with hints.
authorLudovic Courtès <ludo@gnu.org>
Fri, 4 May 2018 13:05:05 +0000 (15:05 +0200)
committerLudovic Courtès <ludo@gnu.org>
Fri, 4 May 2018 13:07:08 +0000 (15:07 +0200)
commit2d2f98efb36db3f003d950a004806234962b4f4d
treeb033067c85c0951a1477dde6405c19d399dba3d1
parent7f2f6a2cb2c4205ec22c2ca80a9c3675b6d7a4ea
guix build: Nicely report unbound variables with hints.

* guix/ui.scm (print-unbound-variable-error): Add "error:" to the
message.
(report-unbound-variable-error): New procedure, with code formerly in
'report-load-error'.
(report-load-error): Use it.
(call-with-unbound-variable-handling): New procedure.
(with-unbound-variable-handling): New macro.
* guix/scripts/build.scm (options->derivations): Wrap body in
'with-unbound-variable-handling'.
* tests/guix-build.sh (GUIX_PACKAGE_PATH): Add test.
guix/scripts/build.scm
guix/ui.scm
tests/guix-build.sh