From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0+iXOCwhCmKJKAEAgWs5BA (envelope-from ) for ; Mon, 14 Feb 2022 10:30:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id AG/oNCwhCmJpuQAA9RJhRA (envelope-from ) for ; Mon, 14 Feb 2022 10:30:20 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5B2A423F5E for ; Mon, 14 Feb 2022 10:30:20 +0100 (CET) Received: from localhost ([::1]:50624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJXgZ-0007Yw-Ff for larch@yhetil.org; Mon, 14 Feb 2022 04:30:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJXgK-0007YH-2R for bug-guix@gnu.org; Mon, 14 Feb 2022 04:30:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45842) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJXgJ-00060x-P2 for bug-guix@gnu.org; Mon, 14 Feb 2022 04:30:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJXgJ-0006GI-MJ for bug-guix@gnu.org; Mon, 14 Feb 2022 04:30:03 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#53210: [WIP PATCH 1/4] gnu: ci: Move generic channel building code. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 14 Feb 2022 09:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53210 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe Cc: Josselin Poiret , 53210@debbugs.gnu.org Received: via spool by 53210-submit@debbugs.gnu.org id=B53210.164483096723932 (code B ref 53210); Mon, 14 Feb 2022 09:30:03 +0000 Received: (at 53210) by debbugs.gnu.org; 14 Feb 2022 09:29:27 +0000 Received: from localhost ([127.0.0.1]:39723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJXfi-0006Du-Kv for submit@debbugs.gnu.org; Mon, 14 Feb 2022 04:29:27 -0500 Received: from jpoiret.xyz ([206.189.101.64]:36814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJXff-0006Dc-R6 for 53210@debbugs.gnu.org; Mon, 14 Feb 2022 04:29:24 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 3C345185182; Mon, 14 Feb 2022 09:29:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1644830963; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pmOM/u8ObPqJxjHfDZJQGLutL4t9sZsAJGxO5+8TJac=; b=AQxpMs38WXGBkz2InsS7JjPaQIdKvs4DT0pW1Gp4fDxn6VIaOcLRYrBiB9ywg4O1HWkz9A 7/ia3Sy8GCHM3VT7kaS7Vzyk8JZE+NpjiJmvxMXqP0hlyC9WoXN88ppAgUK5qJay6aoI/R RWQdSO2USGfU3PWQBa/JyoO42F0T4One9T5TpIjgvvjHyzBkUsHZrMMebyu3A5XnGMbSQP VeRWHfe0aQSg8kUIJiEkwKe9xN0jQxzckbb1SmVuA091TWynCBI3SY6LI0XZQEF4x4YjTm V0NpczS7GlGb3f2Ed3hykl07clnBf285alMDSx12Bpvfk+Y68+09i9oS2fMCMg== Date: Mon, 14 Feb 2022 10:29:05 +0100 Message-Id: <20220214092908.16801-2-dev@jpoiret.xyz> In-Reply-To: <20220214092908.16801-1-dev@jpoiret.xyz> References: <87lezkrgvj.fsf@gnu.org> <20220214092908.16801-1-dev@jpoiret.xyz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spamd-Bar: / X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" Reply-to: Josselin Poiret From: Josselin Poiret via Bug reports for GNU Guix X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644831020; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=pmOM/u8ObPqJxjHfDZJQGLutL4t9sZsAJGxO5+8TJac=; b=Sp887gNjeaqcnHEc9wVV2BLj5xk/1u17uMRg5euJgKaicT2fWQ0aPdg2yuLrnVqjzjV29N reLfeJo3Woki6WvReGJKAG2x7VfKANnZWAsDryYSZGBsTgK5cW+FrhbMGNYp9g6m8WwpNj +0ovvWCzP+cSkm4prT7auirWRR6tajrx5kP/DNpj8pHaMTzAV6L26gmB4HxpmcZPAsXn+3 Xox56dCme52xMiFjv+GoZ9t0rdx3e1BoTa0YnVyBcP6tNW97DDW+Y4G039JWduSzeqBVTI /ZqcdlnOPX3FukCTrlzKbgtJ+SIACth10PMe0TYkDKxFuuXx8nnEpWUGGNxs2g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644831020; a=rsa-sha256; cv=none; b=h0HUt6pU3ZjYLgbisgOcaV5sCu/C3528BVx68thSjkaZmqKuWWfARXou8JiZUMOxDFucLY jdL/Te0i2vjT1soY9DTWOh6b5DhoDGy1wqjLQjRHoiyw+dWhPyffCHKYwhM7tCP/oVjhRH m3wQldRQqkmk/o/rMc/kEIa5z3DDp2jVkEndT/HNJ46KKPZmTtSSQaTOLkd/GjPpLjbVuK sgQh9C/arrrVv58GUICn1eYUXzNTQV9ypbhSAszhu5Us4AJINOFPWZ+tPjyHzN2mWebr+L 8bdLqbBygvB6Zk2PzwLLsEuExTMA+1DXTmqhfo5dGsGCph0KOj2xZj9XFDO87A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=AQxpMs38; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.13 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=AQxpMs38; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 5B2A423F5E X-Spam-Score: -3.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: Jm8xdnubfTdB * gnu/ci.scm (channel-build-system): Move to guix/channels.scm. (channel-source->package): Move to gnu/packages/package-management.scm. * guix/channels.scm (channel-build-system): Moved from gnu/ci.scm. * gnu/packages/package-management.scm (channel-source->package): Moved from gnu/ci.scm. * etc/system-tests.scm: Use module (gnu packages package-management) instead of (gnu ci). --- etc/system-tests.scm | 1 - gnu/ci.scm | 38 ----------------------------- gnu/packages/package-management.scm | 16 ++++++++++++ guix/channels.scm | 27 ++++++++++++++++++++ 4 files changed, 43 insertions(+), 39 deletions(-) diff --git a/etc/system-tests.scm b/etc/system-tests.scm index 1085deed24..ba0c106553 100644 --- a/etc/system-tests.scm +++ b/etc/system-tests.scm @@ -18,7 +18,6 @@ (use-modules (gnu tests) (gnu packages package-management) - ((gnu ci) #:select (channel-source->package)) ((guix git-download) #:select (git-predicate)) ((guix utils) #:select (current-source-directory)) (git) diff --git a/gnu/ci.scm b/gnu/ci.scm index 35fd583f75..be19bda413 100644 --- a/gnu/ci.scm +++ b/gnu/ci.scm @@ -32,7 +32,6 @@ (define-module (gnu ci) #:use-module (guix channels) #:use-module (guix config) #:use-module (guix derivations) - #:use-module (guix build-system) #:use-module (guix monads) #:use-module (guix gexp) #:use-module (guix ui) @@ -72,7 +71,6 @@ (define-module (gnu ci) %core-packages %cross-targets - channel-source->package arguments->systems cuirass-jobs)) @@ -300,42 +298,6 @@ (define MiB '())) '())) -(define channel-build-system - ;; Build system used to "convert" a channel instance to a package. - (let* ((build (lambda* (name inputs - #:key source commit system - #:allow-other-keys) - (mlet* %store-monad ((source (if (string? source) - (return source) - (lower-object source))) - (instance - -> (checkout->channel-instance - source #:commit commit))) - (channel-instances->derivation (list instance))))) - (lower (lambda* (name #:key system source commit - #:allow-other-keys) - (bag - (name name) - (system system) - (build build) - (arguments `(#:source ,source - #:commit ,commit)))))) - (build-system (name 'channel) - (description "Turn a channel instance into a package.") - (lower lower)))) - -(define* (channel-source->package source #:key commit) - "Return a package for the given channel SOURCE, a lowerable object." - (package - (inherit guix) - (version (string-append (package-version guix) "+")) - (build-system channel-build-system) - (arguments `(#:source ,source - #:commit ,commit)) - (inputs '()) - (native-inputs '()) - (propagated-inputs '()))) - (define* (system-test-jobs store system #:key source commit) "Return a list of jobs for the system tests." diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index 03cc9a6612..edef91ff7e 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -114,6 +114,9 @@ (define-module (gnu packages package-management) #:use-module (guix build-system meson) #:use-module (guix build-system python) #:use-module (guix build-system trivial) + ;; This will be loaded by build-self.scm, but guile-git is unavailable, so + ;; lazily load instead. + #:autoload (guix channels) (channel-build-system guix-channel?) #:use-module (guix download) #:use-module (guix gexp) #:use-module (guix git-download) @@ -572,6 +575,19 @@ (define (wrong-extension? file) (_ #t))) +(define-public channel-source->package + (lambda* (source #:key commit) + "Return a package for the given channel SOURCE, a lowerable object." + (package + (inherit guix) + (version (string-append (package-version guix) "+")) + (build-system channel-build-system) + (arguments `(#:source ,source + #:commit ,commit)) + (inputs '()) + (native-inputs '()) + (propagated-inputs '())))) + (define-public current-guix-package ;; This parameter allows callers to override the package that 'current-guix' ;; returns. This is useful when 'current-guix' cannot compute it by itself, diff --git a/guix/channels.scm b/guix/channels.scm index 5f47834c10..d637d5863a 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -27,6 +27,7 @@ (define-module (guix channels) #:select (openpgp-public-key-fingerprint openpgp-format-fingerprint)) #:use-module (guix base16) + #:use-module (guix build-system) #:use-module (guix records) #:use-module (guix gexp) #:use-module (guix modules) @@ -93,6 +94,8 @@ (define-module (guix channels) channel-instances->derivation ensure-forward-channel-update + channel-build-system + profile-channels manifest-entry-channel sexp->channel @@ -952,6 +955,30 @@ (define* (latest-channel-derivation #:optional (channels %default-channels) validate-pull))) (channel-instances->derivation instances))) +(define channel-build-system + ;; Build system used to "convert" a channel instance to a package. + (let* ((build (lambda* (name inputs + #:key source commit system + #:allow-other-keys) + (mlet* %store-monad ((source (if (string? source) + (return source) + (lower-object source))) + (instance + -> (checkout->channel-instance + source #:commit commit))) + (channel-instances->derivation (list instance))))) + (lower (lambda* (name #:key system source commit + #:allow-other-keys) + (bag + (name name) + (system system) + (build build) + (arguments `(#:source ,source + #:commit ,commit)))))) + (build-system (name 'channel) + (description "Turn a channel instance into a package.") + (lower lower)))) + (define* (sexp->channel sexp #:optional (name 'channel)) "Read SEXP, a provenance sexp as created by 'channel-instance->sexp'; use NAME as the channel name if SEXP does not specify it. Return #f if the sexp -- 2.34.0