From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pierre Neidhardt Subject: Re: Parameterized packages Date: Mon, 27 Jan 2020 11:13:55 +0100 Message-ID: <87imkxcil8.fsf@ambrevar.xyz> References: <87d0bfrxr1.fsf@gnu.org> <87tv4qjy06.fsf@ambrevar.xyz> <875zh6rm5h.fsf@ambrevar.xyz> <87lfq1q7ea.fsf@ambrevar.xyz> <87zhefq0ih.fsf@ambrevar.xyz> <20200124215645.dalemg5qbkpai37m@n0> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:38623) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iw1P8-0004s0-1t for guix-devel@gnu.org; Mon, 27 Jan 2020 05:14:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iw1P6-0000NW-DC for guix-devel@gnu.org; Mon, 27 Jan 2020 05:14:01 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:56535) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iw1P6-0000Jq-4O for guix-devel@gnu.org; Mon, 27 Jan 2020 05:14:00 -0500 In-Reply-To: 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-mx.org@gnu.org Sender: "Guix-devel" To: zimoun , ison Cc: Guix Devel --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable zimoun writes: > Maybe I misread something and/or I misunderstand other thing but the > symbols 'video-player' and 'python' need to be defined somewhere. And > with this proposal adding the field 'parameters', this somewhere is > outside the package. Therefore, I will end up to a big mess, IMHO. I think you misread indeed :p > Let consider the packages 'foo' and 'bar'. They depend both on say the > 'video-player' package. No, there is no video-player package. It's a "package parameter". > Well, the definition looks like: > > --8<---------------cut here---------------start------------->8--- > (package > (name "foo") > (...) > (parameters video-player) > (...)) > > (package > (name "bar") > (...) > (parameters video-player) > (...)) > --8<---------------cut here---------------end--------------->8--- > > Now, the user wants to install the both packages but: > - they requires that "foo" depends on vlc without any X support, say > "vlc-no-x" > - and they require that "bar" depends on full "vlc" > > So how to do? > Where is defined 'video-player'? I think there is a misunderstanding on the definition of "package parameters". I intend to make package parameters first class objects for the reason Ison explained in the previous message. To answer your previous example, you'd do something like this, with a made-up syntax: guix install "foo(:video-player vlc-no-x)" "bar(:video-player vlc)" >> I'm not sure with the function method how easy it would be to inform the >> user of all available options. For example when running `guix search` >> would it be able to programmatically collect all the options that a >> package has and display them there? > > To me, the "official" packages in master should stay "simple" with no > parameter. Otherwise, it is will hard -- if not impossible -- to > ensure that all combinations work; or the number of parameters will be > very limited. Guix (unlike Gentoo) is functional, so that good news is that we can have multiple versions of the same packages in the store. This essentially fixes the clash issues with Gentoo. >> Also it seems that whether or not there are global meta objects is a >> separate issue than whether to use parameters or functions. It looks like >> either method could use them or not. In the function approach you could >> still just pass in an alist as above. > > Yes. > But the big differences are: > > 1. the base package is untouched > 2. the arguments are locally defined > 3. everything is explicit > > So less surprises IMHO. But you can't compose the parameters, so this ruins the main point of package parameters. > Well, I really do not know and I do not have a strong opinion: I just > fear that the 'parameters' field would add complexity which would lead > to unmaintenable packages. As you said, I think it would simply add more "tunable" options to packages, that's it. The main burden for packages is to make sure all tunables of a package work together, but there is no escape to this. Nix / Gentoo have the same problem here. And well, if some parameter combination does not work, it's not the end of the world either, the user would not have this specific version of a package with present Guix either. =2D-=20 Pierre Neidhardt https://ambrevar.xyz/ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAl4ut+MACgkQm9z0l6S7 zH/XuwgArfPXfuw2gOA8y+iA69XttMObrACtp/OecqOi79yiXSSBJnFfNlN15ZAM BpgvmKzUOu5h96FxtpaoEqi3jZBBbrj4PgsFmFbbmHpdajFdtIR06eK2eUnobEJo AUZKTs0JK/QR55U/IRaLXLNosVO+W/KN3n7HrQjVh5hdTlaJETJ+QYFEjCO5Ygea MPh1algEwf8lD+Z2l6Xv37D2QJdeMvm6NTRKWu2XQhUEnjqCOvF6p8OspJ0U4Lby UkHnYCsZKxUdMpoc0garMHbW9vQoLQ7GahHtBNEzYdkr2BrS6SD1TH0e5p+V7xYn z1kXApqR+MH0qA8IiIaN6G1ag5zh5g== =dey+ -----END PGP SIGNATURE----- --=-=-=--