-
Notifications
You must be signed in to change notification settings - Fork 389
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
warning 9 enabled by default in dev mode #8645
Comments
Sure, I see nothing wrong with doing it. It will require users to explicitly bump the dune language in their project file though. Do you have any other warnings you'd like to change? |
Agreed on the change only happening with the dune language version bump, so it's optin. My preference is generally for the defaults to be the same as upstream OCaml, to reduce the surprise factor for users. We could have the current defaults be available in another (non-default) profile to ease the transition as well. |
The upstream defaults disable warnings such as
and basically all the unused X warnings:
In principle, I don't mind. I just wonder if we're really improving UX by doing this. |
Disabling 42 is good though. |
Indeed, my copy paste was a little bit too wide. Fixed. |
I think the main thing that is bothering users is less which specific warnings are enabled by default, and more that they are enabled as errors. As a first step, why not at least remove I also would personally prefer dune to stick with OCaml's standard set of warnings/errors and make them evolve there instead (e.g. ocaml/ocaml#12475) but if it's not possible, at least removing |
Seems like a good time to advocate for the deprecation warning to not be a warn-error in any profile, again. |
@kit-ty-kate wrote:
I agree. It's the divergence to upstream that's causing confusion, so a good default is to start there and ensure that changes are done in lockstep with the compiler. Non-default Dune profiles can still be available with the current settings, though. |
I actually don't mind resetting the set of warnings to OCaml's, but removing
This is highly undesirable and is going to bring us back to the world before dune where every project was littered with random warnings. The correct way to fix this is to remove the |
Is that really that bad of a problem? OCaml-LSP/Merlin will still show warnings. And since people seem to just workaround this by manually downgrading all the "unused" errors back to warnings anyway we're kind of already in this world (at least for those people). I have two different use cases for warnings:
I like the idea of making dune attractive to people who just want to mess around with ocaml for fun and that scenario only sees case 1 above. For people using dune in production and who do need case 2, they will still be spending much more time writing code than shipping it so I claim that case 1 what we should be optimizing for when designing UX. My proposal would be to change the defaults to match the compiler but introduce a flag that treats warnings as errors similar to C's |
"Upstream" speaking! I'm glad to see this point being discussed and the discussion being constructive so far. FYI, warning 6 "labels-omitted" is now active by default: ocaml/ocaml#10140 . I would not be surprised if it becomes an error (or maybe a warning that triggers an error by default) at some point in the future. My feeling is that the default should be "few warnings and very few warnings as errors", to encourage discovery of the language and quick prototyping. On the other hand, it is currently rather painful to select a reasonable set of warnings to use for production-quality code, so we "upstream" should have more "presets" and better documentation. For example, did you know that |
Individual warnings got names a few versions ago, maybe the warning groups could have names too? |
It's pretty bad. If you want to make sure your project is warnings-free you need to do a clean build. If you have the dune cache enabled, you also need to remember to turn it off for the clean build. Okay, so I think the plan of action is pretty clear:
|
I tried to start an "upstream" discussion here: ocaml/ocaml#12557 . Please contribute! |
I do like that dune is pretty strict about warnings in It seems to me that devs take always the quicker path, which means that if Dune's dev profile becomes weaker few devs will invest time in going back to a sane warning dev setup. I do agree that it is sometimes annoying in rapid prototyping, so how to address this should be documented more prominently. |
Xavier Leroy notes in ocaml/ocaml#12201 (comment) that warning 9 being enabled by default in dune is not a good default. Is there a possibility of adjusting the default build flags to be more in line with the decisions taken by upstream OCaml in this regard?
The text was updated successfully, but these errors were encountered: