Dependency warnings regression?

I’m not sure when this started happening but lately in umbrella apps I’m seeing warnings on compilation such as:

iex(3)> warning: Quiz.Question.Range.extract_details/2 defined in application :db is used by the current application but the current application does not depend on :db. To fix this, you must do one of:

  1. If :db is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs

  2. If :db is a dependency, make sure it is listed under "def deps" in your mix.exs

  3. In case you don't want to add a requirement to :db, you may optionally skip this warning by adding [xref: [exclude: [Quiz.Question.Range]]] to your "def project" in mix.exs

  lib/contexts/quizzes.ex:148: Contexts.Quizzes.extract_details/2

The app where Contexts.Quizzes is defined has this entry on its deps:

defp deps do
    [
      {:phoenix, "~> 1.5.8"},
      {:phoenix_live_view, "~> 0.15.1"},
      {:phoenix_ecto, "~> 4.0"},
      {:floki, ">= 0.27.0", only: :test},
      {:phoenix_html, "~> 2.11"},
      {:phoenix_live_reload, "~> 1.2", only: :dev},
      {:telemetry_metrics, "~> 0.4"},
      {:telemetry_poller, "~> 0.4"},
      {:jason, "~> 1.0"},
      {:plug_cowboy, "~> 2.0"},
      {:cssex, "~> 0.6"},
      {:bamboo, "~> 2.0.0"},
      {:bamboo_phoenix, "~> 1.0.0"},
      {:oban, "~> 2.6.1"},
      {:db, in_umbrella: true}
    ]
end

Am I missing something or was there a change somewhere along the way?
I’m using:

elixir 1.11.3-otp-23

Show us your application/0 function.

For the app that includes the dep as in_umbrella: true

def application do
    [
      mod: {Server.Application, []},
      extra_applications: [:logger, :runtime_tools]
    ]
end

But it shouldn’t be relevant for an app defined inside the umbrella right?

Well, might it have something to do with caching/staleness? That particular one went away when I re ran mix deps.get, but :jason was still giving me the same warning. I re-ran again and now it’s no longer giving me warnings for :jason either - But nothing changed between the first and second re-run.

Have a look at this thread Dependency issue - warning: MyDep.MyDepMod.helper/1 defined in application :my_dep is used by the current application - #2 by cenotaph

Thanks!

I think it was just a staleness issue or the ordering on how they were added - the warnings are no longer showing - I did two deps.get, deps.get, mix compile --force, the in umbrella dep no longer showed warning but :jason (that was also as a dependency on that one) still showed, then deps.get again and compile force and now it’s clean.