From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qEzmOPlRkWCYCwEAgWs5BA (envelope-from ) for ; Tue, 04 May 2021 15:54:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id uNeaNPlRkWBzHwAA1q6Kng (envelope-from ) for ; Tue, 04 May 2021 13:54:01 +0000 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 99B6917B60 for ; Tue, 4 May 2021 15:54:01 +0200 (CEST) Received: from localhost ([::1]:55608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldvUu-0001Rd-CZ for larch@yhetil.org; Tue, 04 May 2021 09:54:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49174) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldvU0-0000ju-3C for guix-patches@gnu.org; Tue, 04 May 2021 09:53:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41821) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldvTy-0005Ac-Cm for guix-patches@gnu.org; Tue, 04 May 2021 09:53:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ldvTy-00080k-AU for guix-patches@gnu.org; Tue, 04 May 2021 09:53:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47989] [PATCH] channels: Add a #:system argument to channel-instances->manifest. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 04 May 2021 13:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47989 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Cc: 47989@debbugs.gnu.org Received: via spool by 47989-submit@debbugs.gnu.org id=B47989.162013636630781 (code B ref 47989); Tue, 04 May 2021 13:53:02 +0000 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= 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-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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620136441; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: 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; bh=V150R4Z2zGDh0eRZmwjiUJfJMQNVvW06UOhNwZYLrYs=; b=R8HbF9pruUZQLsLN5bZJfDHpDWMxKrTjludtg4VY+E13/TZska+9H5VC0wQ6w5MetCr9F3 +ueEX0YFn2i8IrwTyiCHbfk+dQtRPD5vy32ExPQm2AjhwKuYQbtOhKdHgywNiUVIC1b3oT hfCcj8a5G0jvWWUMBzVKI6lgItvwIb05w/2tkR+HmRUGK2pD3WCgPugjM9YnbK4vpcJIKr M7MUfIsCNKK3itqiJlAdCvvw2v9IBFzER9CGHTVrOy0SduH0UpDkixMslf3pAjXdYrK9WW cGKRwRt/yBiOC+kU1/B0QP7jIASDWEYYRgsteZn+meXt/olX4AxY53dJsPGEgA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620136441; a=rsa-sha256; cv=none; b=tz9kGG3YTTelgnaRTWyyqfM9cNxCI5/f1l1ZfSXOsew3paSjEUmgsaNd6s1MlhL9d5QnYU C3nlwNu9mT3mySuK2tS3UneK/h7+3KTrWS6Mdz/4S51qtFNjo6eiuFQDXl2lYceDYE/5IY ce4VbGlUwnYw51PbjFbU+Aww1pf+uOynqJCDDIz4LLkWjHTamMzDTUVB48/uh8VdGnAg6h 422cM5EKr+vRnQqoXAy+CmDAzJIm7SCvv8LVTv+Jc2g8+aaPiL7fv6Pr7Q3CAZEPQY8351 /Phw8CNg3SUDvkGkLG3B55o9BDVXHLIwPug44nOUZXy8a0lp9FPAzSZmo/3M9Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.96 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 99B6917B60 X-Spam-Score: -2.96 X-Migadu-Scanner: scn0.migadu.com X-TUID: PLA187HJx0ZC 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.