From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 18 14:14:08 2021 Received: (at 49597) by debbugs.gnu.org; 18 Jul 2021 18:14:08 +0000 Received: from localhost ([127.0.0.1]:57184 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5BIl-00006a-SU for submit@debbugs.gnu.org; Sun, 18 Jul 2021 14:14:08 -0400 Received: from newton.telenet-ops.be ([195.130.132.45]:52386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m5BIj-00006R-Vq for 49597@debbugs.gnu.org; Sun, 18 Jul 2021 14:14:06 -0400 Received: from albert.telenet-ops.be (albert.telenet-ops.be [IPv6:2a02:1800:110:4::f00:1a]) by newton.telenet-ops.be (Postfix) with ESMTPS id 4GSTmV2mXDzMqg51 for <49597@debbugs.gnu.org>; Sun, 18 Jul 2021 17:44:10 +0200 (CEST) Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by albert.telenet-ops.be with bizsmtp id Wfk72500F0mfAB406fk8UL; Sun, 18 Jul 2021 17:44:08 +0200 Message-ID: Subject: Re: [bug#49597] [PATCH core-updates 00/15] Ajust packages to label-less input style From: Maxime Devos To: Ludovic =?ISO-8859-1?Q?Court=E8s?= , 49597@debbugs.gnu.org Date: Sun, 18 Jul 2021 17:44:01 +0200 In-Reply-To: <20210716155009.32118-1-ludo@gnu.org> References: <20210716155009.32118-1-ludo@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-AjCUnq8XiBfRo4Da4mlg" 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=1626623048; bh=2XMvDRgCIakBj5LQL1t76BGmvaVaKFvqyBBhVGa1AU8=; h=Subject:From:To:Date:In-Reply-To:References; b=Vnp6/PX0MCjVOryNduxRx6pnEJml7gODVszWzYkUm/i6cO6b4W5CHPQlIOfLju05A u26foW8sfeDMB/KueT3cXvrRk5+eIdgGDnxkkpozDUJhFpdshlSP6Qazf848p61Dw1 S7Sr5qzCnCrLH3QlmBnt81sC+wVVngF0Fa5uFfr38UVrSmUnInlfu49akC2g/V6yWl 42WivSqUs0duOfhbRdJbI+ovi7fqpkNN2nkAZSvo4EPE3rex0Ry16YCGBB5gFV5uJ/ U/aV1k2Lj0FwHydJ2EzoWSEA7jUbpXs6znRrex1yQRHx1dofiyc8tt16XyY4Jvj/8x IPpGOy5SuD4CQ== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 49597 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-AjCUnq8XiBfRo4Da4mlg Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Ludovic Court=C3=A8s schreef op vr 16-07-2021 om 17:50 [+0200]: > The rest is about removing reliance on input labels in build-side > code, primarily by changing: >=20 > (string-append (assoc-ref inputs "LABEL") "FILE") >=20 > to one of: >=20 > (search-input-file inputs "FILE") > (search-input-directory inputs "FILE") >=20 > This change will help if we eventually remove input labels entirely > from the API (remember that input labels are now unnecessary in > package definitions but they=E2=80=99re still returned by =E2=80=98packag= e-inputs=E2=80=99 > and similar procedures). >=20 > The idea is that code should not rely on package names when looking > for files as this would prevent things such as > =E2=80=98--with-inputs=3Dopenmpi=3Dmpich=E2=80=99 since the label in the = original package > would be =E2=80=9Copenmpi=E2=80=9D whereas it=E2=80=99d be =E2=80=9Cmpich= =E2=80=9D in the transformed package. > In this case (a kind of =E2=80=9Cvirtual dependencies=E2=80=9D), a better= idiom is: >=20 > (search-input-file inputs "lib/libmpi.so") >=20 > as this explicitly accommodates any implementation of that library. I would have expected that --with-inputs=3Dx=3Dy would turn the following: (package [...] (inputs `(("x" ,x)))) into: (package [...] (inputs `(("x" ,y)))) i.e., keep the label intact, but change the package value. If "with-inputs" functioned like that, then "search-input-file" wouldn't be necessary in this case. Thus, the input label would be by default the package name of the default package in 'inputs' or 'native-inputs', and if a input is replaced, then the package name of the original package is still used as label, but with the new package as value. (This might or might not currently be the case, I dunno) So, interpreting =E2=80=98The idea is that code should not rely on _package names_ when look= ing ...=E2=80=99 as =E2=80=98The idea is that code should not rely on _labels_ when looking = ...=E2=80=99, I don't agree, as labels (shouldn't) spontanuously change even when using --with-inputs, so I consider them perfectly fine to use when it's convenien= t. In the example you gave, both search-input-file and the original 'string-ap= pend' and 'assoc-ref' look convenient to me, though the latter more so than the o= ther, and a third variant could be #$(file-append (this-package-native-input "openmpi") "/lib/libmpi.so") which avoids 'string-append' and 'assoc-ref'. (I prefer explicitely writing in the package definition in which input a fi= le will be found, as a kind of documentation, though in this case it probably doesn't really matter.) > I initially made the =E2=80=98search-input-file=E2=80=99 changes by grepp= ing for > =E2=80=9C(string-append (search-input inputs=E2=80=9D, replacing everythi= ng in wgrep > mode. I then reviewed changes one by one (though without rebuilding > everything) and committed them in chunks of similar changes for > easier review/bisecting. >=20 > I=E2=80=99d like to push this to core-updates soonish. >=20 > Feedback welcome! An idea behind this series of patch series seems to be to eliminate input labels entirely. Is that true / false? A benefit of having procedures like 'modify-inputs' instead of having random code assume package inputs are alists with a certain structure, is that this opens some opportunities to experiment with the nature of inputs. More specifically, take 'propagated-inputs'. Guile dependencies of guile libraries usually have to be added to 'propagated-inputs', even if the library package can also be used as a program. If the user only wants to use it as a program, then the propagation isn't necessary. So introducing some kind of 'context-dependent propagation' might be interesting, to reduce propagation conflicts. Greetings, Maxime. --=-AjCUnq8XiBfRo4Da4mlg 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+4iGRcl7gUCYPRMQxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7k3MAQDMelXs/ujVzLvovjnA/MVNW7xK 7wuU9tYxWEK4CO5RKAEAk+wFlKAVS2opWvdL9QjKnubCLrp5665JVLlKZfCF+gk= =lwoG -----END PGP SIGNATURE----- --=-AjCUnq8XiBfRo4Da4mlg--