Flag to recompile modules which had warnings

This is a call for comments before I'd create a ticket in corresponding project (I'm not sure if it should be ghc or stack/cabal). There's a common situation I get into: I compile with "stack build" (or cabal build), get a big list of warnings, fix few of them, then I re-compile project, but a lot of warnings are gone now. The only option I'm left with is to use "-fforce-recomp". Problems with -fforce-recomp are: - full-recompile is quite long for big projects - most people don't know about it, especially newbies I think some flag, which would be turned on by default, which would indicate to "recompile modules if they previously had warnings" would be awesome to have. 1. would you like to have that flag? 2. would you like it "on" by default? 3. should ticket go into ghc or stack/cabal-install project? Thank you.

On Wed, Sep 02, 2015 at 09:44:21PM +0300, Kostiantyn Rybnikov wrote:
I think some flag, which would be turned on by default, which would indicate to "recompile modules if they previously had warnings" would be awesome to have.
1. would you like to have that flag? 2. would you like it "on" by default? 3. should ticket go into ghc or stack/cabal-install project?
Thank you.
I use often invoke ghc with `-Wall` and have experienced the same problem. I would like to have such a flag (off by default). I *think* the correct place where to implement this would be ghc.

I'm missing this too. GHC should be the right choice.
чт, 3 сент. 2015 г. в 0:30, Francesco Ariis
On Wed, Sep 02, 2015 at 09:44:21PM +0300, Kostiantyn Rybnikov wrote:
I think some flag, which would be turned on by default, which would indicate to "recompile modules if they previously had warnings" would be awesome to have.
1. would you like to have that flag? 2. would you like it "on" by default? 3. should ticket go into ghc or stack/cabal-install project?
Thank you.
I use often invoke ghc with `-Wall` and have experienced the same problem. I would like to have such a flag (off by default). I *think* the correct place where to implement this would be ghc. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe

On 3 September 2015 at 04:44, Kostiantyn Rybnikov
There's a common situation I get into: I compile with "stack build" (or cabal build), get a big list of warnings, fix few of them, then I re-compile project, but a lot of warnings are gone now. The only option I'm left with is to use "-fforce-recomp".
If you're going to fix all the warnings anyway, why not just use -Werror? -- Thomas Koster

Thanks, after re-considering this, I think moving towards -Werror (and
making this a "good style") works good enough and is the best solution for
this problem right now. Hopefully I'll find time to remove all warnings at
once to make its usage possible.
On Thu, Sep 3, 2015 at 2:23 AM, Thomas Koster
On 3 September 2015 at 04:44, Kostiantyn Rybnikov
wrote: There's a common situation I get into: I compile with "stack build" (or cabal build), get a big list of warnings, fix few of them, then I re-compile project, but a lot of warnings are gone now. The only option I'm left with is to use "-fforce-recomp".
If you're going to fix all the warnings anyway, why not just use -Werror?
-- Thomas Koster

2015-09-08 9:45 GMT+02:00 Kostiantyn Rybnikov
Thanks, after re-considering this, I think moving towards -Werror (and making this a "good style") works good enough and is the best solution for this problem right now. Hopefully I'll find time to remove all warnings at once to make its usage possible.
You can always use cabal build --ghc-options="-Wall -fno-code" then fix warnings and errors and then compile. Karol

On 08.09.2015 09:49, Karol Samborski wrote:
You can always use cabal build --ghc-options="-Wall -fno-code" then fix warnings and errors and then compile.
Would be nice if that worked, but with TemplateHaskell -fno-code does not get you very far... Andreas -- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel@gu.se http://www2.tcs.ifi.lmu.de/~abel/

If you're going to fix all the warnings anyway, why not just use -Werror?
I'm not sure if this is ghci or emacs haskell-mode, but if I use -Werror in my cabal file then any warnings will cause ghci to fail loading, and I can't use helpful interactive features like `:t myFunction` or `print someValue`.

On 3 September 2015 at 09:23, Thomas Koster
If you're going to fix all the warnings anyway, why not just use -Werror?
On 8 September 2015 at 22:41, Greg Horn
I'm not sure if this is ghci or emacs haskell-mode, but if I use -Werror in my cabal file then any warnings will cause ghci to fail loading, and I can't use helpful interactive features like `:t myFunction` or `print someValue`.
I didn't think about that. I don't use Emacs so I'm just guessing here, but depending on how haskell-mode works, you might be able to keep ghci happy by putting ":set -Wwarn" in your "~/.ghci" file, which should hopefully set warnings to be warnings again for ghci only. However, this may mean that ghci can compile a module where ghc refused and you're back where you started. -- Thomas Koster

On Tue, Sep 8, 2015 at 8:38 PM, Thomas Koster
I don't use Emacs so I'm just guessing here, but depending on how haskell-mode works, you might be able to keep ghci happy by putting ":set -Wwarn" in your "~/.ghci" file, which should hopefully set warnings to be warnings again for ghci only. However, this may mean that ghci can compile a module where ghc refused and you're back where you started.
:seti -Wwarn ? -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

On Tue, Sep 8, 2015 at 8:38 PM, Thomas Koster
I don't use Emacs so I'm just guessing here, but depending on how haskell-mode works, you might be able to keep ghci happy by putting ":set -Wwarn" in your "~/.ghci" file, which should hopefully set warnings to be warnings again for ghci only. However, this may mean that ghci can compile a module where ghc refused and you're back where you started.
On 9 September 2015 at 10:40, Brandon Allbery
:seti -Wwarn ?
Yes, probably. I was just guessing; I don't use ghci for this purpose myself, or "-Werror" or Emacs :) -- Thomas Koster
participants (8)
-
Andreas Abel
-
Brandon Allbery
-
Francesco Ariis
-
Geraldus
-
Greg Horn
-
Karol Samborski
-
Kostiantyn Rybnikov
-
Thomas Koster