self: Move Guile early in the module search path.

Until now, Guile modules would first be searched for in
MODULE-DIRECTORY, then in each $GUILE_LOAD_PATH entry, and finally in
Guile itself.

* guix/self.scm (guix-command): Make GUILE the second entry in the
%LOAD-PATH and %LOAD-COMPILED-PATH.
This commit is contained in:
Ludovic Courtès 2020-12-07 15:18:20 +01:00
parent fd24754221
commit 459f0d07a1
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -650,16 +650,21 @@ (define module-directory
(program-file "guix-command"
#~(begin
(set! %load-path
(cons (string-append #$module-directory
(append (list (string-append #$module-directory
"/share/guile/site/"
(effective-version))
(string-append #$guile "/share/guile/"
(effective-version)))
%load-path))
(set! %load-compiled-path
(cons (string-append #$module-directory
(append (list (string-append #$module-directory
"/lib/guile/"
(effective-version)
"/site-ccache")
(string-append #$guile "/lib/guile/"
(effective-version)
"/ccache"))
%load-compiled-path))
;; To maximize the chances that locales are set up right