Skip to content

Mix does not detect diverged dependencies #7685

@ericmj

Description

@ericmj

Environment

Hex: 0.17.8-dev
Elixir: 1.7.0-dev
OTP: 20.2

Built with: Elixir 1.7.0-dev and OTP 20.2

Current behavior

With the following dependencies:

[
  {:phoenix, git: "https://github.com/phoenixframework/phoenix.git"},
  {:phoenix_ecto, "~> 3.2"}
]

And this dependency tree:

mix deps.tree
myapp
├── phoenix (https://github.com/phoenixframework/phoenix.git)
│   ├── plug ~> 1.5 (https://github.com/elixir-plug/plug.git) *override*
│   │   └── mime ~> 1.0 (Hex package)
│   └── phoenix_pubsub ~> 1.0 (Hex package)
└── phoenix_ecto ~> 3.2 (Hex package)
    ├── ecto ~> 2.1 (Hex package)
    │   ├── decimal ~> 1.2 (Hex package)
    │   └── poolboy ~> 1.5 (Hex package)
    └── plug ~> 1.0 (Hex package)

I get the following error when running mix run:

Unchecked dependencies for environment dev:
* plug (https://github.com/elixir-plug/plug.git)
  lock outdated: the lock is outdated compared to the options in your mix.exs. To fetch locked version run "mix deps.get"
** (Mix) Can't continue due to errors on dependencies

Expected behavior

The error is wrong because we have diverged dependencies so mix deps.get won't fix it. Mix should instead raise a diverged dependencies error telling us to add override: true.

/cc @alex88

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions