`warnings_as_errors: true` disregarded in some umbrella situations?


I have several apps in one umbrella, each with elixirc_options: [warnings_as_errors: true] in their Mixfile.
Some of those apps are depended upon by others in the umbrella. It looks like in that case, the setting has no effect…

I have found this comment Hex package health and janitorial work which makes the statement that the setting is disabled for dependencies.

Has anybody found a way to override this?

1 Like

I could not find a workaround, and I’d really prefer this to be configurable for all apps living inside the umbrella structure. Maybe I should open an issue?

Wait, you are saying that inside an umbrella app, if one of your sub-apps has compiler warning errors, the warnings_as_errors setting isn’t respected?

If so, that’s quite unfortunate because fixing that upstream in the Elixir compiler would mean that all dependency warnings (including the external ones) would break your build – if I am understanding this correctly. You should probably file an issue for the discussion at the very least.

1 Like

I would suggest the following behaviour:

If the mix.exs at the umbrella level has warnings_as_errors set, this is respected for all apps in the umbrella, but all other deps have this overidden to false.

This would make sense because I’m not responsible for upstream warnings, but for those in my own umbrella.

warnings_as_errors should work for umbrella child apps, if it doesnt, thats a bug and please report it, ideally with a sample project. In our umbrella we use this on CI:

 mix deps.compile —skip-umbrella-children
 mix compile —warnings-as-errors

And it definitely fails on warnings.

We have two commands to nicely separate compiler output of our and others code.


Can’t reproduce this at the moment, but I’ll come back here when the problem reappears.

I dug a bit deeper and it looks like it’s this issue: https://github.com/elixir-lang/elixir/issues/9861

So I’ll have to wait a few months before I can upgrade, and be really careful in the meantime.

1 Like