From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6F0wNP5UrmC+hQAAgWs5BA (envelope-from ) for ; Wed, 26 May 2021 16:02:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id SHztL/5UrmDpEAAAB5/wlQ (envelope-from ) for ; Wed, 26 May 2021 14:02:38 +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 0AA1A9A1E for ; Wed, 26 May 2021 16:02:38 +0200 (CEST) Received: from localhost ([::1]:60940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llu7I-0000Oo-V7 for larch@yhetil.org; Wed, 26 May 2021 10:02:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llu77-0000KT-2n for guix-devel@gnu.org; Wed, 26 May 2021 10:02:25 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34930) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1llu76-000101-Cy; Wed, 26 May 2021 10:02:24 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=50704 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1llu74-0007al-VJ; Wed, 26 May 2021 10:02:23 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Nicolas Goaziou Subject: Re: [PATCH RFC 0/4] Getting rid of input labels? References: <20210520145830.14108-1-ludo@gnu.org> <87wnrsw15h.fsf@nicolasgoaziou.fr> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 7 Prairial an 229 de la =?utf-8?Q?R=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: Wed, 26 May 2021 16:02:21 +0200 In-Reply-To: <87wnrsw15h.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Fri, 21 May 2021 17:35:06 +0200") Message-ID: <87y2c1twya.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: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1622037758; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=YDnTjgoivZ9J1Mo+Ywj4P4wgcuxV+ftpaBc3/jv8+pg=; b=jvphs6p3+hYU3djx8gcE+etv3XUYGsCMYYAIOsNCYFBJk1pTvhycC77WzcssqHJHbqYAF1 J4B3oxiMkiDZ58HHtoNo2DdjFDW9qZy8ltyXlfjIvjj7Rp6FAJz5r77OzRf4IkPDO+5Hap QbSZXaKmYHz63/CxWV16gv4ff1opZmrqL9DLhnKo15o6M7hs0hMJTzSUa5JfS+dEGLG887 6Knas+PAWk2POTKe5YNrIFjy3+fh+cYSF4sDLRmeP74A9ugomeyi8kf8/JVun0w4H9WMUI hGOWZpuZ2eNWMbkqyMHfFoOjxVQGxZdQIYUf9W+fSlhKMfWE3hq+robTH/Gkjg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1622037758; a=rsa-sha256; cv=none; b=EyfVnmBZnjaSmIClXyij0X3DG1w7khbbyQYnpb874NbkPw1yD+8gLKqxc3wblW/HVOj53j IrDUtchIUpU6VnGgzfW8gL67lc33dX9qx6m1P/6LkNOpbmN8zpRV/m8RNO8UpWF3Yu4cIU UJtU40oPvc3oOjcN5LJEBmqOw0ul0GFSCkY8eLM5PLXfqeJRer60IL5AbBE+j8vNVc1tx6 JZ92kTLyZsaHks1TH1V11LlkFxvKNL6zaPUT8fKJpa4e1nsnXdI7+JWpt1dEN5Qviun2Xt 4Sd13a3H0iq4XPsdBy8ofO++gyiFj+Z21StdtA/DbzXo1yqqudlXIsmFfwsYaA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -1.93 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 0AA1A9A1E X-Spam-Score: -1.93 X-Migadu-Scanner: scn1.migadu.com X-TUID: 2kPjCzB5fthA Hello, Nicolas Goaziou skribis: > Ludovic Court=C3=A8s writes: [...] >> =E2=80=A2 Packages such as =E2=80=98tzdata=E2=80=99 use labels to refe= r to non-package >> inputs. These cannot be converted to the automatic labeling >> style, or not without extra changes. > > Would it be possible to write something like > > (inputs (let ((tzcode (origin ...))) > (list ... tzcode ...))) > > ? Yes, but the problem is that the automatically-assigned label for records is =E2=80=9C_=E2=80=9D (a placeholder), because origins ha= ve no name, unlike packages. Thus, this phase: (replace 'unpack (lambda* (#:key source inputs #:allow-other-keys) (invoke "tar" "xvf" source) (invoke "tar" "xvf" (assoc-ref inputs "tzcode")))) =E2=80=A6 needs to be written differently, because there=E2=80=99s no =E2= =80=9Ctzcode=E2=80=9D label. One option on =E2=80=98core-updates=E2=80=99 is to use gexps: #~(modify-phases %standard-phases ;; =E2=80=A6 (replace 'unpack (lambda* (#:key source inputs #:allow-other-keys) (invoke "tar" "xvf" source) (invoke "tar" "xvf" #$tzcode)))) However, this style breaks common uses of =E2=80=98inherit=E2=80=99 and use= s of the inputs field: =E2=80=98tzcode=E2=80=99 here need not even be listed in =E2= =80=98inputs=E2=80=99, and consequently, you cannot easily inherit from =E2=80=98tzdata=E2=80=99 and g= ive it a different =E2=80=98tzcode=E2=80=99. We need to find and encourage appropriate idioms for corner cases like this. One option is the status quo: keep using labels in those rare cases. A crazier option would be to interpret input lists, when possible, as both input lists and formal parameter lists for =E2=80=98arguments=E2=80=99= . Assume a package with: (inputs (list foo bar baz)) The =E2=80=98arguments=E2=80=99 field, which is currently a thunk, would ma= gically be turned into: (lambda (foo bar baz) =E2=80=A6) That way, arguments could refer to #$foo etc., and that=E2=80=99d just do t= he right thing when inputs are overridden. This would be reaching a level of magic that may not be wise, and it may be hard to implement. > Could the new syntax accept both variables and specifications, e.g., > > (list "glib:bin" foo "bar@2.3") > > ? No! I mean, yes it could, but no, I don=E2=80=99t think that=E2=80=99s a g= ood idea. :-) In terms of API, I prefer clarity; in this case, I think inputs should be a list of packages or other =E2=80=9Clowerable=E2=80=9D objects, rather = than a list of =E2=80=9Canything=E2=80=9D that could be magically interpreted at run ti= me. More importantly, I think package specs are a UI feature, and that packages should be separate from UI concerns. Specs are implemented in (gnu packages), not in (guix =E2=80=A6) for a reason: it=E2=80=99s a featur= e that makes sense in the distro, not in the core Guix machinery where there=E2=80=99s no =E2=80=9Cpackage set=E2=80=9D to traverse. I hope that makes sense! Ludo=E2=80=99.