On 1/31/25 13:34, Zack Weinberg wrote:
[...]
There was actually a concrete reason why I put FATAL => 'all' in there:
I wanted it to be a hard error *during development* when new Perl warnings
show up, so that they get fixed promptly rather than going neglected,
trickling into releases, and spamming end users who probably don't care.
Since that is clearly also causing problems for end users, I suggest we
should find a way to keep the FATAL => 'all' for automake and autoconf
running out of git (and in particular for our own test suites), but
downgrade it to non-fatal upon 'make install'.
The testsuite should be able to do that by adding '-Mwarnings=FATAL,all'
to the $PERL command line, although that will require invoking perl
directly instead of relying on #! as the installed programs do. You
might also be able to put that in the PERL5OPT environment variable.
Making warnings fatal when running normally from a Git working tree is
harder, since warnings.pm is a lexical pragma. You should be able to do
something like:
BEGIN { warnings->import(FATAL => 'all') if running_development() }
Implementing "sub running_development" depends on how, exactly, you want
to detect a development environment. Simply using the command line
might be a better option for the testsuite.
Also note that the documentation for the "warnings" pragma (`perldoc
warnings`) says that using "FATAL => 'all'" is a bad idea and directly
risks forwards compatibility.
-- Jacob