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

From: [email-masked] (Ludovic Courtès)
Date: Tue, 24 Jul 2018 12:11:33 +0200

[email-masked] (Ludovic Courtès) skribis:

> 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.

Done!

  https://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.2&id=bdcd0ba8a71af24f0b64d7acac3130d8f541d26c

Now you get warnings like this:

--8<---------------cut here---------------start------------->8---
$ /data/src/guile-2.1/meta/uninstalled-env guild compile -Wshadowed-toplevel gnu/packages/haskell.scm
gnu/packages/haskell.scm:9224:0: warning: shadows previous definition of `ghc-th-lift-instances' at gnu/packages/haskell.scm:5437:0
gnu/packages/haskell.scm:9306:0: warning: shadows previous definition of `ghc-time-locale-compat' at gnu/packages/haskell.scm:2591:0
wrote `/data/src/guile-2.1/cache/guile/ccache/2.2-LE-8-3.A/home/ludo/src/guix/gnu/packages/haskell.scm.go'
$ /data/src/guile-2.1/meta/uninstalled-env guild compile -Wshadowed-toplevel gnu/packages/emacs.scm
gnu/packages/emacs.scm:8704:0: warning: shadows previous definition of `emacs-load-relative' at gnu/packages/emacs.scm:3467:0
gnu/packages/emacs.scm:9648:0: warning: shadows previous definition of `emacs-csv-mode' at gnu/packages/emacs.scm:7390:0
wrote `/data/src/guile-2.1/cache/guile/ccache/2.2-LE-8-3.A/home/ludo/src/guix/gnu/packages/emacs.scm.go'
--8<---------------cut here---------------end--------------->8---

This will be in Guile 2.2.5.

Ludo’.