Cannot get rid of dependency warnings after upgrading Elixir to 1.8.2 -> 1.13.4

After upgrading an umbrella project from Elixir 1.8.2 to 1.13.4 I am getting numerous warnings for dependencies that are missing in projects. One example is:

...
==> parser
Compiling 75 files (.ex)
warning: Timely.as/2 defined in application :timely is used by the current application but the current application does not depend on :timely. To fix this, you must do one of:

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

  2. If :timely 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 :timely, you may optionally skip this warning by adding [xref: [exclude: [Timely]]] to your "def project" in mix.exs

Invalid call found at 5 locations:
 ...

The warning seems is very specific and provides obvious strategies on how to fix. So I checked out the dependencies in the parser app and the timely dependency specification was missing. Thus, I added it and recompiled:

  defp deps do
    [
      {:shared, in_umbrella: true},

      {:timely, "~> 2.0"},
    ]
  end

Unfortunately, I still get the same warning. I tried running mix deps.get just in case it needed to update my mix.exs file in order to get rid of the warning. However, this also did not work.

Any help is appreciated!

Have you tried options 1 and 3?

Furthermore, it says 5 invalid call locations. Shouldn’t be more than 15-20 minutes to replace them with Timex or even the stdlib if this problem proves to be stubborn.

@dimitarvp Thanks for the reply.

I have tried option 1 and it does seem to fix it. I have not tried option 3 as I really do not want to ignore these warnings.

It is unfortunate that this new’ish feature seems to have broken not specifying your deps in :extra_applications.

Additionally, I used an external dep as an example, but I am also sometimes having trouble with in_umbrella deps. Thus, I cannot simply replace it with another external dependency.

Anyone else having this issue?

Thanks!

You really shouldn’t add it to :extra_applications, that might break releases.

At this moment, it is just a warning for the “boundary” check.

It basically means, that you are calling a function from an application that is not a direct dependency of the application that does the call.

Using “shared” or “proxy” apps, that just pull dependencies in an umbrella that you call from all the others, is an antipattern.

To fix your issue, remove the “shared”/“proxy” app and specify the correct dependency in each app of the umbrella.

1 Like