From 316fc2acbb112bfa572ae30f95a93bcd56621234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 27 Jan 2021 14:46:10 +0100 Subject: channels: Record 'guix' channel metadata in (guix config). Partially fixes . * 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. --- guix/channels.scm | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'guix/channels.scm') diff --git a/guix/channels.scm b/guix/channels.scm index e7e1eb6fd0..3cc3b4c438 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -626,16 +626,23 @@ that unconditionally resumes the continuation." (values (run-with-store store mvalue) store)))) -(define* (build-from-source name source - #:key core verbose? commit - (dependencies '())) - "Return a derivation to build Guix from SOURCE, using the self-build script -contained therein; use COMMIT as the version string. When CORE is true, build -package modules under SOURCE using CORE, an instance of Guix." +(define* (build-from-source instance + #:key core verbose? (dependencies '())) + "Return a derivation to build Guix from INSTANCE, using the self-build +script contained therein. When CORE is true, build package modules under +SOURCE using CORE, an instance of Guix." + (define name + (symbol->string + (channel-name (channel-instance-channel instance)))) + (define source + (channel-instance-checkout instance)) + (define commit + (channel-instance-commit instance)) + ;; Running the self-build script makes it easier to update the build ;; procedure: the self-build script of the Guix-to-be-installed contains the ;; right dependencies, build procedure, etc., which the Guix-in-use may not - ;; be know. + ;; know. (define script (string-append source "/" %self-build-file)) @@ -661,7 +668,9 @@ package modules under SOURCE using CORE, an instance of Guix." ;; cause us to redo half of the BUILD computation several times just ;; to realize it gives the same result. (with-trivial-build-handler - (build source #:verbose? verbose? #:version commit + (build source + #:verbose? verbose? #:version commit + #:channel-metadata (channel-instance->sexp instance) #:pull-version %pull-version)))) ;; Build a set of modules that extend Guix using the standard method. @@ -672,10 +681,7 @@ package modules under SOURCE using CORE, an instance of Guix." "Return, as a monadic value, the derivation for INSTANCE, a channel instance. DEPENDENCIES is a list of extensions providing Guile modules that INSTANCE depends on." - (build-from-source (symbol->string - (channel-name (channel-instance-channel instance))) - (channel-instance-checkout instance) - #:commit (channel-instance-commit instance) + (build-from-source instance #:core core #:dependencies dependencies)) -- cgit v1.2.3