-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request for feedback on GHC proposal to change warning severity #207
Comments
Massive +1 from me! |
I too think this is a good idea. |
That's interesting. The GHC SC is worried about making a change that will outright-break some (not much but some) existing code, causing an error where there would currently be a warning. An alternative would be to create the On the other hand, an ignorant client might simply ignore the warnings (they are only warnings after all) and then get hard to debug non-termination errors. A reason for consulting the CLC is to get your views about balancing:
Any views? |
Any package that is broken by promoting this from a warning to an error is already seriously broken. The debug/diagnosis time for fixing a missing method in a dependency, especially when the class and instance may be buried deep in a dependency graph, is far worse than fixing it up pre-emptively, esp since a fix can be a package version bound and Hackage revision, at smallest, or setting - I can't imagine a scenario where a class author puts a new method on a class and I don't want that to be a breaking change for all downstream users. EDIT: I guess to elaborate - this kind of error isn't the sort of error that can really live very long in the wild anyway. Package Contrasting with I think GHC should strive to make fewer breaking changes, and make those changes as easy-to-adopt as possible. But this is not a question of GHC breaking things, but rather revealing and providing early-diagnosis for already broken things. In a perfect world, |
My stance is the same as the one I posted to the SC. So a copy here too: Just to clarify: I am not against change, or evolution. I'm actually looking forward to progress. What I am against ist sudden breakage. Can't we have Ideally I'd like to see something like a warning for My test for support is generally: can I take existing code unmodified, swap out the compiler, and it will still compile? That way I can report Again, I'm not against breakage per-se. I'm against sudden breakage. Managed evolution or however we want to call it, is something I have been and I will continue to be against any form of sudden breakage. The test will always be: can I swap out the compiler trivially to test a new compiler? |
+1 iif given a transition/migration period. -1 without. |
@angerman since this type of breakage does not require you to change any code, but only adjusting your cabal/stack/GHC flags configuration if you don't care about the errors... is it not enough to put it prominently in the release migration guide? GHCup can print post install messages. We could start linking to the migration guide or warn about this instance directly. I feel the cost is low. |
@hasufell so the release notes will say:
And then those flags will bitrot there? That's an ever worse outcome imo. Cranking up the warnings/loudness of the warnings, sure. But requiring changes to your project to swap out the compiler? No. It's bad enough as it is already. I'm not willing to agree to this just because it's small. The next time this will be used as a pretext to make me agree to just so slightly larger changes. Again, changing this is fine. I'm just opposed to changing this abruptly. We already have releases ever ~6mo. |
(GHC-7.4 was released in 2012). EDIT: We don't need |
@phadej yes. And we have other warnings too. So every warning can become an error now? Please do not selectively quote me like that. This is what I wrote:
I've added additional emphasis to highlight what I tried to convey. |
So the assumption is that there are people reading warnings for their dependencies after each upgrade to GHC, but are not acting on them, unless the warning says it will become an error? |
@nomeata i have honestly no idea if
Is an informative warning or a severe one. It looks mostly informative. The warning doesn't even say why this is a problem. Ok, so there is no default method, so what? GHC seems to suggest I should probably add one, but it doesn't say in any form what so ever that it will start rejecting this by default going forward. Again, I have no objection to introducing severity. I have an objection to turning a warning into a sudden error without prior notice. |
We're talking about warnings that can lead to runtime errors. At least that's what @parsonsmatt was getting at afaiu. This is indeed an interesting discussion. I'm not perfectly sold on either side. To me the cost is low enough to just toggle it. If others feel strongly against it, a more elaborate deprecation can take place too. |
Then in a future release:
which I consider a good solution. It adds more context to the warning. It informs the user that this is severe enough to become an error going forward and then follows this by turning it into an error in a later GHC release. |
I think there are two things to discuss:
I can easily get behind @angerman wrt point 1. The policy should be that there can't be breaking changes to defaults without clear communication and deprecation. Then: does the currently discussed instance qualify for an exception? The brought forward arguments were:
@angerman if that is not sufficient for making an exception to a stricter policy, what would be? Nothing? |
@hasufell for a warning that has been there for 10 years (and the associated issues have been there as long then as well), we now need an exception to go from instead 6mo month with a significantly more informative warning, to an error? Where does this rush come from that doesn't permit even a 6mo transition period? As @phadej pointed out, this has been a warning in GHC since 2012. If we are going to make this an error in ghc 9.10 (~6mo out), that would be in 2024 or 12 years (144mo) vs making it an error in ghc 9.12 (150mo; a ~5% increase). We could potentially even compromise on idk. GHC 9.8.2 starting to have improved warnings and then 9.10 throwing an error, if we feel this really needs to be rushed. This whole discussion also feels a bit like "our users are stupid, we need to force their hand". I'm not very comfortable with that line of thought. I'd be much more comfortable with "our users appear stupid, we need to think hard how to educate them better". @hasufell Let's assume we had a policy in place. From the arguments you brought forward I can see the merit for 2, but I don't see why a more informative warning text can't address this and it needs to be a sudden error. I believe argument 3 actually supports a transition period, if we were able to live with a warning for so long, we can surely live just a little longer with a warning. And while 1 seems like a small change, I don't see how this warrants skipping a transition period. Again, @adamgundry has in my opinion suggest a very excellent path forward. That
|
Let's see if that suggestion (summarised here) resonates with other CLC members. It looks good to me. |
I would be happy with that suggestion. |
I opened a ghc-proposal issue ghc-proposals/ghc-proposals#544 roughly a year ago. If the change is going to happen only in GHC-9.10, it's at best 1.5 years; but probably closer to two years. I added OTOH two years from a need to an implementation is not long, but OTOH that issue being a prerequisite for another stuff so it has to wait until then. It took too long already, so I dropped an idea for IMHO, GHC evolution is halted to death. I probably should learn to be fine with the current state of affairs in GHC/base/... or/and contribute somewhere else where I can feel I get something done. |
I'm happy with a longer migration period, though I'm not sure I see the point. It would be interesting to see the impact assessment. After sleeping on this, I have one reservation. An idiom I like is to define, say, instance TypeError ('Text "Informative and useful error message") => Cls T Where defining the methods is unnecessary - after all, you can't call them without incurring a type error anyway. But this does still trigger We can reduce the impact of breaking changes here if we can also reduce the warnings on |
@parsonsmatt Nope. With GHC-9.8: with
but with Prelude GHC.TypeError> instance Unsatisfiable ('Text "No") => Num () where
-- no warnings. That is one of the benefits of |
FTR I'm strongly in favor of the proposed change and I don't see much point in delaying it (I'm not against delaying, I just don't see why). There is a warning already (which means that you can fix all occurencies without upgrading GHC), and one can undo the change globally with a single line in
I appreciate the ask, but as a matter of principle, I'm worried about erosion of responsibilities. Following this line of thinking, one should consult CLC on every GHC proposal, because, well, each proposal can break something and affects long-term maintainability of the language. We are not particularly well equipped to discuss such questions and do not hold a community mandate to decide on. I wish GHC SC felt more confidence to make decisions within their purview. Maintaining two parallel discussions (here and at the GHC proposals tracker) is not helpful. I strongly urge everyone to continue the discussion at ghc-proposals/ghc-proposals#571. |
I think we do, but thought it worth consulting you as a matter of politeness. While many GHC proposals could break something, this one is unusual in that it is primarily designed to break something (albeit things that probably have bugs), and the CLC has a lot of experience in the consequences of such breakage. I agree that it'd be better to invite CLC members to contribute to ghc-proposals/ghc-proposals#571 rather than to have two paralel threads. Contributing is a matter of choice, not obligation! We are not seeking formal approval, for reasons you mention. |
The GHC proposal has been sent for revision, so I guess we can close this discussion for now. |
The GHC Steering Committee is considering a proposal to enable
-Werror=missing-methods -Werror=missing-fields
by default. See ghc-proposals/ghc-proposals#571 (rendered version).This is a breaking change to existing code (which has been impact assessed). Moreover, it means that future changes to libraries will more easily lead to breaking changes, because the addition of a method to a class or a field to a record will trigger a compile-time error (rather than a warning). Thus while it does not directly involve changes to
base
, we would appreciate feedback from the CLC as to whether this change is desirable.The text was updated successfully, but these errors were encountered: