Basically top-level project says it doesn't care about a version (dependency is specified there only for dialyxir's sake) while a library have a stricter constraint. Furthermore this happens during deps.get with existing mix.lock — in general I didn't expect any checks to be performed at this stage.
Dependencies have diverged:
* plug (Hex package)
the dependency plug
> In mix.exs:
{:plug, ">= 0.0.0", [hex: :plug, manager: :mix]}
does not match the requirement specified
> In deps/oauth2/mix.exs:
{:plug, "~> 1.0", [optional: false, hex: :plug]}
Ensure they match or specify one of the above in your deps and set "override: true"
** (Mix) Can't continue due to errors on dependencies
@sumerman good catch. Can you provide a simple mix.exs file that reproduces the error? Thank you. :)
@ericmj / @lexmag let's solve this before shipping 1.2.1.
@josevalim It's surprisingly hard to reproduce: on a different machine with the same repo it gives me a different set of conflicting deps, and "minimal example" I'm trying to come up with just works. Could you point me to the part of Mix code where resolution happens, so I will have a better idea what's going on.
@sumerman if it works on another machine it can be two reasons:
@josevalim not quite: the repo with the problem just gives me a different conflicts set. But a brand-new repo works.
deps folders before running deps.getRemoving _build folder helped, though. I will check with another machine tonight.
Ok, perfect. I will hold the release until then, if we still can't reproduce it, no issues. It can always be fixed later on.
Make sure you have the same mix.lock file when reproducing. This error happens when you have a fetched and compiled dependency A and add a new dep B that depends on A but the version requirement B set on A does not match the version you have of A.
Example:
You have dep A with version 1.0.0. You and dep B that depends on A with the requirement "~> 2.0", the new requirement does not match on 1.0.0 and you get this error.
You could get this error due to a bug in Mix but regardless the error message needs to be improved.
I've been preserving the lock file all the time and of course will preserve
it for further edperiments.
On Wednesday, 13 January 2016, Eric Meadows-Jönsson <
[email protected]> wrote:
Make sure you have the same mix.lock file when reproducing. This error
happens when you have a fetched and compiled dependency A and add a new dep
B that depends on A but the version requirement B set on A does not match
the version you have of A.Example:
You have dep A with version 1.0.0. You and dep B that depends on A with
the requirement "~> 2.0", the new requirement does not match on 1.0.0 and
you get this error.You could get this error due to a bug in Mix but regardless the error
message needs to be improved.—
Reply to this email directly or view it on GitHub
https://github.com/elixir-lang/elixir/issues/4191#issuecomment-171337296
.
Sincerely,
(Mr.) Valery Meleshkin
_build folder removal helped on the other machine as well. So probably just a note will be enough.
Perfect. We will improve the error message for upcoming releases anyway. Thank you!
This is related to #4162 btw.
Closing as part of #4162.
can confirm deleting /build and then running mix deps.get solved the issue for me