From be058c00870ef6c4837479f4b9043d72f8425ebc Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sun, 25 Jan 2026 11:04:54 +0100 Subject: [PATCH] ci: Use (guix channels) to build guix specification. This allows for the same guix being built as the one built by guix pull. Full profile is built with all the channels specified in the specification. * gnu/ci.scm (guix-jobs): Use instances instead of channel with checkout url. (cuirass-jobs): Recompute channel-instance for each channel. * guix/channels.scm: Export channel-instance. Closes: guix/cuirass#115 Change-Id: Ib003d22bdabe9751c92cb716483ca1138f809494 --- gnu/ci.scm | 26 +++++++++++++++++--------- guix/channels.scm | 1 + 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/gnu/ci.scm b/gnu/ci.scm index 4e282d197f943baca2c8db7af29396c4ecb64628..747487ad7647a9f0e137118303bf16f3e6fce466 100644 --- a/gnu/ci.scm +++ b/gnu/ci.scm @@ -230,19 +230,14 @@ SYSTEM." (remove (either from-32-to-64? same? pointless?) (targets)))) -(define* (guix-jobs store systems #:key source commit) +(define* (guix-jobs store systems #:key instances) "Return a list of jobs for Guix itself." - (define build - (primitive-load (string-append source "/build-aux/build-self.scm"))) - (map (lambda (system) (let ((name (string->symbol (string-append "guix." system))) (drv (run-with-store store - (build source #:version commit #:system system - #:pull-version 1 - #:guile-version "2.2")))) + (channel-instances->derivation instances)))) (derivation->job name drv))) systems)) @@ -502,6 +497,20 @@ names, for each one of SYSTEMS." (let ((channels (assq-ref arguments 'channels))) (map sexp->channel channels))) + (define channel-specs + (let ((channels (assq-ref arguments 'channel-specs))) + (map sexp->channel channels))) + + (define instances + (map + (match-lambda + ((channel-checkout channel-spec) + (channel-instance + channel-spec + (channel-commit channel-checkout) + (channel-url channel-checkout)))) + (zip channels channel-specs))) + (define guix (find guix-channel? channels)) @@ -549,8 +558,7 @@ names, for each one of SYSTEMS." ('guix ;; Build Guix modules only. (guix-jobs store systems - #:source source - #:commit commit)) + #:instances instances)) ('hello ;; Build hello package only. (let ((hello (specification->package "hello"))) diff --git a/guix/channels.scm b/guix/channels.scm index 0d544f95be797fc7d12f496a60484c6a0455b18f..288daa77e5f783747665378b2d464aba30956758 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -87,6 +87,7 @@ guix-channel? repository->guix-channel + channel-instance channel-instance? channel-instance-channel channel-instance-commit