elixir icon indicating copy to clipboard operation
elixir copied to clipboard

No warning on duplicate application name

Open lud opened this issue 3 months ago • 2 comments

Hello,

Somebody tried to use my library :aoc in a new mix project that they also called :aoc.

To reproduce you can do this:

mix new aoc

And then add :aoc in the dependencies:

{:aoc, "~> 0.16.0"}

And finally run this:

mix deps.get
mix aoc.set

You will see that the compiler hangs.

The task does the following:

  • @requirements ["app.config"]
  • Application.ensure_all_started(:aoc)

Which may have an impact.

So Elixir doesn't throw an error when the app has the same name as one of the dependencies. Is that supported somehow? Is there anything I can add in my library to trigger a warning or an error?

Thank you.

lud avatar Nov 29 '25 12:11 lud

We should fix this in mix indeed. Thank you for the report!

josevalim avatar Nov 29 '25 12:11 josevalim

Hi, I’ve implemented a fix for this issue. It adds a warning when a project’s app name matches one of its dependencies.

PR: #15013

Thank you

pckrishnadas88 avatar Dec 15 '25 06:12 pckrishnadas88