From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UM8nDgWt9WDOrAAAgWs5BA (envelope-from ) for ; Mon, 19 Jul 2021 18:49:09 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id cEbRCQWt9WDoCwAAbx9fmQ (envelope-from ) for ; Mon, 19 Jul 2021 16:49:09 +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 B73FB1940D for ; Mon, 19 Jul 2021 18:49:08 +0200 (CEST) Received: from localhost ([::1]:49286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5WS3-0004IV-O0 for larch@yhetil.org; Mon, 19 Jul 2021 12:49:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5WRy-0004CJ-Ek for guix-patches@gnu.org; Mon, 19 Jul 2021 12:49:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48604) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m5WRy-0003DA-6S for guix-patches@gnu.org; Mon, 19 Jul 2021 12:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m5WRx-0007ep-Vd for guix-patches@gnu.org; Mon, 19 Jul 2021 12:49:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 19 Jul 2021 16:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49597 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 49597@debbugs.gnu.org Received: via spool by 49597-submit@debbugs.gnu.org id=B49597.162671328429364 (code B ref 49597); Mon, 19 Jul 2021 16:49:01 +0000 Received: (at 49597) by debbugs.gnu.org; 19 Jul 2021 16:48:04 +0000 Received: from localhost ([127.0.0.1]:60150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5WR2-0007dX-AH for submit@debbugs.gnu.org; Mon, 19 Jul 2021 12:48:04 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:56020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5WQz-0007d0-PY for 49597@debbugs.gnu.org; Mon, 19 Jul 2021 12:48:03 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by xavier.telenet-ops.be with bizsmtp id X4nz2500P0mfAB4014nzfU; Mon, 19 Jul 2021 18:48:00 +0200 Message-ID: From: Maxime Devos Date: Mon, 19 Jul 2021 18:47:54 +0200 In-Reply-To: <87tukqmk73.fsf_-_@gnu.org> References: <20210716155009.32118-1-ludo@gnu.org> <87tukqmk73.fsf_-_@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-5kaCTf7goBG7mCJUUpI2" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626713280; bh=UUEnYGHRY2C8hIm1vISACpmpDATQYixhBSXTQqLqZpU=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=VhXzJwg1AJ0QFBzatCKcxdyGladNAWZ4LMnqJQoR4GIEg6444bpRQhtVJaNVgn7UX Jlf0nBz5Fk5xKnM2o1Io8HY2fKRrJp1Vads+X//v110UXGuqYRmx+El3RkAWyUZXqm QYUAENP8aKbSuDMHMwxClAmIsB8jjolXUxjNR26xlpaOaS4B3zrUEqvo3PYekIeTOE dvTqZrJR39OAZBFsk2wZGck9qhSDTwXsWOeiB7hE7HxHIRR3NYSDZ8QdOFuTCFKGk2 6KUm0G80qx+Mo8ICTRH1u9vjmZ+5hhIzrjDuaSRWEGw8+8fGEiW4xDf0fLGvWu1V8w pSK6a+jCcHCKw== 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=1626713349; 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: dkim-signature; bh=UUEnYGHRY2C8hIm1vISACpmpDATQYixhBSXTQqLqZpU=; b=k0Aarln8OGQJA+KSPXWQg3NV+qPD+9ycEng1mBqATc8CLIlF4i2VazQXgONVk/yiN7VNkk f8vjUjBuHN/nAVn7X21tKH2x97Y2urbim+e/IUFiSi6YgnYah9F0TLut3Wk8fn67Y77O/Q rEYCrc+BopVJSNrYZc0YiCDDMAUMjnY2VTH9VgyWGi8C3ZnZ8TQ0nU1VnaW2ibBYeiAGm9 0QMl/ROqa9ZKswPFd+MNXn59RavbyuM9W22ecDbToZ4hy4MXZyTWIgjOrElLcbaFv8jK+H NnUUX/Y6T3tD9OD53vWqGQcZ0tTgIQoJx7K/ZNrBBDgaZLs5REbX1R6+gN0kwg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626713349; a=rsa-sha256; cv=none; b=kKeoj79KRZmiN36Ktn+WxdMQH3J7ZP6Zv67pWZkZ3UIC7GHhGK//JMTbpAI3btaVEdroOu L0yChCjcrE1ZVFUR94yvecRwHfzJJYwH05EiyVtB8t1GPaCl2Ew55bwSjtoarUDpxLy9/O UVjTP41Ql7VBSuGgCmxWMQWv4HaJQyeF1AcZnEW+C35v/jIL9SZiwuKH/3Bqpi5XX8YnbJ Ntwch1DhlENcPZ1Oo28+qBYwNBiFgjYW47yVzoNigVLJP/25eXKnOu/hel4UuSJkmIxj9H ZPoJWtW8mD6SwZheccr4s3CZ5tsBZYHiUTpyWVUmJ6TeC4ucQ3q0RbaB1P7vrg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=VhXzJwg1; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=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: -3.42 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=VhXzJwg1; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=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: B73FB1940D X-Spam-Score: -3.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: wF9KgV9ME6wl --=-5kaCTf7goBG7mCJUUpI2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s schreef op ma 19-07-2021 om 16:50 [+0200]: > [...] >=20 > > In the example you gave, both search-input-file and the original 'strin= g-append' > > and 'assoc-ref' look convenient to me, though the latter more so than t= he other, > > and a third variant could be > >=20 > > #$(file-append (this-package-native-input "openmpi") "/lib/libmpi.so"= ) > >=20 > > which avoids 'string-append' and 'assoc-ref'. >=20 > Yes, but you=E2=80=99re still relying on the name, =E2=80=9Copenmpi=E2=80= =9D. >=20 > If I do: >=20 > (package > (inherit thing) > (inputs `(("mpich" ,mpich) > ,@(delete "openmpi" (package-inputs thing))))) >=20 > =E2=80=A6 then you have a problem: =E2=80=98this-package-input=E2=80=99 w= on=E2=80=99t find =E2=80=9Copenmpi=E2=80=9D. > It=E2=80=99s a real, common use case. That=E2=80=99s why we need to be c= areful about > the idioms we promote. >=20 > WDYT? Then you could do: (package (inherit thing) (inputs `(("openmpi" ,mpich) ; use "openmpi" label ,@(delete "openmpi" (package-inputs thing))))) or just use "mpi" in the original and new package as input label, but that doesn't mesh well with eventually removing input labels. Myself, I don't mind input labels much. They look like arguments to a procedure to me, albeit with an unusual syntax for referring to them. > > (I prefer explicitely writing in the package definition in which input = a file > > will be found, as a kind of documentation, though in this case it proba= bly > > doesn't really matter.) >=20 > Yeah, I like that too. OTOH, =E2=80=98search-input-file=E2=80=99 has the= advantage that > it errors out if the file is not found, whereas >=20 > (string-append (assoc-ref inputs "foo") "bar") >=20 > always =E2=80=9Cworks=E2=80=9D and problems occur possibly much later, at= run time. I'd suggest using #+/#$(file-append (this-package-[native]-input "foo") "/b= ar" instead of (string-append (assoc-ref ...) ...). I think I have a method for explicitely choosing which input to use, using package names instead of labels, that still works nicely with "--with-input": (define* (lookup-libmpi-library package) ;; open-coding could be avoided by adding a 'is-mpi-library?' ;; package property and using that instead of hard-coding a list ;; of package names=20 (file-append (or (lookup-package-input package "openmpi") (lookup-package-input package "mpich") ...) "/lib/libmpi.so")) Greetings, Maxime. --=-5kaCTf7goBG7mCJUUpI2 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYPWsuhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7mqgAP0WdTpirVH6nqs23zl7Djhwxi1R A5bOT03pPJIl1v8xxAD+Jyzy1WezpJ3nC9Q+ZWBsUh/PNHFMkXDBVZ1Cf7WRQw0= =b2gw -----END PGP SIGNATURE----- --=-5kaCTf7goBG7mCJUUpI2--