aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix/gexp.scm14
-rw-r--r--guix/monads.scm9
2 files changed, 16 insertions, 7 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm
index ff4fd3f289..a2ba50d957 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -129,9 +129,8 @@ The other arguments are as for 'derivation'."
(return #f)))
(guile (if guile-for-build
(return guile-for-build)
- (package->derivation
- (@ (gnu packages base) guile-final)
- system))))
+ (package->derivation (default-guile)
+ system))))
(raw-derivation name
(string-append (derivation->output-path guile)
"/bin/guile")
@@ -336,9 +335,14 @@ package/derivation references."
;;; Convenience procedures.
;;;
+(define (default-guile)
+ ;; Lazily resolve 'guile-final'. This module must not refer to (gnu …)
+ ;; modules directly, to avoid circular dependencies, hence this hack.
+ (module-ref (resolve-interface '(gnu packages base))
+ 'guile-final))
+
(define* (gexp->script name exp
- #:key (modules '())
- (guile (@ (gnu packages base) guile-final)))
+ #:key (modules '()) (guile (default-guile)))
"Return an executable script NAME that runs EXP using GUILE with MODULES in
its search path."
(mlet %store-monad ((modules (imported-modules modules))
diff --git a/guix/monads.scm b/guix/monads.scm
index 809aba59b1..ec2b7f8b3b 100644
--- a/guix/monads.scm
+++ b/guix/monads.scm
@@ -414,10 +414,15 @@ input list as a monadic value."
(system (%current-system)))
"Run MVAL, a monadic value in the store monad, in STORE, an open store
connection."
+ (define (default-guile)
+ ;; Lazily resolve 'guile-final'. This module must not refer to (gnu …)
+ ;; modules directly, to avoid circular dependencies, hence this hack.
+ (module-ref (resolve-interface '(gnu packages base))
+ 'guile-final))
+
(parameterize ((%guile-for-build (or guile-for-build
(package-derivation store
- (@ (gnu packages base)
- guile-final)
+ (default-guile)
system)))
(%current-system system))
(mval store)))