Mix deps.unlock --check-unused reports dev dependencies

I have a project that uses ex_doc

      {:ex_doc, "~> 0.21", only: :dev, runtime: false},

Our CI runs with MIX_ENV=test, so mix deps.unlock --check-unused returns:

** (Mix) Unused dependencies in mix.lock file:

  * :earmark_parser
  * :makeup
  * :makeup_elixir
  * :makeup_erlang

Those are all dependencies of ex_doc.

Funnily enough, on my local machine, running MIX_ENV=test mix deps.unlock --check-unused doesn’t return those libs. The check passes. Both CI and my local machine use Elixir 1.13.4

Can it have something to do with caching compiled deps? On CI I am not running deps.compile when _build is restored from the cache.

Oh, I got it. The CI was using mix deps.get --only=test.

2 Likes