Closed sellout closed 2 years ago
Can we not use -Werror in local builds, or at least have an easy way to turn it off (like some cli arguments to nix develop)?
The elusive ideal, of course, is having 1. warnings that don't disappear on subsequent builds and 2. the failure only occur at the end of the build.
Using -Werror
breaks 2, but leaving it off breaks 1.
We should make it toggleable for local builds, after which I have a slight preference for the default being “on”, to avoid surprises during CI.
However, I wouldn't want to hold up this change for that functionality. We currently have a less elegant toggle by commenting out a line of flake.nix and cabal builds also don't have -Werror
locally.
surprises during CI.
That has definitely happened to me before, but much less frequently than me having to turn off -Werror during development. But once we have a toggle for it then it won't matter to me what the default is.
Also it occurred to me that when supporting many GHC versions, it can be quite hard to eliminate all warnings.
Also it occurred to me that when supporting many GHC versions, it can be quite hard to eliminate all warnings.
Yeah, there’s a bit of annoyance with definitions moving between GHC API modules, but I think it's worth it, because allowing any warnings makes it easier to miss more important ones. E.g., there were some partial pattern matches and shadowed identifiers that were already missed. Plus, the most common GHC versioning warning is unused imports, and there are some of those that should actually be cleaned up.
Can we not use -Werror in local builds, or at least have an easy way to turn it off (like some cli arguments to nix develop)?
So, this change doesn't yet enable -Werror
in cabal builds, only in Nix builds. So local builds still generally avoid it. Think we can go ahead with it?
This doesn’t affect the cabal files, so published packages still won’t fail on warnings.