channels: Record 'guix' channel metadata in (guix config).

Partially fixes <https://bugs.gnu.org/45896>.

* guix/config.scm.in (%channel-metadata): New variable.
* guix/describe.scm (channel-metadata): Use it.
(current-channels): New procedure.
(current-profile-entries): Clarify docstring.
* guix/self.scm (compiled-guix): Add #:channel-metadata and pass it to
'make-config.scm'.
(make-config.scm): Add #:channel-metadata and define '%channel-metadata'
in the generated file.
(guix-derivation): Add #:channel-metadata and pass it to 'compiled-guix'.
* guix/channels.scm (build-from-source): Replace 'name', 'source', and
'commit' parameters with 'instance'.  Pass #:channel-metadata to BUILD.
(build-channel-instance): Adjust accordingly.
* build-aux/build-self.scm (build-program): Add #:channel-metadata
and pass it to 'guix-derivation'.
(build): Add #:channel-metadata and pass it to 'build-program'.
* guix/scripts/describe.scm (display-profile-info): Add optional
'channels' parameter.  Pass it to 'display-profile-content'.
(display-profile-content): Add optional 'channels' parameter and honor
it.  Iterate on CHANNELS rather than on the manifest entries of
PROFILE.
(guix-describe): When PROFILE is #f, call 'current-channels' and pass it
to 'display-profile-info', unless it returns the empty list.
This commit is contained in:
Ludovic Courtès 2021-01-27 14:46:10 +01:00
parent 814ee99da8
commit 316fc2acbb
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
6 changed files with 116 additions and 59 deletions

View file

@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@ -241,7 +241,7 @@ interface (FFI) of Guile.")
(define* (build-program source version
#:optional (guile-version (effective-version))
#:key (pull-version 0))
#:key (pull-version 0) (channel-metadata #f))
"Return a program that computes the derivation to build Guix from SOURCE."
(define select?
;; Select every module but (guix config) and non-Guix modules.
@ -359,6 +359,8 @@ interface (FFI) of Guile.")
(run-with-store store
(guix-derivation source version
#$guile-version
#:channel-metadata
'#$channel-metadata
#:pull-version
#$pull-version)
#:system system)
@ -380,7 +382,9 @@ interface (FFI) of Guile.")
;; The procedure below is our return value.
(define* (build source
#:key verbose? (version (date-version-string)) system
#:key verbose?
(version (date-version-string)) channel-metadata
system
(pull-version 0)
;; For the standalone Guix, default to Guile 3.0. For old
@ -397,6 +401,7 @@ files."
;; Build the build program and then use it as a trampoline to build from
;; SOURCE.
(mlet %store-monad ((build (build-program source version guile-version
#:channel-metadata channel-metadata
#:pull-version pull-version))
(system (if system (return system) (current-system)))
(home -> (getenv "HOME"))