From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YD6XON392WFQ9QAAgWs5BA (envelope-from ) for ; Sat, 08 Jan 2022 22:10:53 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id eJ7CNd392WGRCgAA9RJhRA (envelope-from ) for ; Sat, 08 Jan 2022 22:10:53 +0100 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 930A516227 for ; Sat, 8 Jan 2022 22:10:53 +0100 (CET) Received: from localhost ([::1]:35638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n6IzE-0006II-Pj for larch@yhetil.org; Sat, 08 Jan 2022 16:10:52 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57878) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6Iz3-0006I3-MK for guix-devel@gnu.org; Sat, 08 Jan 2022 16:10:41 -0500 Received: from [2a0c:e300::1] (port=45416 helo=hera.aquilenet.fr) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n6Iz1-0004Iv-Nu for guix-devel@gnu.org; Sat, 08 Jan 2022 16:10:41 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 10F53283; Sat, 8 Jan 2022 22:10:36 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4p_xg-6G9ska; Sat, 8 Jan 2022 22:10:35 +0100 (CET) Received: from ribbon (unknown [IPv6:2a01:e0a:1d:7270:af76:b9b:ca24:c465]) by hera.aquilenet.fr (Postfix) with ESMTPSA id CBC16212; Sat, 8 Jan 2022 22:10:34 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Zhu Zihao Subject: Re: search-input-file vs (assoc-ref inputs) References: <86y23rblbz.fsf@163.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 19 =?utf-8?Q?Niv=C3=B4se?= an 230 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: Sat, 08 Jan 2022 22:10:34 +0100 In-Reply-To: <86y23rblbz.fsf@163.com> (Zhu Zihao's message of "Fri, 07 Jan 2022 23:34:11 +0800") Message-ID: <87iluu3pdh.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-Spamd-Bar: / X-Rspamd-Server: hera X-Rspamd-Queue-Id: 10F53283 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[163.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[163.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a0c:e300::1 (failed) Received-SPF: softfail client-ip=2a0c:e300::1; envelope-from=ludo@gnu.org; helo=hera.aquilenet.fr X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_00=-1.9, RDNS_NONE=0.793, SPF_HELO_PASS=-0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 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 X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1641676253; 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=99SF4Tq2atMqeitd2PMaucPxCWsZeMQG+xZ3G+nNJog=; b=tVRPCOmoxRnL91VoE0hSXdO+pGKoE/PxwQrYGOSo502e5eacHm5bOj6RRSeI0F13AcRa4c ukNxNOx4SXaervVIq5W8zb4sjQaj4SiVc3XdL1gHkXMhATJGaGgl913EtqM4MMi6HPfklZ PD4sH+xDDGbCyq5bn5vI6t9NIXbw3KlRnGYcsSVwcCvgn8fFqIcdq/DrbP+0nnZ2CmyQ0r RfUp6mPTsnfF5/EUF/GB8f0yoOdemIETdcHzuR8OyVQqxhXxanO2ShNU1DToE4690qbcVP XuKWYkymcDHDpdt+5/RvDwQt9a7Pc8dq96Ne/62vNUk5OCF6HJT+PhtTQkK/BQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641676253; a=rsa-sha256; cv=none; b=puRGcKTccfAtYohseOFdbgqHGxL8WA3Ws0A4hvfO+xFfTl/Y6aV7yK1u451Gn9T3tb4DD5 VFkBbbKHUE582hs3QX7y4uVAWlH8ty/i29Ys0TfR9kmOTZRwcAI3qrG0PmvUzc3YCTUBsl RrYM93XwLPbQV3PVNJpwyGSt9yISYOxu0nxSyTIT2WvzzVszqTMIcvtE4uhYCu2PG5HoZM eG+L4Yo4iGZ/7uM3+XAvUbDyx5X3/NJFym9SCGUge1jUOEFP4UvmYDD3Cc3v/4tVH7Y7gE k3hRaiQUdxVYEbbKMBXQlsppCXaMFNKMkF3RWAbkC6DwTpDx21NIY0Is2mGIDw== 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-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.60 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+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 930A516227 X-Spam-Score: -3.60 X-Migadu-Scanner: scn1.migadu.com X-TUID: LrDxZc51XfPo Hi, Zhu Zihao skribis: > Some of my concern about label-less style inputs. > > 1. How can we refer to a non-package input? Some code might use > something like > > (inputs > `(("xxxx.patch" ,(origin ....)))) You can either keep labels or, what I would recommend, use gexps and =E2=80=98local-file=E2=80=99. An example of that is commit a21590dabfcef0aa008503ea981364b90750b07c. > If I want to replace this patch, I can simply use list operations from > SRFI-1 to manipulate it. But in label-less style, there's no label for a > object. Packagers may try to embed these objects into the build > expression using `ungexp`. But I think it violates the dependency > inversion principle(We don't rely on label, but rely on concrete > object). That=E2=80=99s true. OTOH, I think one rarely wants to override a patch be= cause the patch is usually closely tied to the =E2=80=98source=E2=80=99 origin an= yway. But yeah, if you have a concrete example, we could see how well that works there. > 2. libgcc, libgcc is a specific output of gcc. IIUC in build expression, > it shares label with gcc, gcc is an implicit input in many build > system. It's not so convenience for me to refer libgcc. > > For example, I want to set up the `LD_LIBRARY_PATH` for testing. it's > better to use `(string-append (this-package-inputs "libgcc") "/lib")`. > But I can't do this, the label of libgcc is "hidden". > `search-input-directory` doesn't work here because "/lib" is a common > directory exists in many package. I have to write `(dirname > (search-input-file input "libstdc++.so.6"))`, so ugly... I=E2=80=99d do (dirname (search-input-file input "/lib/libstdc++.so.6")). That=E2=80=99s not pretty, but I wouldn=E2=80=99t call it =E2=80=9Cugly=E2= =80=9D either. :-) Before that, you would refer to a label that doesn=E2=80=99t actually appea= r in the package=E2=80=99s input (because GCC is an implicit input), which wasn= =E2=80=99t better IMO. As I wrote back in , there are idioms we used before and that don=E2=80=99t have an obvious or pleasant translati= on in the label-less style. I think we should look together at those concrete examples when we find them and see what we can come up with. Thanks for your feedback! Ludo=E2=80=99.