Skip to content
Snippets Groups Projects
Commit 07254feb authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

ui: Avoid circularity with (guix gexp).

Fixes a regression introduced in 56b82106 ("guix build: Allow gexps to be
passed to '-e'.")

* guix/ui.scm (%guix-user-module): Wrap in 'delay'.
  (read/eval): Adjust accordingly.
parent 240a2775
No related branches found
No related tags found
No related merge requests found
...@@ -240,11 +240,13 @@ (define (call-with-error-handling thunk) ...@@ -240,11 +240,13 @@ (define (call-with-error-handling thunk)
(define %guix-user-module (define %guix-user-module
;; Module in which user expressions are evaluated. ;; Module in which user expressions are evaluated.
(let ((module (make-module))) ;; Compute lazily to avoid circularity with (guix gexp).
(beautify-user-module! module) (delay
;; Use (guix gexp) so that one can use #~ & co. (let ((module (make-module)))
(module-use! module (resolve-interface '(guix gexp))) (beautify-user-module! module)
module)) ;; Use (guix gexp) so that one can use #~ & co.
(module-use! module (resolve-interface '(guix gexp)))
module)))
(define (read/eval str) (define (read/eval str)
"Read and evaluate STR, raising an error if something goes wrong." "Read and evaluate STR, raising an error if something goes wrong."
...@@ -256,7 +258,7 @@ (define (read/eval str) ...@@ -256,7 +258,7 @@ (define (read/eval str)
str args))))) str args)))))
(catch #t (catch #t
(lambda () (lambda ()
(eval exp %guix-user-module)) (eval exp (force %guix-user-module)))
(lambda args (lambda args
(leave (_ "failed to evaluate expression `~a': ~s~%") (leave (_ "failed to evaluate expression `~a': ~s~%")
exp args))))) exp args)))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment