mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 05:48:07 -05:00
gexp: 'gexp->script' does not emit load-path expression when unnecessary.
This removes two elements from %LOAD-PATH and %LOAD-COMPILED-PATH of the 'guix' command and thus further reduces the number of 'stat' calls it makes. * guix/gexp.scm (load-path-expression): Return #f when MODULES and EXTENSIONS are both empty. (gexp->script): Don't emit anything when SET-LOAD-PATH is #f.
This commit is contained in:
parent
49c35bbb71
commit
efff32452a
1 changed files with 32 additions and 25 deletions
|
@ -1315,7 +1315,10 @@ (define* (load-path-expression modules #:optional (path %load-path)
|
|||
#:key (extensions '()))
|
||||
"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."
|
||||
are searched for in PATH. Return #f when MODULES and EXTENSIONS are empty."
|
||||
(if (and (null? modules) (null? extensions))
|
||||
(with-monad %store-monad
|
||||
(return #f))
|
||||
(mlet %store-monad ((modules (imported-modules modules
|
||||
#:module-path path))
|
||||
(compiled (compiled-modules modules
|
||||
|
@ -1338,7 +1341,7 @@ (define* (load-path-expression modules #:optional (path %load-path)
|
|||
(effective-version)
|
||||
"/site-ccache"))
|
||||
'((ungexp-native-splicing extensions)))
|
||||
%load-compiled-path))))))))
|
||||
%load-compiled-path)))))))))
|
||||
|
||||
(define* (gexp->script name exp
|
||||
#:key (guile (default-guile))
|
||||
|
@ -1362,7 +1365,11 @@ (define* (gexp->script name exp
|
|||
"#!~a/bin/guile --no-auto-compile~%!#~%"
|
||||
(ungexp guile))
|
||||
|
||||
(write '(ungexp set-load-path) port)
|
||||
(ungexp-splicing
|
||||
(if set-load-path
|
||||
(gexp ((write '(ungexp set-load-path) port)))
|
||||
(gexp ())))
|
||||
|
||||
(write '(ungexp exp) port)
|
||||
(chmod port #o555))))
|
||||
#:module-path module-path)))
|
||||
|
|
Loading…
Reference in a new issue