mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 13:28:12 -05:00
ui: Avoid circularity with (guix gexp).
Fixes a regression introduced in 56b8210
("guix build: Allow gexps to be
passed to '-e'.")
* guix/ui.scm (%guix-user-module): Wrap in 'delay'.
(read/eval): Adjust accordingly.
This commit is contained in:
parent
240a2775de
commit
07254feb24
1 changed files with 8 additions and 6 deletions
14
guix/ui.scm
14
guix/ui.scm
|
@ -240,11 +240,13 @@ (define (call-with-error-handling thunk)
|
|||
|
||||
(define %guix-user-module
|
||||
;; Module in which user expressions are evaluated.
|
||||
(let ((module (make-module)))
|
||||
(beautify-user-module! module)
|
||||
;; Use (guix gexp) so that one can use #~ & co.
|
||||
(module-use! module (resolve-interface '(guix gexp)))
|
||||
module))
|
||||
;; Compute lazily to avoid circularity with (guix gexp).
|
||||
(delay
|
||||
(let ((module (make-module)))
|
||||
(beautify-user-module! module)
|
||||
;; Use (guix gexp) so that one can use #~ & co.
|
||||
(module-use! module (resolve-interface '(guix gexp)))
|
||||
module)))
|
||||
|
||||
(define (read/eval str)
|
||||
"Read and evaluate STR, raising an error if something goes wrong."
|
||||
|
@ -256,7 +258,7 @@ (define (read/eval str)
|
|||
str args)))))
|
||||
(catch #t
|
||||
(lambda ()
|
||||
(eval exp %guix-user-module))
|
||||
(eval exp (force %guix-user-module)))
|
||||
(lambda args
|
||||
(leave (_ "failed to evaluate expression `~a': ~s~%")
|
||||
exp args)))))
|
||||
|
|
Loading…
Reference in a new issue