Elixir 1.10-dev: adding transitive deps to mix.exs now a requirement?

34 views
Skip to first unread message

Kip

unread,
May 16, 2020, 12:57:08 AM5/16/20
to elixir-lang-core
I notice on elixir master than a warning is now issued if transitive dependencies aren't directly configured in `mix.exs` and I'm curious as to the motivation and purpose.

José Valim

unread,
May 16, 2020, 3:03:37 AM5/16/20
to elixir-l...@googlegroups.com
Can you please show the warning you get? The new warning we have is not about transitive deps, but about Elixir/OTP apps that you use and you do not declare.

On Sat, May 16, 2020 at 06:57 Kip <kipc...@gmail.com> wrote:
I notice on elixir master than a warning is now issued if transitive dependencies aren't directly configured in `mix.exs` and I'm curious as to the motivation and purpose.

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/3096188b-42de-414f-9cfd-3660e4964477%40googlegroups.com.

Kip

unread,
May 16, 2020, 4:13:17 AM5/16/20
to elixir-lang-core
In the library application https://github.com/elixir-cldr/cldr_units compiling on master produces

==> ex_cldr
Compiling 2 files (.erl)
Compiling 30 files (.ex)
warning: Cldr.Chars.List.__impl__/1 defined in application :ex_cldr_lists is used by the current application but the current application does not directly depend on :ex_cldr_lists. To fix this, you must do one of:

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

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

  lib/cldr/protocol/cldr_chars.ex:3: Cldr.Chars.impl_for/1

warning: Cldr.Chars.Float.__impl__/1 defined in application :ex_cldr_numbers is used by the current application but the current application does not directly depend on :ex_cldr_numbers. To fix this, you must do one of:

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

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

  lib/cldr/protocol/cldr_chars.ex:3: Cldr.Chars.impl_for/1

warning: Cldr.Chars.Integer.__impl__/1 defined in application :ex_cldr_numbers is used by the current application but the current application does not directly depend on :ex_cldr_numbers. To fix this, you must do one of:

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

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

  lib/cldr/protocol/cldr_chars.ex:3: Cldr.Chars.impl_for/1

Generated ex_cldr app

The warning occurs for all the protocol implementations that are implemented in dependencies but the protocol itself is defined in `ex_cldr` and thats where the warning is emitted.

The mix.exs is:

  def application do
    [
      extra_applications: [:logger]
    ]
  end

  defp deps do
    [
      {:ex_cldr_numbers, "~> 2.13"},
      {:ex_cldr_lists, "~> 2.5"},
      ....
    ]
  end

As you can see, the warning relates to:

1. ex_cldr_numbers which is explicitly configured in deps and is not an otp app (has no `use Application`)
2. ex_cldr_lists which is explicitly configured in deps and is also not an otp app

Let me know if you'd prefer this logged as an issue?

José Valim

unread,
May 16, 2020, 4:39:44 AM5/16/20
to elixir-l...@googlegroups.com
Yes, please open up an issue and I will investigate.
Reply all
Reply to author
Forward
0 new messages