From patchwork Sun Apr 7 19:20:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ian Eure X-Patchwork-Id: 62820 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id AC86A27BBE2; Sun, 7 Apr 2024 20:22:14 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5FF7627BBE9 for ; Sun, 7 Apr 2024 20:22:12 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rtY5U-0006dn-Nu; Sun, 07 Apr 2024 15:21:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtY5T-0006dZ-5S for guix-patches@gnu.org; Sun, 07 Apr 2024 15:21:55 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rtY5S-00018N-Tb for guix-patches@gnu.org; Sun, 07 Apr 2024 15:21:54 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rtY5Z-0002nI-QF for guix-patches@gnu.org; Sun, 07 Apr 2024 15:22:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70263] [PATCH] gnu: guix-configuration: Improve offload build-machines. Resent-From: Ian Eure Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 07 Apr 2024 19:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 70263 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 70263@debbugs.gnu.org Cc: Ian Eure X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.171251770510673 (code B ref -1); Sun, 07 Apr 2024 19:22:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Apr 2024 19:21:45 +0000 Received: from localhost ([127.0.0.1]:44681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtY5I-0002m3-EO for submit@debbugs.gnu.org; Sun, 07 Apr 2024 15:21:44 -0400 Received: from lists.gnu.org ([2001:470:142::17]:47248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rtY52-0002k5-94 for submit@debbugs.gnu.org; Sun, 07 Apr 2024 15:21:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtY4n-0006ap-Tv for guix-patches@gnu.org; Sun, 07 Apr 2024 15:21:14 -0400 Received: from wfhigh8-smtp.messagingengine.com ([64.147.123.159]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rtY4l-00014R-3i for guix-patches@gnu.org; Sun, 07 Apr 2024 15:21:13 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.west.internal (Postfix) with ESMTP id 9B525180010C; Sun, 7 Apr 2024 15:21:05 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 07 Apr 2024 15:21:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=retrospec.tv; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:message-id:mime-version:reply-to :subject:subject:to:to; s=fm1; t=1712517665; x=1712604065; bh=Fw lPHCWKs90g9/3tY/YY2bu5QQ1bpcwYzYTTseNV7H0=; b=mAyYw7lKNK/bc6E0aw JhRVTNI+BsaMFZTOySrlfrgvmAz95+UaXI4wP4+scdnJtrkZpMk/O3VOWWR2kdVC t1c4S9aeT1eEr4cqGSaYM2Bj/CioXiVIBXKZ3450NzL8XqKpxbGecVSUcOrq5s+7 uf0gHVWvoNtp0r8S85CEkojDiVbiLOaw1e06D339CWcMYRBmQei9D+HP7ePSlrKf 86nS3Y0EuuAGL68jUKDOX34Nc4K/F8vwa8oaxzdTLOXOjEoo58YI15cynnJqZ01W utz/VQuNBYOJ/FKUZu+gyI9AE/vM/J2d65ZCOImlSKcj9Ae2mISaag7M/FkYYEj3 O07A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1712517665; x=1712604065; bh=FwlPHCWKs90g9 /3tY/YY2bu5QQ1bpcwYzYTTseNV7H0=; b=Z5xI8GIALFnwegiPhnz0+001FGQ6R Es9a/ra9YBIJmhxrHPtqlJ3Ahr1bPjIjkx2QOf8mRzSP0lluKn3Mc5/Ygphrc0Vi 0gsJT/xdHajqD+h1013Wpcq9Wb6yzm/BYaJ/1dxtDKd4VA0cVCvmUjn0h7NxN3kd W3OuinimhndlfydVUrXD7qbXMQT0BOgSdRCNtmxAvu7Yad95aspx9Oj+OA88/ZVF Cn4KEDAkZz4KswkrjvrPDt527Z5g6icwtMOcHQDF27dCzbgyK9vytQv3gR8a2euD ZDmnsACfvcVsT8ZJsa3fRDYQ6T4yhSfeUZiU88q98ZYcSf9F6/jKStR+w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeggedgudefhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofggtgfgsehtke ertdertdejnecuhfhrohhmpefkrghnucfguhhrvgcuoehirghnsehrvghtrhhoshhpvggt rdhtvheqnecuggftrfgrthhtvghrnhepgfeukeffjedugfdvveetleetiedtueduudffhf euhfeihfejteeuhffgteetvdetnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomhepihgrnhesrhgvthhrohhsphgvtgdrthhv X-ME-Proxy: Feedback-ID: id9014242:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 7 Apr 2024 15:21:04 -0400 (EDT) From: Ian Eure Date: Sun, 7 Apr 2024 12:20:59 -0700 Message-ID: <7d5b40b2df8b68e1aafc881080680824e6655460.1712517547.git.ian@retrospec.tv> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.159; envelope-from=ian@retrospec.tv; helo=wfhigh8-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches It’s currently difficult to programmatically add a build-machine, because the `service-extension' mechanism is the only facility which can do that. It relies on the `guix-service-type', ala: (service-extension guix-service-type (guix-extension (build-machines (list ...)))) ...but `guix-service-type' is already instantiated as part of `%base-services', and replacing it may lose other configuration, like substitute servers and authorized keys. Additionally, a default value of `#f' for the build-machines field requires guarding uses of the field with: (or (guix-build-machines config) '()) Changing the default to be the empty list avoids that. One can now add build-machines with code such as: (modify-services %base-services (guix-service-type config => (guix-configuration (inherit config) (authorized-keys (cons %build-machine-key (guix-configuration-authorized-keys config))) (build-machines (cons #~(build-machine ...) (guix-configuration-build-machines config)))))) * gnu/services/base.scm (guix-configuration): Rename `guix-build-machines' to `guix-configuration-build-machines' and export it. Change the default from `#f' to the empty list. * gnu/services/base.scm (guix-activation): Update the build-machines test and reverse the conditions. Change-Id: I6780c6a5579fd9d4b4f22ee2b2bf7ba7a0454407 --- gnu/services/base.scm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) base-commit: ab3731d255ff1ac8d6874bc0f68ad94f21f08e79 diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 3f912225a0..5cf6083821 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -212,6 +212,7 @@ (define-module (gnu services base) guix-configuration-guix guix-configuration-build-group guix-configuration-build-accounts + guix-configuration-build-machines guix-configuration-authorize-key? guix-configuration-authorized-keys guix-configuration-use-substitutes? @@ -1848,8 +1849,8 @@ (define-record-type* (default #f)) (tmpdir guix-tmpdir ;string | #f (default #f)) - (build-machines guix-build-machines ;list of gexps | #f - (default #f)) + (build-machines guix-configuration-build-machines ;list of gexps | '() + (default '())) (environment guix-configuration-environment ;list of strings (default '()))) @@ -2044,10 +2045,10 @@ (define (guix-activation config) #$(and channels (install-channels-file channels)) ;; ... and /etc/guix/machines.scm. - #$(if (guix-build-machines config) + #$(if (null? (guix-configuration-build-machines config)) + #~#f (guix-machines-files-installation - #~(list #$@(guix-build-machines config))) - #~#f)))) + #~(list #$@(guix-configuration-build-machines config))))))) (define-record-type* guix-extension make-guix-extension @@ -2093,9 +2094,9 @@ (define guix-service-type (substitute-urls (append (guix-extension-substitute-urls extension) (guix-configuration-substitute-urls config))) (build-machines - (and (or (guix-build-machines config) + (and (or (guix-configuration-build-machines config) (pair? (guix-extension-build-machines extension))) - (append (or (guix-build-machines config) '()) + (append (guix-configuration-build-machines config) (guix-extension-build-machines extension)))) (chroot-directories (append (guix-extension-chroot-directories extension)