Hi,
I created a project based on Spin CLI template, so I have a bin
module depending on lib
and
I noticed that when building in watch mode (dune build -p #{self.name} --watch
), warnings from the lib
module (where most of my code is) don’t get reported. They do get reported when simply building dune build -p #{self.name}
.
Is there anything I can do to change this behavior?
Thanks
Do they get not reported at all? Currently Dune’s handling of warnings is not ideal; they are printed the first time they are encountered, but during subsequent incremental builds, they are not re-displayed. This is one of the reason a lot of warnings are treated as errors in development mode.
FTR, this is one aspect of Dune we’d like to improve for 3.0.
No they don’t even get reported the first time in watch mode. They do get reported every time when simply building. I wouldn’t mind having to treat warnings as errors if that would allow me to see the warnings in watch mode every time.
Hmm, that seems like a bug then. Hopefully that should be sorted for Dune 3.0, but feel free to open a ticket about it on the Dune github project.
If you want to treat more warnings as errors, you can do so by writing the following in your toplevel dune
file:
(env
(dev
(flags :standard -w +A)))
+A
will make all warnings be errors, and you can turn only a subset via the syntax described in the man page for ocamlc
.
I updated dune from 2.8.2 to 2.8.4 and warnings do seem to get reported the first time now.
Thanks for your help!
1 Like