[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/11: gexp: Add 'imported+compiled-modules'.
From: |
guix-commits |
Subject: |
03/11: gexp: Add 'imported+compiled-modules'. |
Date: |
Sun, 27 Oct 2019 18:13:07 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit f58b45350b0ebfc36a707d9e986f5fe904af3605
Author: Ludovic Courtès <address@hidden>
Date: Sun Oct 27 18:55:44 2019 +0100
gexp: Add 'imported+compiled-modules'.
* guix/gexp.scm (imported+compiled-modules): New procedure.
(lower-gexp): Use it instead of separate calls to 'imported-modules' and
'compiled-modules'.
---
guix/gexp.scm | 45 +++++++++++++++++++++++++++++++--------------
1 file changed, 31 insertions(+), 14 deletions(-)
diff --git a/guix/gexp.scm b/guix/gexp.scm
index 7323277..fa74e80 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -654,6 +654,28 @@ names and file names suitable for the #:allowed-references
argument to
(load-path lowered-gexp-load-path) ;list of store items
(load-compiled-path lowered-gexp-load-compiled-path)) ;list of store items
+(define* (imported+compiled-modules modules system
+ #:key (extensions '())
+ deprecation-warnings guile
+ (module-path %load-path))
+ "Return a pair where the first element is the imported MODULES and the
+second element is the derivation to compile them."
+ (mlet %store-monad ((modules (if (pair? modules)
+ (imported-modules modules
+ #:system system
+ #:module-path
module-path)
+ (return #f)))
+ (compiled (if (pair? modules)
+ (compiled-modules modules
+ #:system system
+ #:module-path module-path
+ #:extensions extensions
+ #:guile guile
+ #:deprecation-warnings
+ deprecation-warnings)
+ (return #f))))
+ (return (cons modules compiled))))
+
(define* (lower-gexp exp
#:key
(module-path %load-path)
@@ -719,20 +741,15 @@ derivations--e.g., code evaluated for its side effects."
(lambda (obj)
(lower-object obj system))
extensions))
- (modules (if (pair? %modules)
- (imported-modules %modules
- #:system system
- #:module-path
module-path)
- (return #f)))
- (compiled (if (pair? %modules)
- (compiled-modules %modules
- #:system system
- #:module-path
module-path
- #:extensions extensions
- #:guile guile
- #:deprecation-warnings
- deprecation-warnings)
- (return #f))))
+ (modules+compiled (imported+compiled-modules
+ %modules system
+ #:extensions extensions
+ #:deprecation-warnings
+ deprecation-warnings
+ #:guile guile
+ #:module-path module-path))
+ (modules -> (car modules+compiled))
+ (compiled -> (cdr modules+compiled)))
(define load-path
(search-path modules exts
(string-append "/share/guile/site/" effective-version)))
- branch master updated (6d18427 -> b13b938), guix-commits, 2019/10/27
- 02/11: derivations: 'build-expression->derivation' caches its module derivations., guix-commits, 2019/10/27
- 01/11: derivations: Introduce 'imported+compiled-modules'., guix-commits, 2019/10/27
- 04/11: store: Allow objects in the cache to be inserted and search for with 'equal?'., guix-commits, 2019/10/27
- 03/11: gexp: Add 'imported+compiled-modules'.,
guix-commits <=
- 10/11: pull: Honor '/etc/guix/channels.scm'., guix-commits, 2019/10/27
- 08/11: gnu: bootstrap: Cache the 'bootstrap-executable' origins., guix-commits, 2019/10/27
- 06/11: derivations: Don't memoize 'derivation->bytevector'., guix-commits, 2019/10/27
- 05/11: gexp: Cache the module to derivation mappings., guix-commits, 2019/10/27
- 11/11: news: Add entry for /etc/guix/channels.scm., guix-commits, 2019/10/27
- 07/11: gnu: bootstrap: 'bootstrap-origin' preserves eq?-ness when no changes are made., guix-commits, 2019/10/27
- 09/11: channels: Refer to 'guile-json-3'., guix-commits, 2019/10/27