Is there a consensus within the Haskell community on the use of -Werror in packages uploaded to Cabal? Most places where I've worked, building with -Werror has been considered a laudable ideal, but fixing all the old warnings in the codebase was too much work, so it wasn't done. I suppose -Werror could cause problems in heterogeneous build environments. -- Johan Larson -- Toronto, Canada
On Tue, Jul 1, 2014 at 1:25 PM, Johan Larson <johan.g.larson@gmail.com> wrote:
Is there a consensus within the Haskell community on the use of -Werror in packages uploaded to Cabal?
GHC's interpretation of Haskell, and the warnings it provides, change often enough that -Werror is generally a good way to lock a package to one or a small number of GHC releases. As such, last I heard Hackage complained if -Werror was found in a package's cabal file. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
yeah, -Wall makes enough noise to have a good ROI What I do though, is enable Werror on my Travis Ci formulae. On Tue, Jul 1, 2014 at 1:30 PM, Brandon Allbery <allbery.b@gmail.com> wrote:
On Tue, Jul 1, 2014 at 1:25 PM, Johan Larson <johan.g.larson@gmail.com> wrote:
Is there a consensus within the Haskell community on the use of -Werror in packages uploaded to Cabal?
GHC's interpretation of Haskell, and the warnings it provides, change often enough that -Werror is generally a good way to lock a package to one or a small number of GHC releases. As such, last I heard Hackage complained if -Werror was found in a package's cabal file.
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-Werror has unintended consequenses in a release. Say you are using transformers/mtl and you want to stay backwards compatible, you can't use Except since it's just in the new versions, but with -Werror you couldn't use Error since it would produce deprecation warnings. CPP isn't an option since that would change the implementation. I don't like the idea of disabling deprecation warninings since that setting has at least module level granularity, if other deprecations pop up I want to see those! By enabling -Werror you are turning a non breaking change (deprecation) into a breaking one and not even an upper bound of <= A.B.C.D would be safe since the number of components are arbitrary. The granularity of disabled warnings is part of the problem, it'd be really nice if you could disable deprecation warnings for specific identifiers, same with a lot of the other warnings. - Adam On Tue, Jul 1, 2014 at 7:34 PM, Carter Schonwald <carter.schonwald@gmail.com
wrote:
yeah, -Wall makes enough noise to have a good ROI
What I do though, is enable Werror on my Travis Ci formulae.
On Tue, Jul 1, 2014 at 1:30 PM, Brandon Allbery <allbery.b@gmail.com> wrote:
On Tue, Jul 1, 2014 at 1:25 PM, Johan Larson <johan.g.larson@gmail.com> wrote:
Is there a consensus within the Haskell community on the use of -Werror in packages uploaded to Cabal?
GHC's interpretation of Haskell, and the warnings it provides, change often enough that -Werror is generally a good way to lock a package to one or a small number of GHC releases. As such, last I heard Hackage complained if -Werror was found in a package's cabal file.
-- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Johan Larson <johan.g.larson@gmail.com> writes:
Is there a consensus within the Haskell community on the use of -Werror in packages uploaded to Cabal?
I like to hide -Werror behind a cabal flag: flag maintainer description: Enable settings for the package maintainer. default: False if flag(maintainer) ghc-options: -Werror -- Peter Jones, Founder, Devalot.com Defending the honor of good code
@Peter you'll want to write flag maintainer description: Enable settings for the package maintainer. default: False manual: True note the Manual : True piece, you'll be creating a world of sad if cabal-install auto sets that to true by accident ! :) On Tue, Jul 1, 2014 at 2:23 PM, Peter Jones <mlists@pmade.com> wrote:
Johan Larson <johan.g.larson@gmail.com> writes:
Is there a consensus within the Haskell community on the use of -Werror in packages uploaded to Cabal?
I like to hide -Werror behind a cabal flag:
flag maintainer description: Enable settings for the package maintainer. default: False
if flag(maintainer) ghc-options: -Werror
-- Peter Jones, Founder, Devalot.com Defending the honor of good code
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Carter Schonwald <carter.schonwald@gmail.com> writes:
note the Manual : True piece, you'll be creating a world of sad if cabal-install auto sets that to true by accident ! :)
How would that happen? (Just curious.) -- Peter Jones, Founder, Devalot.com Defending the honor of good code
every flag defaults to Manual: True I think and then when cabal is trying to find a good build plan it will twiddle flags! On Tue, Jul 1, 2014 at 3:06 PM, Peter Jones <mlists@pmade.com> wrote:
Carter Schonwald <carter.schonwald@gmail.com> writes:
note the Manual : True piece, you'll be creating a world of sad if cabal-install auto sets that to true by accident ! :)
How would that happen? (Just curious.)
-- Peter Jones, Founder, Devalot.com Defending the honor of good code
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Carter Schonwald <carter.schonwald@gmail.com> writes:
every flag defaults to Manual: True I think and then when cabal is trying to find a good build plan it will twiddle flags!
Wow. Well, that's good to know. Thanks. -- Peter Jones, Founder, Devalot.com Defending the honor of good code
I meant defaults to manual : false, But you get the idea. (I could be wrong. But still worth being explicit in your cabal files so no need to remember what the default is) On Tuesday, July 1, 2014, Peter Jones <mlists@pmade.com> wrote:
Carter Schonwald <carter.schonwald@gmail.com <javascript:;>> writes:
every flag defaults to Manual: True I think and then when cabal is trying to find a good build plan it will twiddle flags!
Wow. Well, that's good to know. Thanks.
-- Peter Jones, Founder, Devalot.com Defending the honor of good code
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org <javascript:;> http://www.haskell.org/mailman/listinfo/haskell-cafe
Why does cabal-install twiddle flags though? Surely if I say "default: False" that means "don't set this to True unless you actually want it". Having an extra "Manual" field seems like duplication. On 2 July 2014 07:42, Carter Schonwald <carter.schonwald@gmail.com> wrote:
I meant defaults to manual : false, But you get the idea. (I could be wrong. But still worth being explicit in your cabal files so no need to remember what the default is)
On Tuesday, July 1, 2014, Peter Jones <mlists@pmade.com> wrote:
Carter Schonwald <carter.schonwald@gmail.com> writes:
every flag defaults to Manual: True I think and then when cabal is trying to find a good build plan it will twiddle flags!
Wow. Well, that's good to know. Thanks.
-- Peter Jones, Founder, Devalot.com Defending the honor of good code
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com http://IvanMiljenovic.wordpress.com
On Tue, Jul 1, 2014 at 9:20 PM, Ivan Lazar Miljenovic < ivan.miljenovic@gmail.com> wrote:
Why does cabal-install twiddle flags though?
Surely if I say "default: False" that means "don't set this to True unless you actually want it". Having an extra "Manual" field seems like duplication.
Not exactly. You use it to specify which alternative to try first; and the reason it's trying alternatives is so that it can adapt to different platforms: dependency versions (e.g. the old split-base flag), Unix vs. Windows, etc. Controlling which one is tried first may be necessary to ensure it doesn't accidentally match something that appears to work but is less correct or appropriate than the alternative. For example, using an older library setup may work in installations that have both old and new libraries, but trying the new one first is likely to have e.g. performance or compatibility benefits. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
On 01/07/2014 19:23, Peter Jones wrote:
Johan Larson <johan.g.larson@gmail.com> writes:
Is there a consensus within the Haskell community on the use of -Werror in packages uploaded to Cabal?
I like to hide -Werror behind a cabal flag:
flag maintainer description: Enable settings for the package maintainer. default: False
if flag(maintainer) ghc-options: -Werror
I do this too (with the Manual flag), but one problem is it makes 'cabal check' complain even with the conditional: https://github.com/haskell/cabal/issues/1775 There's the cabal.config option mentioned in that issue but it's less discoverable. Ganesh
participants (7)
-
Adam Bergmark -
Brandon Allbery -
Carter Schonwald -
Ganesh Sittampalam -
Ivan Lazar Miljenovic -
Johan Larson -
Peter Jones