summaryrefslogtreecommitdiff
path: root/guix/gexp.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-03-24 22:40:31 +0100
committerLudovic Courtès <ludo@gnu.org>2021-03-30 22:48:45 +0200
commitb18e83b10dd902d79be471c502c077d4b6795895 (patch)
tree5e822f1694fb70f8a483546dcc3c7312ee5462ce /guix/gexp.scm
parent4d711863ac442fb57970da5a91ec8a9c4737eada (diff)
gexp: Add #:guile parameter to 'load-path-expression'.
* guix/gexp.scm (load-path-expression): Add #:guile parameter and honor it.
Diffstat (limited to 'guix/gexp.scm')
-rw-r--r--guix/gexp.scm25
1 files changed, 15 insertions, 10 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm
index c826525426..3e25dfcaa1 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1754,21 +1754,26 @@ TARGET, a GNU triplet."
'guile-3.0))
(define* (load-path-expression modules #:optional (path %load-path)
- #:key (extensions '()) system target)
+ #:key (extensions '()) system target
+ (guile (default-guile)))
"Return as a monadic value a gexp that sets '%load-path' and
'%load-compiled-path' to point to MODULES, a list of module names. MODULES
-are searched for in PATH. Return #f when MODULES and EXTENSIONS are empty."
+are searched for in PATH. Return #f when MODULES and EXTENSIONS are empty.
+Assume MODULES are compiled with GUILE."
(if (and (null? modules) (null? extensions))
(with-monad %store-monad
(return #f))
- (mlet %store-monad ((modules (imported-modules modules
- #:module-path path
- #:system system))
- (compiled (compiled-modules modules
- #:extensions extensions
- #:module-path path
- #:system system
- #:target target)))
+ (mlet* %store-monad ((guile (lower-object guile system #:target #f))
+ (compiled (compiled-modules modules
+ #:guile guile
+ #:extensions extensions
+ #:module-path path
+ #:system system
+ #:target target))
+ (modules (imported-modules modules
+ #:guile guile
+ #:module-path path
+ #:system system)))
(return
(gexp (eval-when (expand load eval)
;; Augment the load paths and delete duplicates. Do that