Skip to content

Warnings from git dependency's mix.exs issued on every mix task execution #13132

Closed as not planned

Description

@michallepicki

Elixir and Erlang/OTP versions

Erlang/OTP 26 [erts-14.1.1] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]

Elixir 1.16.0-rc.0 (792d4cc) (compiled with Erlang/OTP 26)

Operating system

happens on both linux amd64 and macos arm64

Current behavior

Hi! This is not a big issue, but it's a small annoyance that I noticed when trying out the 1.16.0-rc.0

When a git dependency has code in its mix.exs file which causes warnings, these warnings are printed not only when this dependency is compiled, but also every next time any mix task is executed.

Repro: https://github.com/michallepicki/elixir-1-16-git-dep-mix-exs-warnings-repro

mix deps.get
mix deps.compile

mix compile

# or any other task:
mix help
mix test

# result in these warnings being printed again and again:

    warning: parentheses are required for function calls with no arguments, got: Mix.env
    │
  8 │      build_embedded: Mix.env == :prod,
    │                          ~
    │
    └─ /var/home/michal/ubu/hmmm/deps/plug_forwarded_peer/mix.exs:8:26: PlugForwardedPeer.Mixfile.project/0

    warning: parentheses are required for function calls with no arguments, got: Mix.env
    │
  9 │      start_permanent: Mix.env == :prod,
    │                           ~
    │
    └─ /var/home/michal/ubu/hmmm/deps/plug_forwarded_peer/mix.exs:9:27: PlugForwardedPeer.Mixfile.project/0

Expected behavior

The warnings coming from a dependency are only printed when this dependency is being compiled

Activity

  1. josevalim commented on Nov 22, 2023

    @josevalim
    Member

    There isn't much we can do here. The mix.exs for git dependencies is loaded every time you boot and therefore any warning will be emitted. We could silence warnings by capturing all IO but, given it can have side-effects, I would like to postpone taking such actions for now. What I will do is to postpone this particular warning itself, so there is more time to migrate.

  2. michallepicki commented on Nov 22, 2023

    @michallepicki
    ContributorAuthor

    There isn't much we can do here. The mix.exs for git dependencies is loaded every time you boot and therefore any warning will be emitted. We could silence warnings by capturing all IO but, given it can have side-effects, I would like to postpone taking such actions for now.

    Understandable, thank you for the explanation!

    What I will do is to postpone this particular warning itself, so there is more time to migrate.

    For me it's not a big problem so I would be also fine with having to update the dependency or forking it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions