me
/
guix
Archived
1
0
Fork 0

self: Use default config variable values for derivations.

The value of %localstatedir, %storedir, and %sysconfdir is known to have
no impact on the compilation of the Guix modules.  Thus, explicitly
build those modules against a (guix config) module that uses all the
default values.  That way, a Guix installation that uses different
config values can still benefit from substitutes.

Reported by Ricardo Wurmus.

* guix/self.scm (%default-config-variables): New variable.
(make-config.scm): Add #:config-variables and honor it.
(compiled-guix)[*core-modules*]: Pass #:config-variables to
'make-config.scm'.
Ludovic Courtès 2021-08-09 12:28:17 +02:00
parent 30289f4d46
commit 27f00963d3
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 11 additions and 2 deletions

View File

@ -872,7 +872,9 @@ itself."
;; rebuilt when the version changes, which in turn means we ;; rebuilt when the version changes, which in turn means we
;; can have substitutes for it. ;; can have substitutes for it.
#:extra-modules #:extra-modules
`(((guix config) => ,(make-config.scm))) `(((guix config)
=> ,(make-config.scm
#:config-variables %default-config-variables)))
;; (guix man-db) is needed at build-time by (guix profiles) ;; (guix man-db) is needed at build-time by (guix profiles)
;; but we don't need to compile it; not compiling it allows ;; but we don't need to compile it; not compiling it allows
@ -1084,10 +1086,17 @@ itself."
(variables rest ...)))))) (variables rest ...))))))
(variables %localstatedir %storedir %sysconfdir))) (variables %localstatedir %storedir %sysconfdir)))
(define %default-config-variables
;; Default values of the configuration variables above.
`((%localstatedir . "/var")
(%storedir . "/gnu/store")
(%sysconfdir . "/etc")))
(define* (make-config.scm #:key gzip xz bzip2 (define* (make-config.scm #:key gzip xz bzip2
(package-name "GNU Guix") (package-name "GNU Guix")
(package-version "0") (package-version "0")
(channel-metadata #f) (channel-metadata #f)
(config-variables %config-variables)
(bug-report-address "bug-guix@gnu.org") (bug-report-address "bug-guix@gnu.org")
(home-page-url "https://guix.gnu.org")) (home-page-url "https://guix.gnu.org"))
@ -1117,7 +1126,7 @@ itself."
#$@(map (match-lambda #$@(map (match-lambda
((name . value) ((name . value)
#~(define-public #$name #$value))) #~(define-public #$name #$value)))
%config-variables) config-variables)
(define %store-directory (define %store-directory
(or (and=> (getenv "NIX_STORE_DIR") canonicalize-path) (or (and=> (getenv "NIX_STORE_DIR") canonicalize-path)