Subject: [bug#74542] [PATCH v2 05/16] packages: Factorize ‘all-packages’.

From: Maxim Cournoyer <[email-masked]>
Date: Fri, 06 Dec 2024 22:59:34 +0900

Hi Ludovic,

Ludovic Courtès <[email-masked]> writes:

> Maxim Cournoyer <[email-masked]> skribis:
>
>>> @@ -253,6 +254,23 @@ (define* (fold-packages proc init
>>>                                  init
>>>                                  modules))
>>>  
>>> +(define all-packages
>>> +  (mlambda ()
>>> +    "Return the list of all public packages, including replacements and hidden
>>> +packages, excluding superseded packages."
>>
>> Reading the above doc made me question; are replacements always supposed
>> to be made public?  I typically would leave them private to avoid
>> cluttering the CLI with duplicate packages.
>
> Replacements are always reachable via the ‘replacement’ field, whether
> they’re public or not.
>
> If they’re public, they’re also visible from the user interface, which
> is probably nicer.  Other than that, it doesn’t make a big difference.

I see, thanks for explaining.  Assuming they have the same name, the
interface for 'guix search $name' would now should two versions
available, while in theory if you 'guix shell $name@older-version' you'd
get the graft anyway, which is at the newer (fixed) version.

And, 'guix build $name', although the CLI would say version is Y, would
actually show version X in the store, which could be confusing in some
cases.

Both have good and bad points... I'm not too sure which one is
preferable.  Probably, as you said, seeing the newest version which is
used on the CLI is preferable to seeing the same version match in the
package store file name, so I think I'll make replacements public from
now on... another thing to document some day!

-- 
Thanks,
Maxim