Subject: [bug#32192] [PATCH 0/7] Remove duplicated packages.

From: [email-masked] (Ludovic Courtès)
Date: Thu, 19 Jul 2018 11:23:31 +0200

Hello,

Leo Famulari <[email-masked]> skribis:

> On Tue, Jul 17, 2018 at 09:27:45PM +0100, Christopher Baines wrote:
>> The following patches attempt to remove the duplicates, favouring the
>> original package definition.
>
> I sent one comment, otherwise the patches LGTM.
>
>> Is there any way of guarding against adding these, or more accurately
>> checking for duplicate definitions?
>
> I don't know. Hopefully someone else has some ideas.

It’s terrible to see there were so many duplicate packages.

The package lookup machinery detects and warns about same-named packages
when you do things like:

  (define-public var1
    (package (name "something") …))
  (define-public var2
    (package (name "something") …))

The problem here is that duplicates were in the same module and using
the same variable name, such that the second definition would shadow the
first one, and so Guix only sees one package.

I think we should add a warning in the compiler for this situation.

Ludo’.