From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 03 04:33:56 2023 Received: (at submit) by debbugs.gnu.org; 3 Dec 2023 09:33:56 +0000 Received: from localhost ([127.0.0.1]:59135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r9irL-00057M-Sj for submit@debbugs.gnu.org; Sun, 03 Dec 2023 04:33:56 -0500 Received: from lists.gnu.org ([2001:470:142::17]:49412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r9irK-000577-0M for submit@debbugs.gnu.org; Sun, 03 Dec 2023 04:33:54 -0500 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 1r9ir3-0000JV-St for guix-patches@gnu.org; Sun, 03 Dec 2023 04:33:38 -0500 Received: from vmi571514.contaboserver.net ([75.119.130.101] helo=mail.laesvuori.fi) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r9iqv-00051r-R1 for guix-patches@gnu.org; Sun, 03 Dec 2023 04:33:36 -0500 Received: from X-kone.lan (88-113-24-127.elisa-laajakaista.fi [88.113.24.127]) by mail.laesvuori.fi (Postfix) with ESMTPSA id 182AA3400B0; Sun, 3 Dec 2023 10:33:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=laesvuori.fi; s=mail; t=1701596006; bh=++gTLDjUeMhNPmQ8bCUP6w82kkqkL5RAJHkPZAZAQBA=; h=From:To:Cc:Subject:Date; b=GnFVB9HHjtlVoK2UMiS/OfEF7mpgjDxvgqAS/5y7rLk8czfiHfOReWWGyT+BxOnp0 CIt3ULrEh42CIVafP0Vgfm+3dnEwZlkfTEEq7D7zWIWv9E7H8y1I7aJLvRSAD4vMNb 8I/0IcWai2lFOims5OCowYv3RpvoFOd9fJNeJ/WY= From: Saku Laesvuori To: guix-patches@gnu.org Subject: [PATCH] gnu: services: guix: Allow gexps evaluating to a list of build-machines Date: Sun, 3 Dec 2023 11:31:42 +0200 Message-ID: <4cb4eac27ae7990eb9c79bcea0c05dbdbe0bdf37.1701595902.git.saku@laesvuori.fi> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=75.119.130.101; envelope-from=saku@laesvuori.fi; helo=mail.laesvuori.fi X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: Saku Laesvuori X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) * gnu/services/base.scm (guix-machines-files-installation): Handle machines being a mixed list of build-machines and lists of build-machines. * doc/guix.texi: Document it. Change-Id: Ie404562ca0b564413233c3a624046da831893dc3 --- This enables doing things like the DNS-SD example mentioned in '2.4.2 Using the Offload Facility' directly from the operating-system declaration. doc/guix.texi | 9 ++++++--- gnu/services/base.scm | 8 +++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 1fd2e21608..3e599742c3 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19316,7 +19316,8 @@ Base Services @anchor{guix-configuration-build-machines} @item @code{build-machines} (default: @code{#f}) This field must be either @code{#f} or a list of gexps evaluating to a -@code{build-machine} record (@pxref{Daemon Offload Setup}). +@code{build-machine} record or to a list of @code{build-machine} records +(@pxref{Daemon Offload Setup}). When it is @code{#f}, the @file{/etc/guix/machines.scm} file is left untouched. Otherwise, the list of of gexps is written to @@ -19329,7 +19330,8 @@ Base Services (guix-configuration (build-machines (list #~(build-machine (name "foo.example.org") @dots{}) - #~(build-machine (name "bar.example.org") @dots{})))) + #~(list (build-machine (name "bar.example.org") @dots{}) + (build-machine (name "foobaz.example.org") @dots{}))))) @end lisp Additional build machines may be added @i{via} the @code{guix-extension} @@ -19385,7 +19387,8 @@ Base Services A list of strings where each element is a substitute URL. @item @code{build-machines} (default: @code{'()}) -A list of gexps that evaluate to @code{build-machine} records +A list of gexps that evaluate to @code{build-machine} records or to a list of +@code{build-machine} records. (@pxref{Daemon Offload Setup}). Using this field, a service may add new build machines to receive builds diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 82c6940780..beb710f95c 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1765,7 +1765,13 @@ (define (guix-machines-files-installation machines) (mkdir-p (dirname machines-file))) ;; Installed the declared machines file. - (symlink #+(scheme-file "machines.scm" machines) + (symlink #+(scheme-file "machines.scm" + `(apply append + (map (lambda (entry) + (if (list? entry) + entry + (list entry))) + ,machines))) machines-file)))) (define-record-type* base-commit: cd46757c1a0f886848fbb6828c028dd2a2532767 -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 10 16:19:07 2023 Received: (at 67598) by debbugs.gnu.org; 10 Dec 2023 21:19:07 +0000 Received: from localhost ([127.0.0.1]:51825 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCRCd-0005XD-Hg for submit@debbugs.gnu.org; Sun, 10 Dec 2023 16:19:07 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:53292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCRCZ-0005Wh-Ns for 67598@debbugs.gnu.org; Sun, 10 Dec 2023 16:19:06 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rCRCE-0000DE-Ei; Sun, 10 Dec 2023 16:18:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=pn54yyyQqktJwzDfZIrZiXRKoVBQCcLCOQbZ5ncoaqY=; b=X8L6XOXbH++VGhLXcMoM WQCJahoUkKksYMR2zJxEDe3lTpY1Dg5tXME+F6jUt5fqTFFYnAGFrXeXS6879ELu/S4hgvAQEScx+ KyYl9WYiLr1QJQTlFdqaU9YGUAYKClXXgEPmic54lQO8nwsoNw2cDPUBEfHNqteOT8tuDFxp9SROu mhYHGgQze6KyPzEuHgJQqSTRrF5P6H9OxbxpSZhpXXFfNakRGizxDhUrJQ2AzVVmUitbRH+s8iH3T EqFl/cyO3/pOYyZmnUFqOFYTrLsntNDzjmhBoq1ZKZSVUQWARo7w+TKs1kANdmXOXNBiB6ZW7u5Td 6461EnNx5jZ2/w==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Saku Laesvuori Subject: Re: [bug#67598] [PATCH] gnu: services: guix: Allow gexps evaluating to a list of build-machines In-Reply-To: <4cb4eac27ae7990eb9c79bcea0c05dbdbe0bdf37.1701595902.git.saku@laesvuori.fi> (Saku Laesvuori's message of "Sun, 3 Dec 2023 11:31:42 +0200") References: <4cb4eac27ae7990eb9c79bcea0c05dbdbe0bdf37.1701595902.git.saku@laesvuori.fi> Date: Sun, 10 Dec 2023 22:18:39 +0100 Message-ID: <87a5qh4uz4.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67598 Cc: 67598@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Saku Laesvuori skribis: > * gnu/services/base.scm (guix-machines-files-installation): Handle > machines being a mixed list of build-machines and lists of > build-machines. > * doc/guix.texi: Document it. > > Change-Id: Ie404562ca0b564413233c3a624046da831893dc3 Sounds useful! > (guix-configuration > (build-machines > (list #~(build-machine (name "foo.example.org") @dots{}) > - #~(build-machine (name "bar.example.org") @dots{})))) > + #~(list (build-machine (name "bar.example.org") @dots{}) > + (build-machine (name "foobaz.example.org") @dots{}))))) I wouldn=E2=80=99t show both in the same example as it can be confusing. So either leave the example unchanged or add a second one (maybe with =E2=80=98guix-extension=E2=80=99?). > + (symlink #+(scheme-file "machines.scm" > + `(apply append Use =E2=80=98concatenate=E2=80=99 instead, and #~ instead of `. > + (map (lambda (entry) > + (if (list? entry) > + entry > + (list entry))) > + ,machines))) Since =E2=80=98list?=E2=80=99 is linear in the number of elements in the li= st, my preference would be to write it like this: (if (build-machine? entry) (list entry) entry) Could you send an updated patch? Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 11 02:28:05 2023 Received: (at 67598) by debbugs.gnu.org; 11 Dec 2023 07:28:05 +0000 Received: from localhost ([127.0.0.1]:52360 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCahx-0006VR-8i for submit@debbugs.gnu.org; Mon, 11 Dec 2023 02:28:05 -0500 Received: from vmi571514.contaboserver.net ([75.119.130.101]:54892 helo=mail.laesvuori.fi) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rCahr-0006Uu-Hq for 67598@debbugs.gnu.org; Mon, 11 Dec 2023 02:28:03 -0500 Received: from X-kone.org.aalto.fi (unknown [130.233.144.30]) by mail.laesvuori.fi (Postfix) with ESMTPSA id 9313E3400FA; Mon, 11 Dec 2023 08:27:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=laesvuori.fi; s=mail; t=1702279665; bh=pzUunZPkbAcING6ZtDIBHLt86H43dYtG1KlsZtNqk24=; h=From:To:Cc:Subject:Date; b=hvo8tS55S3TexS2E5koxuonQQPyPvBLh5XvoUOInHBeAw2I2PZjxyDYega5ulBrD1 Ohog+2YkFKDypVpSsy9+bye1z0QGulhHy04DcNJUQ8zSdkXiqbEFxxBF0HR1+fWWin tiHj+4uND0Snn8OZ12CwcFR6K/oqc5gSsBoWRl9I= From: Saku Laesvuori To: ludo@gnu.org Subject: [PATCH v2] gnu: services: guix: Allow gexps evaluating to a list of build-machines Date: Mon, 11 Dec 2023 09:26:14 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 67598 Cc: 67598@debbugs.gnu.org, Saku Laesvuori X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/services/base.scm (guix-machines-files-installation): Handle machines being a mixed list of build-machines and lists of build-machines. * doc/guix.texi: Document it. Change-Id: Ie404562ca0b564413233c3a624046da831893dc3 --- doc/guix.texi | 6 ++++-- gnu/services/base.scm | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 1fd2e21608..e74aa631b7 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -19316,7 +19316,8 @@ Base Services @anchor{guix-configuration-build-machines} @item @code{build-machines} (default: @code{#f}) This field must be either @code{#f} or a list of gexps evaluating to a -@code{build-machine} record (@pxref{Daemon Offload Setup}). +@code{build-machine} record or to a list of @code{build-machine} records +(@pxref{Daemon Offload Setup}). When it is @code{#f}, the @file{/etc/guix/machines.scm} file is left untouched. Otherwise, the list of of gexps is written to @@ -19385,7 +19386,8 @@ Base Services A list of strings where each element is a substitute URL. @item @code{build-machines} (default: @code{'()}) -A list of gexps that evaluate to @code{build-machine} records +A list of gexps that evaluate to @code{build-machine} records or to a list of +@code{build-machine} records. (@pxref{Daemon Offload Setup}). Using this field, a service may add new build machines to receive builds diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 82c6940780..f060feab12 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1765,7 +1765,13 @@ (define (guix-machines-files-installation machines) (mkdir-p (dirname machines-file))) ;; Installed the declared machines file. - (symlink #+(scheme-file "machines.scm" machines) + (symlink #+(scheme-file "machines.scm" + #~((@ (srfi srfi-1) concatenate) + (map (lambda (entry) + (if (build-machine? entry) + (list entry) + entry)) + #$machines))) machines-file)))) (define-record-type* base-commit: cd46757c1a0f886848fbb6828c028dd2a2532767 -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 14 16:08:45 2023 Received: (at 67598-done) by debbugs.gnu.org; 14 Dec 2023 21:08:46 +0000 Received: from localhost ([127.0.0.1]:51064 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDswn-0004rW-Ig for submit@debbugs.gnu.org; Thu, 14 Dec 2023 16:08:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41370) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDswl-0004rI-6L for 67598-done@debbugs.gnu.org; Thu, 14 Dec 2023 16:08:44 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rDswf-000467-Sp; Thu, 14 Dec 2023 16:08:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=4JYpRMUkgXbGrOHVpg2wLNo3RG/qc4ZcAwXOl9GsPI0=; b=GB/ihIDQPsr/Zve4eSqU JVBEjQ42B+UitCTsoorpaBqiq/PadN1C4CiWYLXJBtuNoNGNWjIec6+vgEJ3v3EVvYP8MS0Ei20Ac 6DcP1Cb/By9q/FGs6F913EYJS0AzQ0UvliagriojemR58+GC5+RhaJNUMhRBIqAUYNmaB9HrA5mWN DpiDvfPxTWs4y1alG/ucJAvoZNPmi4mTZXNYgO2espRj/NyslBwEpya2atr6dxZ60+U61DXTcN5D8 id8vfCKCGtwdbYCaGUIzAGIVg1Ui1l1icOoA+gVnnYLtmiX8qdWR5hEDQRqy1QK0oV/+4B2WzgtFt fl2q47D1aofCrw==; From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Saku Laesvuori Subject: Re: [PATCH v2] gnu: services: guix: Allow gexps evaluating to a list of build-machines In-Reply-To: (Saku Laesvuori's message of "Mon, 11 Dec 2023 09:26:14 +0200") References: X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Quartidi 24 Frimaire an 232 de la =?utf-8?Q?R=C3=A9v?= =?utf-8?Q?olution=2C?= jour de l'Oseille X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 14 Dec 2023 22:08:34 +0100 Message-ID: <87jzpgtru5.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 67598-done Cc: 67598-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Saku Laesvuori skribis: > * gnu/services/base.scm (guix-machines-files-installation): Handle > machines being a mixed list of build-machines and lists of > build-machines. > * doc/guix.texi: Document it. > > Change-Id: Ie404562ca0b564413233c3a624046da831893dc3 Applied with the small change below (hadn=E2=80=99t realized earlier that we could use =E2=80=98append-map=E2=80=99). Thanks! Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 3a4d8e789c..6539bfd6ce 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -1768,12 +1768,12 @@ (define (guix-machines-files-installation machines) ;; Installed the declared machines file. (symlink #+(scheme-file "machines.scm" - #~((@ (srfi srfi-1) concatenate) - (map (lambda (entry) - (if (build-machine? entry) - (list entry) - entry)) - #$machines))) + #~((@ (srfi srfi-1) append-map) + (lambda (entry) + (if (build-machine? entry) + (list entry) + entry)) + #$machines)) machines-file)))) (define-record-type* --=-=-=-- From unknown Tue Jun 17 01:44:28 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 12 Jan 2024 12:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator