From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tobias Geerinckx-Rice Subject: Re: Parameterized packages Date: Tue, 14 May 2019 17:17:38 +0200 Message-ID: <87o945vze5.fsf@nckx> References: <87woitz1xx.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([209.51.188.92]:52018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQZBi-0007sI-TA for guix-devel@gnu.org; Tue, 14 May 2019 11:17:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQZBh-0006Ok-Em for guix-devel@gnu.org; Tue, 14 May 2019 11:17:54 -0400 In-reply-to: <87woitz1xx.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org, Ludovic =?utf-8?Q?Court=C3=A8s?= --=-=-= Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Ludo', Ludovic Court=C3=A8s wrote: > While thinking about and=20 > looking > for ways to allow users to install just the locales they need=20 > right from > =E2=80=98guix package=E2=80=99, I realized that =E2=80=9Cparameterized pa= ckages=E2=80=9D are a > low-hanging fruit Wow. Unexpected turn=E2=80=A6 I'm still thinking about this, so all this is just me doing it out=20 loud: > (package > (inherit glibc-utf8-locales) > (properties `((locales . ("zh_CN.utf8"))))) > > and tadaam! we have a parameterized package. > > There=E2=80=99s a couple of gotchas: > > =E2=80=A2 We=E2=80=99d need to store more info in manifest entries so t= hat > transformation options are preserved upon =E2=80=98guix upgrade=E2=80= =99. > > =E2=80=A2 We might need to expose the package parameters somehow, so=20 > that if > one types =E2=80=98--with-argument=3Dfoobar=3Dbaz=E2=80=99, they get = a correct=20 > error > message saying that =E2=80=9Cfoobar=E2=80=9D is not a known parameter. Interesting idea to piggy-back on the properties field, and it=20 might save some code (at least initially), but I don't see the=20 overlap here. None of the current properties (superseded, upstream-name,=20 *-variant, cpe-name, hidden?) make much sense to expose in this=20 way; they're semimmutable facts about the package. While a dedicated field can provide richer metadata, such as=20 description, basic =E2=80=98types=E2=80=99 & sane/permitted values, to be u= sed by=20 the UI. Looking at Exherbo/ntoo, this will inevitably lead to factoring=20 out very common option metadata so one doesn't have to keep=20 writing =E2=80=98x11 bool "Add support for the X Window System"=E2=80=99 in= =20 every. single. package. Then come the people asking how to set CFLAGS for all packages and=20 you'll know you've made it. > =E2=80=A2 We might want to make the CLI option less verbose too, but=20 > how? Possibly relevant: do you see package options=C2=B9 being added to=20 package specifications? That seems to be the classical approach. Kind regards, T G-R [1]: I use the term =E2=80=98option=E2=80=99 because it's what my last FHS= =20 distribution called them, and it was a good distribution, and=20 because =E2=80=98arguments=E2=80=99 is already an unrelated field in packag= e=20 expressions, and flags are boolean, but substitute whatever name=20 you prefer. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQT12iAyS4c9C3o4dnINsP+IT1VteQUCXNrcEgAKCRANsP+IT1Vt ebJ0AQCFitlcTZk5gqE4p5RnT60/uzU2lVDdHKUx3quXqO0kZwEAn9O+N2Nb/cIo 0DVyn4BQ24mMEd3LtCR/lZIJKjjtMgo= =cE+d -----END PGP SIGNATURE----- --=-=-=--