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 4T+nJlqBkmBDOgAAgWs5BA (envelope-from ) for ; Wed, 05 May 2021 13:28:26 +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 KM7TIVqBkmB2OwAA1q6Kng (envelope-from ) for ; Wed, 05 May 2021 11:28:26 +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 412532A0A5 for ; Wed, 5 May 2021 13:28:26 +0200 (CEST) Received: from localhost ([::1]:59024 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1leFhZ-0003OH-DA for larch@yhetil.org; Wed, 05 May 2021 07:28:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52686) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leFfG-0000is-7P for guix-patches@gnu.org; Wed, 05 May 2021 07:26:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47976) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1leFfG-0002Ig-0O for guix-patches@gnu.org; Wed, 05 May 2021 07:26:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1leFfF-0008S6-Rg for guix-patches@gnu.org; Wed, 05 May 2021 07:26:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#47989] [PATCH] channels: Add a #:system argument to channel-instances->manifest. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 05 May 2021 11:26:01 +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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 47989@debbugs.gnu.org Received: via spool by 47989-submit@debbugs.gnu.org id=B47989.162021391632476 (code B ref 47989); Wed, 05 May 2021 11:26:01 +0000 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 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-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=1620214106; 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: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=Pp/YpnO284VeTNjUVBdPyHZKjkLo0JaRfEsZ32gu3aQ=; b=VHGmPkwvWn3Ajdb9tucPpxIH6g+DxfuE4G5jd5as+1+tPslALGdgubU42FFCCbYRyf56Di BZ9DyShwvQllNyUajtdmyecjisUI3FT9QQbcaVjG7zup6TVaxAFi1w4vBcOp0BJUyQYkIw 8rrhhwVgNKEMbG0Zq0chxcZr7NoWPCpDJ3CPZjt7NICUbGwpulBlzzO7Dxuv7QxyudTwGy OmL7ZeGjngW0sJHDBNgN8E3fYnB9jCXLeW1PJ+afz9YMaEXIAumH18NWlc80NV/r69oOes izi2qNA1IfYtqWBsz8EkkdUXX2KJHkdscbBIhSQheOnqovIXGGkHmcFIK4qf+g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620214106; a=rsa-sha256; cv=none; b=AqTb+b/ot7f/7+94/EWnlNQVbl9qpyxGSAFW5J54Tsg41cENML1X161fU+vjnNNkQJPyvm WXOo+52Sy9Nc2TPU9s+Q791TlR5Uy+l7+fBS6ok3BlU2dG6WnPvcy7bud226dOfMdNB9Ps TbxISD9WY3ALVr5WxZgJQ8Dehd++kRI31YcbnoRBL0gFUlwnWmdHnq3pf581jcM6stIZpW +/GzPuMiEyFJcG8UVGc6EoCkCOcBkiprXGBi0ozYEjn2jT8HqURO2X+xifa6+/L52A/GuF VaSx/YOiDggQ1V53Vwu0ukBXpBNTsMTYUoxen+EZJv0pRXR/h0N3jtSmhembiA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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: -4.56 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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: 412532A0A5 X-Spam-Score: -4.56 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3r+ZpFOeiqEr --=-=-= 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----- --=-=-=--