all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Pierre Neidhardt <mail@ambrevar.xyz>
To: zimoun <zimon.toutoune@gmail.com>, ison <ison@airmail.cc>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: Parameterized packages
Date: Mon, 27 Jan 2020 11:13:55 +0100	[thread overview]
Message-ID: <87imkxcil8.fsf@ambrevar.xyz> (raw)
In-Reply-To: <CAJ3okZ1Ps0rn3Fe=3eEvOK3A0Z5O0FtdX=OJt6UZMu5cgyzEBQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3400 bytes --]

zimoun <zimon.toutoune@gmail.com> 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.

-- 
Pierre Neidhardt
https://ambrevar.xyz/

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

  reply	other threads:[~2020-01-27 10:14 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14 11:54 Parameterized packages Ludovic Courtès
2019-05-14 15:17 ` Tobias Geerinckx-Rice
2019-05-17 14:23   ` Pierre Neidhardt
2019-05-17 18:15   ` Mark H Weaver
2019-07-19  5:41     ` Chris Marusich
2019-07-19 20:29     ` ison
2020-01-02 19:23       ` Pierre Neidhardt
2020-01-09 11:10         ` Pierre Neidhardt
2020-01-09 23:13           ` Marius Bakke
2020-01-10 12:29             ` Pierre Neidhardt
2020-01-10 16:19         ` Ludovic Courtès
2020-01-11 11:31           ` Pierre Neidhardt
2020-01-14 15:05             ` zimoun
2020-01-15  9:40               ` Pierre Neidhardt
2020-01-15 11:30                 ` zimoun
2020-01-15 11:51                   ` Pierre Neidhardt
2020-01-15 13:54                     ` zimoun
2020-01-16 19:06                       ` ison
2020-01-16 20:55                         ` Ricardo Wurmus
2020-01-17 16:34                           ` Pierre Neidhardt
2020-01-17  9:15                         ` L p R n d n
2020-01-17 16:46                           ` Pierre Neidhardt
2020-01-17 15:53                         ` zimoun
2020-01-17 16:56                           ` Pierre Neidhardt
2020-01-20 14:34                             ` zimoun
2020-01-21 10:56                             ` Build systems and implicit inputs Ludovic Courtès
2020-01-21 12:24                               ` zimoun
2020-01-21 13:07                                 ` Pierre Neidhardt
2020-01-21 18:02                                   ` zimoun
2020-01-19 20:34                           ` Parameterized packages Ludovic Courtès
2020-01-20  9:08                             ` Pierre Neidhardt
2020-01-20 14:50                               ` zimoun
2020-01-20 18:57                                 ` Pierre Neidhardt
2020-01-20 19:07                                   ` Pierre Neidhardt
2020-01-20 22:57                                   ` ison
2020-01-21 10:09                                     ` Pierre Neidhardt
2020-01-21 10:49                                     ` Ludovic Courtès
2020-01-21 12:15                                   ` zimoun
2020-01-21 13:13                                     ` Pierre Neidhardt
2020-01-21 19:04                                       ` zimoun
2020-01-22  9:54                                         ` Pierre Neidhardt
2020-01-22 12:23                                           ` zimoun
2020-01-24 21:56                                             ` ison
2020-01-26 19:35                                               ` zimoun
2020-01-27 10:13                                                 ` Pierre Neidhardt [this message]
2020-01-27 11:23                                                   ` zimoun
2020-01-27 11:50                                                     ` Pierre Neidhardt
2020-01-27 12:34                                                       ` zimoun
2020-01-27 10:04                                               ` Pierre Neidhardt
2020-01-25 18:52                                             ` John Soo
2020-01-27 10:17                                               ` Pierre Neidhardt
2020-01-20 14:12                             ` zimoun
2020-01-17 16:31                         ` Pierre Neidhardt
     [not found]                         ` <875zhbvzfz.fsf@guixSD.i-did-not-set--mail-host-address--so-tickle-me>
2020-01-17 16:41                           ` Pierre Neidhardt
2020-01-19 20:30                           ` Ludovic Courtès
2020-01-15 11:43                 ` Pierre Neidhardt
2020-01-15 11:44           ` Pierre Neidhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87imkxcil8.fsf@ambrevar.xyz \
    --to=mail@ambrevar.xyz \
    --cc=guix-devel@gnu.org \
    --cc=ison@airmail.cc \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.