summaryrefslogtreecommitdiff
path: root/guix/channels.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-01-07 22:57:34 +0100
committerLudovic Courtès <ludo@gnu.org>2019-01-07 23:50:56 +0100
commit49c35bbb71f80bdd7c01b4d74e08335c3ec5331c (patch)
treefb35f824e710ac3b401b69c02ea5d3b342fa89bb /guix/channels.scm
parent3c85058c0e29fdff5269cff58f43dfbad92259b6 (diff)
self: Move all modules into a single directory.
This halves the number of elements in %LOAD-PATH and %LOAD-COMPILED-PATH and halves the number of 'stat' calls as reported by: env -i $(type -P guix) build -e '(@ (gnu packages base) coreutils)' -nd * guix/self.scm (node-source+compiled, guile-module-union): New procedures. (guix-command): Remove 'compiled-modules' parameter. Remove 'source-directories' and 'object-directories' variables and add 'module-directory'. Change command so that it adds nothing but MODULE-DIRECTORY to %LOAD-PATH and %LOAD-COMPILED-PATH. (whole-package): Remove #:compiled-modules. Assume MODULES contains 'share/guile/site' and 'lib/guile' and adjust code accordingly. (compiled-guix): When PULL-VERSION is 1, use 'node-source+compiled' only. Remove #:compiled-modules argument to 'whole-package'. * guix/channels.scm (whole-package-for-legacy): Add 'module+compiled' and pass it to 'whole-package'.
Diffstat (limited to 'guix/channels.scm')
-rw-r--r--guix/channels.scm24
1 files changed, 22 insertions, 2 deletions
diff --git a/guix/channels.scm b/guix/channels.scm
index 75503bb0ae..6b860f3bd8 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2018 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2018, 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
@@ -335,6 +335,26 @@ modules in the old ~/.config/guix/latest style."
(define packages
(resolve-interface '(gnu packages guile)))
+ (define modules+compiled
+ ;; Since MODULES contains both .scm and .go files at its root, re-bundle
+ ;; it so that it has share/guile/site and lib/guile, which is what
+ ;; 'whole-package' expects.
+ (computed-file (derivation-name modules)
+ (with-imported-modules '((guix build utils))
+ #~(begin
+ (use-modules (guix build utils))
+
+ (define version
+ (effective-version))
+ (define share
+ (string-append #$output "/share/guile/site"))
+ (define lib
+ (string-append #$output "/lib/guile/" version))
+
+ (mkdir-p share) (mkdir-p lib)
+ (symlink #$modules (string-append share "/" version))
+ (symlink #$modules (string-append lib "/site-ccache"))))))
+
(letrec-syntax ((list (syntax-rules (->)
((_)
'())
@@ -346,7 +366,7 @@ modules in the old ~/.config/guix/latest style."
((_ variable rest ...)
(cons (module-ref packages 'variable)
(list rest ...))))))
- (whole-package name modules
+ (whole-package name modules+compiled
;; In the "old style", %SELF-BUILD-FILE would simply return a
;; derivation that builds modules. We have to infer what the