<div dir="ltr"><div>FWIW, Mix also disables warnings as errors for both Erlang (Rebar) and Elixir (Mix) dependencies, for exactly the same reasons outlined by Loïc.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><br></div><div><br></div><div><span style="font-size:13px"><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><b>José Valim</b></span></div><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><div><span style="font-family:verdana,sans-serif;font-size:x-small"><a href="http://www.plataformatec.com.br/" style="color:rgb(42,93,176)" target="_blank">www.plataformatec.com.br</a></span></div><div><span style="font-family:verdana,sans-serif;font-size:x-small">Skype: jv.ptec</span></div><div><span style="font-family:verdana,sans-serif;font-size:x-small">Founder and Director of R&D</span></div></span></div></span></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, Jun 6, 2018 at 1:38 PM, Loïc Hoguin <span dir="ltr"><<a href="mailto:essen@ninenines.eu" target="_blank">essen@ninenines.eu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 06/06/2018 01:18 PM, Fred Hebert wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 06/06, Loïc Hoguin wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
It's worth noting that you did not have an issue with Cowboy, Ranch and friends. That's because the default policy in Erlang.mk is to NOT use warnings_as_errors for dependencies (and as a result this option is not included in the generated rebar.config).<br>
<br>
This saves a lot of headaches. erlang:get_stacktrace/0 is notable in how widely used it is but issues with warnings_as_error have always existed for as long as I've been doing Erlang. Tools should really have a saner default policy for this. The build shouldn't break for your users just because a new warning was introduced.<br>
<br>
</blockquote>
<br>
Rebar3 leaves the warnings that libs put for themselves there.<br>
<br>
There's a PR currently going about adding a 'del' override, which would let someone remove the option by specifying:<br>
<br>
{overrides, [<br>
{del, [<br>
{erl_opts, [warning_as_errors]}<br>
]}<br>
]}<br>
<br>
and would let you instantly remove the option from all dependencies rather than having to go through the override pattern Jesper has shown here.<br>
<br>
If/Once merged, it would help address the problem. I'm a bit hesitant to go and disable some options _by default_ when library authors have set them there for a reason.<br>
</blockquote>
<br></span>
They have a reason of course: this option is great during development. Everyone should use it.<br>
<br>
Building as a dependency is a different context though and having your dependencies break every time there's a new OTP version is not the best user experience. I suppose Rebar3 has a way to have stricter compilation profiles for use during development, but I haven't seen much use of that. So it falls down to each dependency's user to fix those issues, and that's a problem.<br>
<br>
It being a default may or may not be a good idea, I don't know. All I do know is that nobody complained and nobody asked for an option to disable that behavior so I think it's good enough for now. It's one less problem to worry about. Rebar has more users and with a different mindset so the same may not apply.<span class="im HOEnZb"><br>
<br>
-- <br>
Loïc Hoguin<br>
<a href="https://ninenines.eu" rel="noreferrer" target="_blank">https://ninenines.eu</a><br></span><div class="HOEnZb"><div class="h5">
______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/list<wbr>info/erlang-questions</a><br>
</div></div></blockquote></div><br></div>