From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 24 04:14:09 2021 Received: (at submit) by debbugs.gnu.org; 24 Apr 2021 08:14:09 +0000 Received: from localhost ([127.0.0.1]:39401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1laDQW-0007Uz-Ln for submit@debbugs.gnu.org; Sat, 24 Apr 2021 04:14:09 -0400 Received: from lists.gnu.org ([209.51.188.17]:38390) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1laDQV-0007Up-3D for submit@debbugs.gnu.org; Sat, 24 Apr 2021 04:14:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58962) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1laDQU-0006zN-Sy for guix-patches@gnu.org; Sat, 24 Apr 2021 04:14:06 -0400 Received: from mira.cbaines.net ([212.71.252.8]:44906) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1laDQT-0006wk-1L for guix-patches@gnu.org; Sat, 24 Apr 2021 04:14:06 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id 9CA1027BC7C for ; Sat, 24 Apr 2021 09:14:03 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id a510ae54 for ; Sat, 24 Apr 2021 08:14:02 +0000 (UTC) From: Christopher Baines To: guix-patches@gnu.org Subject: [PATCH] channels: Add a #:system argument to channel-instances->manifest. Date: Sat, 24 Apr 2021 09:14:02 +0100 Message-Id: <20210424081402.26742-1-mail@cbaines.net> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=212.71.252.8; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit 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: -2.4 (--) This allows computing a manifest for a specific system. Previously this was possible, but only through changing %current-system, which caused the derivation to be computed using that system as well (so computing a derivation for aarch64-linux on x86_64-linux would require running aarch64-linux code). This new argument adds the possibility of computing derivations for non-native systems, without having to run non-native code. I'm looking at this as it will enable the Guix Data Service to compute channel instance derivations without relying on QEMU emulation for non-native systems (it should be faster as well). * guix/channels.scm (build-from-source): Add #:system argument and pass to build. (build-channel-instance): Add system argument and pass to build-from-source. (channel-instance-derivations): Add #:system argument and pass to build-channel-instance, also rename system to current-system-value. (channel-instances->manifest): Add #:system argument and pass to channel-instance-derivations. --- guix/channels.scm | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/guix/channels.scm b/guix/channels.scm index c40fc0c507..70a09e74ff 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -657,7 +657,7 @@ that unconditionally resumes the continuation." store)))) (define* (build-from-source instance - #:key core verbose? (dependencies '())) + #:key core verbose? (dependencies '()) system) "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." @@ -700,20 +700,22 @@ SOURCE using CORE, an instance of Guix." (with-trivial-build-handler (build source #:verbose? verbose? #:version commit + #:system system #:channel-metadata (channel-instance->sexp instance) #:pull-version %pull-version)))) ;; Build a set of modules that extend Guix using the standard method. (standard-module-derivation name source core dependencies))) -(define* (build-channel-instance instance +(define* (build-channel-instance instance system #:optional core (dependencies '())) "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 instance #:core core - #:dependencies dependencies)) + #:dependencies dependencies + #:system system)) (define (resolve-dependencies instances) "Return a procedure that, given one of the elements of INSTANCES, returns @@ -743,7 +745,7 @@ list of instances it depends on." (lambda (instance) (vhash-foldq* cons '() instance edges))) -(define (channel-instance-derivations instances) +(define* (channel-instance-derivations instances #:key system) "Return the list of derivations to build INSTANCES, in the same order as INSTANCES." (define core-instance @@ -757,14 +759,15 @@ INSTANCES." (resolve-dependencies instances)) (define (instance->derivation instance) - (mlet %store-monad ((system (current-system))) + (mlet %store-monad ((current-system-value (current-system))) (mcached (if (eq? instance core-instance) - (build-channel-instance instance) + (build-channel-instance instance system) (mlet %store-monad ((core (instance->derivation core-instance)) (deps (mapm %store-monad instance->derivation (edges instance)))) - (build-channel-instance instance core deps))) + (build-channel-instance instance system core deps))) instance + current-system-value system))) (unless core-instance @@ -865,7 +868,7 @@ derivation." intro)))))) '())))) -(define (channel-instances->manifest instances) +(define* (channel-instances->manifest instances #:key system) "Return a profile manifest with entries for all of INSTANCES, a list of channel instances." (define (instance->entry instance drv) @@ -883,7 +886,8 @@ channel instances." (properties `((source ,(channel-instance->sexp instance))))))) - (mlet* %store-monad ((derivations (channel-instance-derivations instances)) + (mlet* %store-monad ((derivations (channel-instance-derivations instances + #:system system)) (entries -> (map instance->entry instances derivations))) (return (manifest entries)))) -- 2.30.1 From debbugs-submit-bounces@debbugs.gnu.org Mon May 03 16:56:44 2021 Received: (at 47989) by debbugs.gnu.org; 3 May 2021 20:56:44 +0000 Received: from localhost ([127.0.0.1]:48672 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldfcS-0005G1-3l for submit@debbugs.gnu.org; Mon, 03 May 2021 16:56:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldfcR-0005Fv-64 for 47989@debbugs.gnu.org; Mon, 03 May 2021 16:56:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34413) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldfcK-0006yg-DJ; Mon, 03 May 2021 16:56:37 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=54722 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ldfcG-0004pV-J3; Mon, 03 May 2021 16:56:35 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Christopher Baines Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to channel-instances->manifest. References: <20210424081402.26742-1-mail@cbaines.net> Date: Mon, 03 May 2021 22:56:31 +0200 In-Reply-To: <20210424081402.26742-1-mail@cbaines.net> (Christopher Baines's message of "Sat, 24 Apr 2021 09:14:02 +0100") Message-ID: <877dkfv8n4.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) 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: 47989 Cc: 47989@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, Christopher Baines skribis: > This allows computing a manifest for a specific system. Previously this w= as > possible, but only through changing %current-system, which caused the > derivation to be computed using that system as well (so computing a deriv= ation > for aarch64-linux on x86_64-linux would require running aarch64-linux cod= e). I remember discussing it, but I wonder if I was confused. I think you can always do the equivalent of (say): guix time-machine -- build -s armhf-linux hello -d =E2=80=A6 where Guix itself is built natively but it then computes a deriva= tion for a different architecture. The equivalent code would be roughly: (let ((inferior (inferior-for-channels =E2=80=A6))) (inferior-package-derivation store (car (lookup-inferior-packages inferior "h= ello")) "armhf-linux")) Does that make sense? (You may also want to turn off grafts in the inferior.) Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon May 03 17:35:57 2021 Received: (at 47989) by debbugs.gnu.org; 3 May 2021 21:35:57 +0000 Received: from localhost ([127.0.0.1]:48849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldgEO-0005c2-Tw for submit@debbugs.gnu.org; Mon, 03 May 2021 17:35:57 -0400 Received: from mira.cbaines.net ([212.71.252.8]:44970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldgEN-0005bw-44 for 47989@debbugs.gnu.org; Mon, 03 May 2021 17:35:55 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id 0976B27BC81; Mon, 3 May 2021 22:35:54 +0100 (BST) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 33e8d8cc; Mon, 3 May 2021 21:35:53 +0000 (UTC) References: <20210424081402.26742-1-mail@cbaines.net> <877dkfv8n4.fsf@gnu.org> User-agent: mu4e 1.4.15; emacs 27.1 From: Christopher Baines To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to channel-instances->manifest. In-reply-to: <877dkfv8n4.fsf@gnu.org> Date: Mon, 03 May 2021 22:35:49 +0100 Message-ID: <87im3zcxfu.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 47989 Cc: 47989@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: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Christopher Baines skribis: > >> This allows computing a manifest for a specific system. Previously this = was >> possible, but only through changing %current-system, which caused the >> derivation to be computed using that system as well (so computing a deri= vation >> for aarch64-linux on x86_64-linux would require running aarch64-linux co= de). > > I remember discussing it, but I wonder if I was confused. > > I think you can always do the equivalent of (say): > > guix time-machine -- build -s armhf-linux hello -d > > =E2=80=A6 where Guix itself is built natively but it then computes a deri= vation > for a different architecture. > > The equivalent code would be roughly: > > (let ((inferior (inferior-for-channels =E2=80=A6))) > (inferior-package-derivation store > (car (lookup-inferior-packages inferior = "hello")) > "armhf-linux")) > > Does that make sense? Not really, this is just about manifests for channel instances, so nothing to do with package derivations as far as I'm aware. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmCQbLVfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9Xe2lw/9HG040zlINb539khwRpLC1JJgbBz+S4gq ELdKaIsIwSnV9KvGh6Oynvo8wXgjjhMuhWs13tZ5T6C147cDYa5BMH6O0UT2XU0o oRTNvvA/KHpDAYquYQiSVn8oifok4POe75jLCMlRlOqJmNc7SF1E3bCdXqjpauAh ZR19qbwicK53M+V/UuoXqamhKp1/4duqkQ6MLvuwQK+9PU26V4WzF+DpIv4CHeFA BDRW1xjVamHmYBVU/Cs8ItGVZGd045uDtjLjQTxnEx0UYi28XGXhJxsYFjwqwBcs 5G4dHgqqUgJnuWfdhZn6FKNFga6ccKLv928Yu/CHiBCc8zUOU4TAkDs0kVq8HKiJ ziS/kTYgIJzSM4y2rKpZ6uX72Xp2KT1w1uP+qOSoReIDWCyBtTqqcvPuw1gVtIFg MWPE0dX+sykHOOxFga585sYNlxbZn8PkkNl7bYIDEKEUELmQTrZAdHbP5S2Itz/v AiSegI/v3gP2uOp0mpsCDcRGAx+2yaXGKTannVqU1tk0KP7vqRDIAv3Izp3zaDW4 WSYLlwlH4Fi3Epeierh16lX+QzCFKdun3Y2YB91MM/YDapn1XjhJJS1DR7jwC7w0 0GVYnOXLUBM0iJTGF9xlxsHrsuiB3u3frcQO2fXbIbOIFbat4zv5scy63ilKpa/U AbbhWSrwXKM= =P1Oz -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 04 09:48:31 2021 Received: (at 47989) by debbugs.gnu.org; 4 May 2021 13:48:31 +0000 Received: from localhost ([127.0.0.1]:53335 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldvPb-0007xv-I6 for submit@debbugs.gnu.org; Tue, 04 May 2021 09:48:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldvPZ-0007xo-8R for 47989@debbugs.gnu.org; Tue, 04 May 2021 09:48:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52005) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldvPT-0002MX-Vs; Tue, 04 May 2021 09:48:23 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=59114 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ldvPT-00070g-Fg; Tue, 04 May 2021 09:48:23 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Christopher Baines Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to channel-instances->manifest. References: <20210424081402.26742-1-mail@cbaines.net> <877dkfv8n4.fsf@gnu.org> <87im3zcxfu.fsf@cbaines.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 15 =?utf-8?Q?Flor=C3=A9al?= an 229 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= 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: Tue, 04 May 2021 15:48:21 +0200 In-Reply-To: <87im3zcxfu.fsf@cbaines.net> (Christopher Baines's message of "Mon, 03 May 2021 22:35:49 +0100") Message-ID: <87eeemr4nu.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) 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: 47989 Cc: 47989@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 Christopher, Christopher Baines skribis: > Ludovic Court=C3=A8s writes: > >> Christopher Baines skribis: >> >>> This allows computing a manifest for a specific system. Previously this= was >>> possible, but only through changing %current-system, which caused the >>> derivation to be computed using that system as well (so computing a der= ivation >>> for aarch64-linux on x86_64-linux would require running aarch64-linux c= ode). >> >> I remember discussing it, but I wonder if I was confused. >> >> I think you can always do the equivalent of (say): >> >> guix time-machine -- build -s armhf-linux hello -d >> >> =E2=80=A6 where Guix itself is built natively but it then computes a der= ivation >> for a different architecture. >> >> The equivalent code would be roughly: >> >> (let ((inferior (inferior-for-channels =E2=80=A6))) >> (inferior-package-derivation store >> (car (lookup-inferior-packages inferior= "hello")) >> "armhf-linux")) >> >> Does that make sense? > > Not really, :-) > this is just about manifests for channel instances, so nothing to do > with package derivations as far as I'm aware. I re-read your message and must have misunderstood. It=E2=80=99s the deriv= ation of channel instances that you want for a given system, right? (What=E2=80= =99s the use case though?) In that case something along the lines of the patch makes perfect sense. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue May 04 09:52:46 2021 Received: (at 47989) by debbugs.gnu.org; 4 May 2021 13:52:46 +0000 Received: from localhost ([127.0.0.1]:53365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldvTi-00080P-FA for submit@debbugs.gnu.org; Tue, 04 May 2021 09:52:46 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40824) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldvTh-00080F-0p for 47989@debbugs.gnu.org; Tue, 04 May 2021 09:52:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52064) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldvTb-0004zW-DT; Tue, 04 May 2021 09:52:39 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=59124 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ldvTa-0007LZ-Uk; Tue, 04 May 2021 09:52:39 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Christopher Baines Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to channel-instances->manifest. References: <20210424081402.26742-1-mail@cbaines.net> Date: Tue, 04 May 2021 15:52:37 +0200 In-Reply-To: <20210424081402.26742-1-mail@cbaines.net> (Christopher Baines's message of "Sat, 24 Apr 2021 09:14:02 +0100") Message-ID: <878s4ur4gq.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) 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: 47989 Cc: 47989@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 (---) Christopher Baines skribis: > This allows computing a manifest for a specific system. Previously this w= as > possible, but only through changing %current-system, which caused the > derivation to be computed using that system as well (so computing a deriv= ation > for aarch64-linux on x86_64-linux would require running aarch64-linux cod= e). > > This new argument adds the possibility of computing derivations for non-n= ative > systems, without having to run non-native code. > > I'm looking at this as it will enable the Guix Data Service to compute ch= annel > instance derivations without relying on QEMU emulation for non-native > systems (it should be faster as well). > > * guix/channels.scm (build-from-source): Add #:system argument and pass to > build. > (build-channel-instance): Add system argument and pass to build-from-sour= ce. > (channel-instance-derivations): Add #:system argument and pass to > build-channel-instance, also rename system to current-system-value. > (channel-instances->manifest): Add #:system argument and pass to > channel-instance-derivations. [...] > (define* (build-from-source instance > - #:key core verbose? (dependencies '())) > + #:key core verbose? (dependencies '()) syste= m) > "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." Please mention SYSTEM in the docstring. > +(define* (channel-instance-derivations instances #:key system) > "Return the list of derivations to build INSTANCES, in the same order = as > INSTANCES." > (define core-instance > @@ -757,14 +759,15 @@ INSTANCES." > (resolve-dependencies instances)) >=20=20 > (define (instance->derivation instance) > - (mlet %store-monad ((system (current-system))) > + (mlet %store-monad ((current-system-value (current-system))) > (mcached (if (eq? instance core-instance) > - (build-channel-instance instance) > + (build-channel-instance instance system) > (mlet %store-monad ((core (instance->derivation core-= instance)) > (deps (mapm %store-monad instance= ->derivation > (edges instance)))) > - (build-channel-instance instance core deps))) > + (build-channel-instance instance system core deps))) > instance > + current-system-value > system))) Here, there should not be any additional key to =E2=80=98mcached=E2=80=99 s= ince there=E2=80=99s only one system being targeted. Instead, it should look something like this: (define (instance->derivation core-instance) (mlet %store-monad ((system (if system (return system) (current-system)= ))) (mcached =E2=80=A6 ;pass =E2=80=98system=E2=80=99 to callees instance system))) ;unchanged HTH, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed May 05 05:28:37 2021 Received: (at 47989) by debbugs.gnu.org; 5 May 2021 09:28:37 +0000 Received: from localhost ([127.0.0.1]:58993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leDpd-0006xg-5v for submit@debbugs.gnu.org; Wed, 05 May 2021 05:28:37 -0400 Received: from mira.cbaines.net ([212.71.252.8]:52918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leDpc-0006xa-Af for 47989@debbugs.gnu.org; Wed, 05 May 2021 05:28:36 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id 8190427BC81; Wed, 5 May 2021 10:28:35 +0100 (BST) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 655fced2; Wed, 5 May 2021 09:28:34 +0000 (UTC) References: <20210424081402.26742-1-mail@cbaines.net> <877dkfv8n4.fsf@gnu.org> <87im3zcxfu.fsf@cbaines.net> <87eeemr4nu.fsf@gnu.org> User-agent: mu4e 1.4.15; emacs 27.1 From: Christopher Baines To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to channel-instances->manifest. In-reply-to: <87eeemr4nu.fsf@gnu.org> Date: Wed, 05 May 2021 10:28:31 +0100 Message-ID: <8735v1cyww.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 47989 Cc: 47989@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: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Christopher Baines skribis: > >> Ludovic Court=C3=A8s writes: >> >>> Christopher Baines skribis: >>> >>>> This allows computing a manifest for a specific system. Previously thi= s was >>>> possible, but only through changing %current-system, which caused the >>>> derivation to be computed using that system as well (so computing a de= rivation >>>> for aarch64-linux on x86_64-linux would require running aarch64-linux = code). >>> >>> I remember discussing it, but I wonder if I was confused. >>> >>> I think you can always do the equivalent of (say): >>> >>> guix time-machine -- build -s armhf-linux hello -d >>> >>> =E2=80=A6 where Guix itself is built natively but it then computes a de= rivation >>> for a different architecture. >>> >>> The equivalent code would be roughly: >>> >>> (let ((inferior (inferior-for-channels =E2=80=A6))) >>> (inferior-package-derivation store >>> (car (lookup-inferior-packages inferio= r "hello")) >>> "armhf-linux")) >>> >>> Does that make sense? >> >> Not really, > > :-) > >> this is just about manifests for channel instances, so nothing to do >> with package derivations as far as I'm aware. > > I re-read your message and must have misunderstood. It=E2=80=99s the der= ivation > of channel instances that you want for a given system, right? (What=E2= =80=99s > the use case though?) In that case something along the lines of the > patch makes perfect sense. Yep, the Guix Data Service currently uses channel-instances->manifest to compute the channel instance derivations (which show up here for example [1]. Currently it computes the derivations for different systems by setting %current-system, but this has the side effect of also running the Guile code for computing the derivation with Guile for that system. 1: https://data.guix.gnu.org/revision/afec2784174058fdd85d9698e1fa748c45bfa= 8ee/channel-instances That effectively only works if QEMU binfmt support is available for those other systems. It would be faster just to use the native Guile, and this would also avoid substitute availability problems (I had to disable armhf-linux emulation on the data.guix.gnu.org machine when the substitute availability from ci.guix.gnu.org got worse recently as too much time was being spent just building armhf-linux things). --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmCSZT9fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XfjBRAAt9SoMJ9Y5/ekWOLaoqDwX7Um0aNimwwr YLmNOgzw2OMEp3x53dQ6qWyA023ULGv+OfBpm88B9LxRSdIOm2jq47+AY5XHKv5v 2LOIt46LsC2+UEQ1K1MeCf3f6NydyQ8akerXwppM74oPJHGvtfEK9jXwfSpn7lm4 6rQFbyCmwNMj2XGNfaKLR9iFzLv35JVSpcBHZV6KIerNcGFFnktyuVRRHwgjrIAM EkWyzfk2k0gj/9+ftqkwg1kUANwjX2wIm+V+9dZoABejihqXg5qrWo0mNItONdqh KfcAH+tMqstN1MId/8o8nbT9ND3vDllte9s1w5ZKCXgnFTezM2noG3AdixSoVOe6 uQ1qPnCULAp7s20qMVD6A5gJNIjalsdp1wdQEU54gxNn5I4rs71/hD+mBWjvPWQi DizzY7pjrEmc6uLybzTdaH13P0Sefr0WHCSLsRurtxdizvgNMJlXFJDJz/qyNiAi eTsP2ZhaeGnId8LKMpKuK49GvqVlfGymUWMuqZrXR5A+hx1XDq+PCHYwgpR+TwSv W54jMs25WPwm92KuZ2Qg8KvKH8+a4qQwdek+di5PyznYFARt/V+dmPw507QrZIu8 iI81N6J59wH7Je8lWnzj5FvmKZEd/FtNwRue7SeG3BDIjQ3kgNnV+CC+AlF7He2R l9boIsYbhE0= =Wmiz -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed May 05 07:24:24 2021 Received: (at 47989) by debbugs.gnu.org; 5 May 2021 11:24:24 +0000 Received: from localhost ([127.0.0.1]:59507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leFdg-0008Qh-Cd for submit@debbugs.gnu.org; Wed, 05 May 2021 07:24:24 -0400 Received: from mira.cbaines.net ([212.71.252.8]:53002) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leFdc-0008Qb-Mi for 47989@debbugs.gnu.org; Wed, 05 May 2021 07:24:22 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id D635227BC81 for <47989@debbugs.gnu.org>; Wed, 5 May 2021 12:24:19 +0100 (BST) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 34e18058 for <47989@debbugs.gnu.org>; Wed, 5 May 2021 11:24:19 +0000 (UTC) From: Christopher Baines To: 47989@debbugs.gnu.org Subject: [PATCH v2] channels: Add a #:system argument to channel-instances->manifest. Date: Wed, 5 May 2021 12:24:19 +0100 Message-Id: <20210505112419.14893-1-mail@cbaines.net> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 47989 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 (-) This allows computing a manifest for a specific system. Previously this was possible, but only through changing %current-system, which caused the derivation to be computed using that system as well (so computing a derivation for aarch64-linux on x86_64-linux would require running aarch64-linux code). This new argument adds the possibility of computing derivations for non-native systems, without having to run non-native code. I'm looking at this as it will enable the Guix Data Service to compute channel instance derivations without relying on QEMU emulation for non-native systems (it should be faster as well). * guix/channels.scm (build-from-source): Add #:system argument and pass to build. (build-channel-instance): Add system argument and pass to build-from-source. (channel-instance-derivations): Add #:system argument and pass to build-channel-instance, also rename system to current-system-value. (channel-instances->manifest): Add #:system argument and pass to channel-instance-derivations. --- guix/channels.scm | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/guix/channels.scm b/guix/channels.scm index c40fc0c507..476d62e1f4 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -657,10 +657,11 @@ that unconditionally resumes the continuation." store)))) (define* (build-from-source instance - #:key core verbose? (dependencies '())) + #:key core verbose? (dependencies '()) system) "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." +SOURCE using CORE, an instance of Guix. By default, build for the current +system, or SYSTEM if specified." (define name (symbol->string (channel-name (channel-instance-channel instance)))) @@ -700,20 +701,22 @@ SOURCE using CORE, an instance of Guix." (with-trivial-build-handler (build source #:verbose? verbose? #:version commit + #:system system #:channel-metadata (channel-instance->sexp instance) #:pull-version %pull-version)))) ;; Build a set of modules that extend Guix using the standard method. (standard-module-derivation name source core dependencies))) -(define* (build-channel-instance instance +(define* (build-channel-instance instance system #:optional core (dependencies '())) "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." +instance, for SYSTEM. DEPENDENCIES is a list of extensions providing Guile +modules that INSTANCE depends on." (build-from-source instance #:core core - #:dependencies dependencies)) + #:dependencies dependencies + #:system system)) (define (resolve-dependencies instances) "Return a procedure that, given one of the elements of INSTANCES, returns @@ -743,9 +746,9 @@ list of instances it depends on." (lambda (instance) (vhash-foldq* cons '() instance edges))) -(define (channel-instance-derivations instances) +(define* (channel-instance-derivations instances #:key system) "Return the list of derivations to build INSTANCES, in the same order as -INSTANCES." +INSTANCES. Build for the current system by default, or SYSTEM if specified." (define core-instance ;; The 'guix' channel is treated specially: it's an implicit dependency of ;; all the other channels. @@ -757,13 +760,13 @@ INSTANCES." (resolve-dependencies instances)) (define (instance->derivation instance) - (mlet %store-monad ((system (current-system))) + (mlet %store-monad ((system (if system (return system) (current-system)))) (mcached (if (eq? instance core-instance) - (build-channel-instance instance) + (build-channel-instance instance system) (mlet %store-monad ((core (instance->derivation core-instance)) (deps (mapm %store-monad instance->derivation (edges instance)))) - (build-channel-instance instance core deps))) + (build-channel-instance instance system core deps))) instance system))) @@ -865,9 +868,10 @@ derivation." intro)))))) '())))) -(define (channel-instances->manifest instances) +(define* (channel-instances->manifest instances #:key system) "Return a profile manifest with entries for all of INSTANCES, a list of -channel instances." +channel instances. By default, build for the current system, or SYSTEM if +specified." (define (instance->entry instance drv) (let ((commit (channel-instance-commit instance)) (channel (channel-instance-channel instance))) @@ -883,7 +887,8 @@ channel instances." (properties `((source ,(channel-instance->sexp instance))))))) - (mlet* %store-monad ((derivations (channel-instance-derivations instances)) + (mlet* %store-monad ((derivations (channel-instance-derivations instances + #:system system)) (entries -> (map instance->entry instances derivations))) (return (manifest entries)))) -- 2.30.1 From debbugs-submit-bounces@debbugs.gnu.org Wed May 05 07:25:16 2021 Received: (at 47989) by debbugs.gnu.org; 5 May 2021 11:25:16 +0000 Received: from localhost ([127.0.0.1]:59518 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leFeW-0008Rk-1I for submit@debbugs.gnu.org; Wed, 05 May 2021 07:25:16 -0400 Received: from mira.cbaines.net ([212.71.252.8]:53012) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1leFeU-0008Re-L0 for 47989@debbugs.gnu.org; Wed, 05 May 2021 07:25:15 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id 404E327BC81; Wed, 5 May 2021 12:25:14 +0100 (BST) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 30717df0; Wed, 5 May 2021 11:25:14 +0000 (UTC) References: <20210424081402.26742-1-mail@cbaines.net> <878s4ur4gq.fsf@gnu.org> User-agent: mu4e 1.4.15; emacs 27.1 From: Christopher Baines To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to channel-instances->manifest. In-reply-to: <878s4ur4gq.fsf@gnu.org> Date: Wed, 05 May 2021 12:25:11 +0100 Message-ID: <87wnsdbey0.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 47989 Cc: 47989@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: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Christopher Baines skribis: > >> This allows computing a manifest for a specific system. Previously this = was >> possible, but only through changing %current-system, which caused the >> derivation to be computed using that system as well (so computing a deri= vation >> for aarch64-linux on x86_64-linux would require running aarch64-linux co= de). >> >> This new argument adds the possibility of computing derivations for non-= native >> systems, without having to run non-native code. >> >> I'm looking at this as it will enable the Guix Data Service to compute c= hannel >> instance derivations without relying on QEMU emulation for non-native >> systems (it should be faster as well). >> >> * guix/channels.scm (build-from-source): Add #:system argument and pass = to >> build. >> (build-channel-instance): Add system argument and pass to build-from-sou= rce. >> (channel-instance-derivations): Add #:system argument and pass to >> build-channel-instance, also rename system to current-system-value. >> (channel-instances->manifest): Add #:system argument and pass to >> channel-instance-derivations. > > [...] > >> (define* (build-from-source instance >> - #:key core verbose? (dependencies '())) >> + #:key core verbose? (dependencies '()) syst= em) >> "Return a derivation to build Guix from INSTANCE, using the self-build >> script contained therein. When CORE is true, build package modules und= er >> SOURCE using CORE, an instance of Guix." > > Please mention SYSTEM in the docstring. > >> +(define* (channel-instance-derivations instances #:key system) >> "Return the list of derivations to build INSTANCES, in the same order= as >> INSTANCES." >> (define core-instance >> @@ -757,14 +759,15 @@ INSTANCES." >> (resolve-dependencies instances)) >> >> (define (instance->derivation instance) >> - (mlet %store-monad ((system (current-system))) >> + (mlet %store-monad ((current-system-value (current-system))) >> (mcached (if (eq? instance core-instance) >> - (build-channel-instance instance) >> + (build-channel-instance instance system) >> (mlet %store-monad ((core (instance->derivation core= -instance)) >> (deps (mapm %store-monad instanc= e->derivation >> (edges instance)))) >> - (build-channel-instance instance core deps))) >> + (build-channel-instance instance system core deps)= )) >> instance >> + current-system-value >> system))) > > Here, there should not be any additional key to =E2=80=98mcached=E2=80=99= since there=E2=80=99s > only one system being targeted. > > Instead, it should look something like this: > > (define (instance->derivation core-instance) > (mlet %store-monad ((system (if system (return system) (current-syste= m)))) > (mcached =E2=80=A6 ;pass =E2=80=98system=E2=80=99 to callees > instance > system))) ;unchanged Sure, I've sent an updated patch that updates docstrings and makes the above changes. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmCSgJdfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XeSDBAAoXNdAZAcBj4ofKRsHG+s+s8Lcgdbkmcl OUNo0fsmpjPbs3N4SQ0SoMpMVsm5IgSC8QkiUPWJGpoOWxOsMADqepxCvRm7Zv68 UEmf4u926NHKKi5WfKLnTP90Qxi7mD+uQMyWJ/KkiOORdsUcfPoZr1EPnfD062v8 ypnXQBmIJ9bN9231uP7IeY4qA2+4mYdi8aQDk4ckVfXLBeTPg21rN0lIbi4sT0Aj iUKWGZNIw3mavxdjkYBKxW9v5FRT4QwI6p4dkzGg7YfJyBXb166gIWOXMIKYEMk+ Lm9vse9BrZvlX7BUKcSHUeCUGRAvKE5NFZx+8t3Wb1tp9qxoIbhcZp6npMSMEUN9 c6gwpKZreTnjUyr/ml5/wZsYRj+8RCJvNLy2x9IzJaBEBWXWPcMHnRlhO2dPzTn9 EYjU+TzyYltYjbY2iYbviFEZyFkwnLpGqTwTCCcnuzMNN93CLpBMqgY5JBFCp5XH SZbF7dALz6iDYALRVfbQwKi9xk+DCmRLMjxa+UG1GoiZd4UoKBgsdQ6bGYWu+a+k HBMah7WOrDVwc0F/28ewdK5RkN8rtHiFe9LDuvCRtn6Eel0TPwVSJJcVRyVsD9KA SML1//MvczJusYOlvqUOBTXT1yTwdueD+qWZxsejT5p0Br5wEZD9oG62GJNUM82D PUJW9zTtDkw= =fSCv -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue May 11 04:48:45 2021 Received: (at 47989) by debbugs.gnu.org; 11 May 2021 08:48:45 +0000 Received: from localhost ([127.0.0.1]:34898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgO4K-0002NN-Ot for submit@debbugs.gnu.org; Tue, 11 May 2021 04:48:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgO4I-0002NA-Op for 47989@debbugs.gnu.org; Tue, 11 May 2021 04:48:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42388) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgO4C-0003D7-JF; Tue, 11 May 2021 04:48:37 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=40044 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgO4C-0005Ac-8j; Tue, 11 May 2021 04:48:36 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Christopher Baines Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to channel-instances->manifest. References: <20210424081402.26742-1-mail@cbaines.net> <877dkfv8n4.fsf@gnu.org> <87im3zcxfu.fsf@cbaines.net> <87eeemr4nu.fsf@gnu.org> <8735v1cyww.fsf@cbaines.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 22 =?utf-8?Q?Flor=C3=A9al?= an 229 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= 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: Tue, 11 May 2021 10:48:35 +0200 In-Reply-To: <8735v1cyww.fsf@cbaines.net> (Christopher Baines's message of "Wed, 05 May 2021 10:28:31 +0100") Message-ID: <874kf94pwc.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) 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: 47989 Cc: 47989@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, Christopher Baines skribis: > Yep, the Guix Data Service currently uses channel-instances->manifest to > compute the channel instance derivations (which show up here for example > [1]. Currently it computes the derivations for different systems by > setting %current-system, but this has the side effect of also running > the Guile code for computing the derivation with Guile for that system. > > 1: https://data.guix.gnu.org/revision/afec2784174058fdd85d9698e1fa748c45b= fa8ee/channel-instances I see, that=E2=80=99s because you explicitly want to channel derivations for several systems in this case. Got it! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue May 11 04:52:15 2021 Received: (at 47989) by debbugs.gnu.org; 11 May 2021 08:52:15 +0000 Received: from localhost ([127.0.0.1]:34902 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgO7j-0002UV-8h for submit@debbugs.gnu.org; Tue, 11 May 2021 04:52:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgO7h-0002UF-TY for 47989@debbugs.gnu.org; Tue, 11 May 2021 04:52:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:42414) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgO7c-00051E-Hs; Tue, 11 May 2021 04:52:08 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=40056 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgO7X-0005PL-U5; Tue, 11 May 2021 04:52:08 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Christopher Baines Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to channel-instances->manifest. References: <20210424081402.26742-1-mail@cbaines.net> <20210505112419.14893-1-mail@cbaines.net> Date: Tue, 11 May 2021 10:52:02 +0200 In-Reply-To: <20210505112419.14893-1-mail@cbaines.net> (Christopher Baines's message of "Wed, 5 May 2021 12:24:19 +0100") Message-ID: <87zgx13b65.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) 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: 47989 Cc: 47989@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 (---) Christopher Baines skribis: > This allows computing a manifest for a specific system. Previously this w= as > possible, but only through changing %current-system, which caused the > derivation to be computed using that system as well (so computing a deriv= ation > for aarch64-linux on x86_64-linux would require running aarch64-linux cod= e). > > This new argument adds the possibility of computing derivations for non-n= ative > systems, without having to run non-native code. > > I'm looking at this as it will enable the Guix Data Service to compute ch= annel > instance derivations without relying on QEMU emulation for non-native > systems (it should be faster as well). > > * guix/channels.scm (build-from-source): Add #:system argument and pass to > build. > (build-channel-instance): Add system argument and pass to build-from-sour= ce. > (channel-instance-derivations): Add #:system argument and pass to > build-channel-instance, also rename system to current-system-value. > (channel-instances->manifest): Add #:system argument and pass to > channel-instance-derivations. LGTM! (Please double-check that =E2=80=98make as-derivation=E2=80=99 or =E2=80=98= guix pull --url=3D$PWD =E2=80=A6=E2=80=99 work, in case we overlooked something.) Thank you, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed May 12 04:53:04 2021 Received: (at 47989-done) by debbugs.gnu.org; 12 May 2021 08:53:04 +0000 Received: from localhost ([127.0.0.1]:38157 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgkc4-0001mh-3S for submit@debbugs.gnu.org; Wed, 12 May 2021 04:53:04 -0400 Received: from mira.cbaines.net ([212.71.252.8]:33540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgkc2-0001mH-Fg for 47989-done@debbugs.gnu.org; Wed, 12 May 2021 04:53:03 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id 6CCAE27BC81; Wed, 12 May 2021 09:53:01 +0100 (BST) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id d1929990; Wed, 12 May 2021 08:53:01 +0000 (UTC) References: <20210424081402.26742-1-mail@cbaines.net> <20210505112419.14893-1-mail@cbaines.net> <87zgx13b65.fsf_-_@gnu.org> User-agent: mu4e 1.4.15; emacs 27.1 From: Christopher Baines To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#47989: [PATCH] channels: Add a #:system argument to channel-instances->manifest. In-reply-to: <87zgx13b65.fsf_-_@gnu.org> Date: Wed, 12 May 2021 09:52:58 +0100 Message-ID: <87k0o41ggl.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 47989-done Cc: 47989-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: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s writes: > Christopher Baines skribis: > >> This allows computing a manifest for a specific system. Previously this = was >> possible, but only through changing %current-system, which caused the >> derivation to be computed using that system as well (so computing a deri= vation >> for aarch64-linux on x86_64-linux would require running aarch64-linux co= de). >> >> This new argument adds the possibility of computing derivations for non-= native >> systems, without having to run non-native code. >> >> I'm looking at this as it will enable the Guix Data Service to compute c= hannel >> instance derivations without relying on QEMU emulation for non-native >> systems (it should be faster as well). >> >> * guix/channels.scm (build-from-source): Add #:system argument and pass = to >> build. >> (build-channel-instance): Add system argument and pass to build-from-sou= rce. >> (channel-instance-derivations): Add #:system argument and pass to >> build-channel-instance, also rename system to current-system-value. >> (channel-instances->manifest): Add #:system argument and pass to >> channel-instance-derivations. > > LGTM! > > (Please double-check that =E2=80=98make as-derivation=E2=80=99 or =E2=80= =98guix pull --url=3D$PWD =E2=80=A6=E2=80=99 > work, in case we overlooked something.) Great, I've pushed this as 34985fb6ae7deffd40443766f5408649a0cbbff2 now. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmCbl2pfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9Xf2Kg/8CYyTzmHgP4149c4x4HyhzWVjh2+Yr6l8 tPlAl2c0052cT7CuS0mn4HBdUaVmqprGkBVirGaUdHqVMXb+f0zBS3e5rV5KfdHj z+xnRV9hEovw26936JKGuAaHpDJPZvnLF7eLnI4hH9n+DIE8NR4QJiiPpkccI4wl X2diftGBy0NY1F3JFoCrxLkK+WODSEzIt9uXCX+PECxwkXSJZFF+VG4DS13zmHto aei+T9JQwMqQfgnUv4FxKBdL05sbvlUCK/hler7rvHQPNs8Lf+jfoo3ZgmGKChj5 ebBedj531G5S4iYJx+7vjMrBKSMKJtSwpeeQyHBUWfIpQYyXEWQCxHGce3FV44Vy sLhh1sfd7jrtj+hpPaHBOuBttM0kxAgr0pKUHVVK3DpxyunzOI7gqvvzzFsZi57n HKRPh5+TswZTuubqYf08r6bzfT2kVEhS9k6QMUjuiZRAY0L2SZ6MstftV4WpSjpZ T5+nc3pMUmhLp7IuOskJv4NNgwE12yKJ1a927f5IQDcEkH7wfZRmrVOcRbbjx/RM 24ShOBf2pwHWQgVUHeWTuJ+Q0Bqi6QzidqEOLfzNQALmb7+JC5Pj4L8Z2vZrhgQ8 c+nhcWmjmaIMSeQBEoDjkIaNEsMyioe6HJsyvm7A/64eNnP9d3ARrMyijSSJaXTa 5wnVKkJi8pU= =ET3e -----END PGP SIGNATURE----- --=-=-=-- From unknown Sun Jun 22 22:45:57 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 09 Jun 2021 11:24:09 +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