summaryrefslogtreecommitdiff
path: root/guix/self.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-08-27 22:17:12 +0200
committerLudovic Courtès <ludo@gnu.org>2018-08-27 23:22:17 +0200
commitf2d0a2cf5c905abf816bef5d69364d28af5144ed (patch)
tree6371eab1751997018be5d5b93b9065cf2d793a5f /guix/self.scm
parent0de33cb364a75c15d3ffad84f980e629d8753d60 (diff)
downloadgnu-guix-f2d0a2cf5c905abf816bef5d69364d28af5144ed.tar
gnu-guix-f2d0a2cf5c905abf816bef5d69364d28af5144ed.tar.gz
self: Shrink the module search path of the 'guix' command.
Previously we'd have lots of useless entries on the search paths, such as libtasn1, libidn2, zlib, gmp, etc. because they are propagated by gnutls. * guix/self.scm (guix-command)[source-directories, object-directories]: New variables. Use them in the body of "guix-command". Filter their items with 'file-exists?'.
Diffstat (limited to 'guix/self.scm')
-rw-r--r--guix/self.scm24
1 files changed, 14 insertions, 10 deletions
diff --git a/guix/self.scm b/guix/self.scm
index 5ad644b1df..90649db17f 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -367,22 +367,26 @@ DOMAIN, a gettext domain."
guile (guile-version (effective-version)))
"Return the 'guix' command such that it adds MODULES and DEPENDENCIES in its
load path."
+ (define source-directories
+ (map (lambda (package)
+ (file-append package "/share/guile/site/"
+ guile-version))
+ dependencies))
+
+ (define object-directories
+ (map (lambda (package)
+ (file-append package "/lib/guile/"
+ guile-version "/site-ccache"))
+ dependencies))
+
(program-file "guix-command"
#~(begin
(set! %load-path
- (append '#$(map (lambda (package)
- (file-append package
- "/share/guile/site/"
- guile-version))
- dependencies)
+ (append (filter file-exists? '#$source-directories)
%load-path))
(set! %load-compiled-path
- (append '#$(map (lambda (package)
- (file-append package "/lib/guile/"
- guile-version
- "/site-ccache"))
- dependencies)
+ (append (filter file-exists? '#$object-directories)
%load-compiled-path))
(set! %load-path (cons #$modules %load-path))