
(I'd argue that most errors can be turned into warnings via -fdefer-type-errors. It's really coarse though.) When reading the summary, I was anticipating voting against the proposal, turning warnings into errors by default creates spurious work for package maintainers. But I think I'm now convinced. Joachim & Oleg's point is that we want to consider creating additional `-Wsevere` warnings *to not be backward compatible*. It's an obligation on GHC designers, and on package maintainers: such change must be considered very carefully and must be properly documented. If we break compatibility this way, we want to trigger as many errors as possible, so that packages get fixed (which they almost certainly need to). This is the criterion for having a warning be part of `-Wsevere`. And the two first contestants (missing methods and missing fields) absolutely seem to fit the bill. So I'm in favour. I have no opinion about whether there is a better way to describe the spectrum of error-to-warning, as per Simon's musing. I agree that the CLC should be consulted on this, as it also imposes duties on them. /Arnaud On Thu, 14 Sept 2023 at 11:10, Simon Peyton Jones < simon.peytonjones@gmail.com> wrote:
Joachim, along with Oleg Grenrus, proposes to change -Wmissing-methods
and -Wmissing-fields warnings into errors by default (retaining the option to downgrade them)
I'm fine with making these errors, provided the impact on library authors is not too severe. But this is a breaking change and people will shout at us.
*Moritz*, on the face of it this is just the kind of thing you dislike -- and yet it makes it much harder to inadvertently create truly nasty bugs.
This doesn't affect the API of base, and so is no in CLC purview, but I'd quite like to ask their opinion. What I don't want is for us to accept it, and then have a firestorm of complaints. I think the case is strong: debugging infinite loops is very painful.
The proposal establishes the precedent that some warnings may be treated
as errors by default
This is a funny thing. A warning that is an error by default is perhaps.. an error? Or to put it another way, perhaps all errors are just warnings that are treated as errors by default?
Perhaps this new beast is an error that can be turned into a warning? (Most errors cannot.)
I'm not arguing against the proposal, just wondering if there is a simpler way to say this.
Simon
On Thu, 14 Sept 2023 at 09:33, Adam Gundry
wrote: Dear Committee,
Joachim, along with Oleg Grenrus, proposes to change -Wmissing-methods and -Wmissing-fields warnings into errors by default (retaining the option to downgrade them). I recommend we accept the proposal.
Proposal: https://github.com/ghc-proposals/ghc-proposals/pull/571 Rendered:
https://github.com/ghc-proposals/ghc-proposals/blob/wsevere/proposals/0000-s...
This is primarily motivated by the fact that when classes have default methods, missing methods can lead to runtime loops, which are generally difficult to debug. Since in practice not all users pay attention to warnings that do not inhibit compilation, it makes sense to identify a class of warnings that are sufficiently serious to require explicit action from the user to silence them.
Since these warnings are currently not errors by default, library authors experimentally assessing the impact of changes may be lead to assume that introducing new methods/fields does not lead to breakage (because downstream code will still compile). The proposal thus makes it more obvious that adding a new method or field is a breaking change.
The proposal deliberately causes builds to fail by default for some libraries that currently emit warnings. Oleg has kindly performed impact assessments to identify such libraries, and the breakage of a few packages seems worth the cost.
It is easy to restore the warnings to their previous classification by passing an option at build time, e.g. using -Wno-error=missing-methods. Users can set such an option in cabal.project or stack.yaml to work around breakage that is not promptly fixed by the library author.
This change does mean that GHC with -XHaskell98/2010 will by default reject some programs that are explicitly permitted by the Haskell98/2010 specification. I recommend we document this infelicity, but accept it, as much of the benefit of the proposal is that it applies by default.
The proposal establishes the precedent that some warnings may be treated as errors by default, and introduces a warning group -Wsevere to classify them. This seems conceptually useful and gives us the option to extend the -Wsevere set in the future (e.g. as a final stage of deprecation before a feature is removed).
Thoughts?
Adam
On 11/09/2023 20:25, Joachim Breitner wrote:
Dear Committee,
based on suggestions by Oleg Grenrus, I wrote a proposal to introduce a warning group -Wsevere for on-by-defaults, error-by-default warnings, and initially fill it with missing-methods and missing-fields.
https://github.com/ghc-proposals/ghc-proposals/blob/wsevere/proposals/0000-s...
I’d like to nominate Adam as the shepherd, who already reviewed it a bit on Github.
Please guide us to a conclusion as outlined in https://github.com/ghc-proposals/ghc-proposals#committee-process
Cheers, Joachim
-- Adam Gundry, Haskell Consultant Well-Typed LLP, https://www.well-typed.com/
Registered in England & Wales, OC335890 27 Old Gloucester Street, London WC1N 3AX, England
_______________________________________________ ghc-steering-committee mailing list ghc-steering-committee@haskell.org https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee
_______________________________________________ ghc-steering-committee mailing list ghc-steering-committee@haskell.org https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee
-- Arnaud Spiwack Director, Research at https://moduscreate.com and https://tweag.io.