No warning on duplicate application name
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.
We should fix this in mix indeed. Thank you for the report!
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