diff --git a/algebraic-graphs/Setup.hs b/algebraic-graphs/Setup.hs index 621e81e..aee59ef 100644 --- a/algebraic-graphs/Setup.hs +++ b/algebraic-graphs/Setup.hs @@ -7,7 +7,6 @@ -- Warns even when `Unsafe` is explicit, not inferred. See -- https://gitlab.haskell.org/ghc/ghc/-/issues/16689 {-# OPTIONS_GHC -Wno-unsafe #-} -{-# OPTIONS_GHC -fplugin=NoRecursion #-} module Main (main) where diff --git a/algebraic-graphs/algebraic-graph-duoids.cabal b/algebraic-graphs/algebraic-graph-duoids.cabal index e1b0cb5..6643439 100644 --- a/algebraic-graphs/algebraic-graph-duoids.cabal +++ b/algebraic-graphs/algebraic-graph-duoids.cabal @@ -37,17 +37,6 @@ source-repository head location: https://github.com/sellout/duoids.git subdir: algebraic-graphs -flag noisy-deprecations - description: - Prior to GHC 9.10, the @DEPRECATED@ pragma can’t distinguish between terms - and types. Consenquently, you can get spurious warnings when there’s a name - collision and the name in the other namespace is deprecated. Or you can - choose to not get those warnings, at the risk of not being warned when - there’s a name collision and the namespace you’re referencing is the one - that’s deprecated. - default: True - manual: False - custom-setup setup-depends: -- TODO: Due to haskell/cabal#3751, `Cabal` has to be specified even though @@ -58,7 +47,26 @@ custom-setup Cabal >= 3.0 && < 99, base ^>= {4.18.0, 4.19.0, 4.20.0, 4.21.0}, cabal-doctest ^>= {1.0.0}, - no-recursion ^>= {0.2.0, 0.3.0}, + +flag noisy-deprecations + description: + Prior to GHC 9.10, the @DEPRECATED@ pragma can’t distinguish between terms + and types. Consenquently, you can get spurious warnings when there’s a name + collision and the name in the other namespace is deprecated. Or you can + choose to not get those warnings, at the risk of not being warned when + there’s a name collision and the namespace you’re referencing is the one + that’s deprecated. + default: True + -- Because disabling this flag won’t help the solver. + manual: True + +flag verify-no-recursion + description: + Compile with "NoRecursion" enabled. This is intended for developers of this + package. + default: False + -- Because disabling this flag won’t help the solver. + manual: True -- This mimics the GHC2024 extension -- (https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html?highlight=doandifthenelse#extension-GHC2024), @@ -83,7 +91,6 @@ common defaults import: GHC2024 build-depends: base ^>= {4.18.0, 4.19.0, 4.20.0, 4.21.0}, - no-recursion ^>= {0.2.0, 0.3.0}, ghc-options: -Weverything -- This one just reports unfixable things, AFAICT. @@ -93,7 +100,6 @@ common defaults -- Warns even when `Unsafe` is explicit, not inferred. See -- https://gitlab.haskell.org/ghc/ghc/-/issues/16689 -Wno-unsafe - -fplugin=NoRecursion if impl(ghc >= 9.8.1) ghc-options: -- Inference good. @@ -121,6 +127,11 @@ common defaults NoTypeApplications if flag(noisy-deprecations) cpp-options: -DSELLOUT_NOISY_DEPRECATIONS + if flag(verify-no-recursion) + build-depends: + no-recursion ^>= {0.2.0, 0.3.0}, + ghc-options: + -fplugin=NoRecursion library import: defaults diff --git a/cabal.project b/cabal.project index fb374cc..e3ba44a 100644 --- a/cabal.project +++ b/cabal.project @@ -5,6 +5,11 @@ max-backjumps: -1 minimize-conflict-set: true reorder-goals: true +flags: + -- Ensure development of this project always uses @NoRecursion@, even if it + -- causes the solver to fail. + +verify-no-recursion + program-options ghc-options: -Werror diff --git a/core/Setup.hs b/core/Setup.hs index 621e81e..aee59ef 100644 --- a/core/Setup.hs +++ b/core/Setup.hs @@ -7,7 +7,6 @@ -- Warns even when `Unsafe` is explicit, not inferred. See -- https://gitlab.haskell.org/ghc/ghc/-/issues/16689 {-# OPTIONS_GHC -Wno-unsafe #-} -{-# OPTIONS_GHC -fplugin=NoRecursion #-} module Main (main) where diff --git a/core/duoids.cabal b/core/duoids.cabal index 74bdec7..3ab7cc9 100644 --- a/core/duoids.cabal +++ b/core/duoids.cabal @@ -38,17 +38,6 @@ source-repository head location: https://github.com/sellout/duoids.git subdir: core -flag noisy-deprecations - description: - Prior to GHC 9.10, the @DEPRECATED@ pragma can’t distinguish between terms - and types. Consenquently, you can get spurious warnings when there’s a name - collision and the name in the other namespace is deprecated. Or you can - choose to not get those warnings, at the risk of not being warned when - there’s a name collision and the namespace you’re referencing is the one - that’s deprecated. - default: True - manual: False - custom-setup setup-depends: -- TODO: Due to haskell/cabal#3751, `Cabal` has to be specified even though @@ -59,7 +48,26 @@ custom-setup Cabal >= 3.0 && < 99, base ^>= {4.18.0, 4.19.0, 4.20.0, 4.21.0}, cabal-doctest ^>= {1.0.0}, - no-recursion ^>= {0.2.0, 0.3.0}, + +flag noisy-deprecations + description: + Prior to GHC 9.10, the @DEPRECATED@ pragma can’t distinguish between terms + and types. Consenquently, you can get spurious warnings when there’s a name + collision and the name in the other namespace is deprecated. Or you can + choose to not get those warnings, at the risk of not being warned when + there’s a name collision and the namespace you’re referencing is the one + that’s deprecated. + default: True + -- Because disabling this flag won’t help the solver. + manual: True + +flag verify-no-recursion + description: + Compile with "NoRecursion" enabled. This is intended for developers of this + package. + default: False + -- Because disabling this flag won’t help the solver. + manual: True -- This mimics the GHC2024 extension -- (https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html?highlight=doandifthenelse#extension-GHC2024), @@ -84,7 +92,6 @@ common defaults import: GHC2024 build-depends: base ^>= {4.18.0, 4.19.0, 4.20.0, 4.21.0}, - no-recursion ^>= {0.2.0, 0.3.0}, ghc-options: -Weverything -- This one just reports unfixable things, AFAICT. @@ -94,7 +101,6 @@ common defaults -- Warns even when `Unsafe` is explicit, not inferred. See -- https://gitlab.haskell.org/ghc/ghc/-/issues/16689 -Wno-unsafe - -fplugin=NoRecursion if impl(ghc >= 9.8.1) ghc-options: -- Inference good. @@ -121,7 +127,13 @@ common defaults NoStarIsType NoTypeApplications if flag(noisy-deprecations) - cpp-options: -DSELLOUT_NOISY_DEPRECATIONS + cpp-options: + -DSELLOUT_NOISY_DEPRECATIONS + if flag(verify-no-recursion) + build-depends: + no-recursion ^>= {0.2.0, 0.3.0}, + ghc-options: + -fplugin=NoRecursion library import: defaults diff --git a/hedgehog/Setup.hs b/hedgehog/Setup.hs index 621e81e..aee59ef 100644 --- a/hedgehog/Setup.hs +++ b/hedgehog/Setup.hs @@ -7,7 +7,6 @@ -- Warns even when `Unsafe` is explicit, not inferred. See -- https://gitlab.haskell.org/ghc/ghc/-/issues/16689 {-# OPTIONS_GHC -Wno-unsafe #-} -{-# OPTIONS_GHC -fplugin=NoRecursion #-} module Main (main) where diff --git a/hedgehog/duoids-hedgehog.cabal b/hedgehog/duoids-hedgehog.cabal index e61026f..10340db 100644 --- a/hedgehog/duoids-hedgehog.cabal +++ b/hedgehog/duoids-hedgehog.cabal @@ -37,17 +37,6 @@ source-repository head location: https://github.com/sellout/duoids.git subdir: hedgehog -flag noisy-deprecations - description: - Prior to GHC 9.10, the @DEPRECATED@ pragma can’t distinguish between terms - and types. Consenquently, you can get spurious warnings when there’s a name - collision and the name in the other namespace is deprecated. Or you can - choose to not get those warnings, at the risk of not being warned when - there’s a name collision and the namespace you’re referencing is the one - that’s deprecated. - default: True - manual: False - custom-setup setup-depends: -- TODO: Due to haskell/cabal#3751, `Cabal` has to be specified even though @@ -58,7 +47,26 @@ custom-setup Cabal >= 3.0 && < 99, base ^>= {4.18.0, 4.19.0, 4.20.0, 4.21.0}, cabal-doctest ^>= {1.0.0}, - no-recursion ^>= {0.2.0, 0.3.0}, + +flag noisy-deprecations + description: + Prior to GHC 9.10, the @DEPRECATED@ pragma can’t distinguish between terms + and types. Consenquently, you can get spurious warnings when there’s a name + collision and the name in the other namespace is deprecated. Or you can + choose to not get those warnings, at the risk of not being warned when + there’s a name collision and the namespace you’re referencing is the one + that’s deprecated. + default: True + -- Because disabling this flag won’t help the solver. + manual: True + +flag verify-no-recursion + description: + Compile with "NoRecursion" enabled. This is intended for developers of this + package. + default: False + -- Because disabling this flag won’t help the solver. + manual: True -- This mimics the GHC2024 extension -- (https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html?highlight=doandifthenelse#extension-GHC2024), @@ -83,7 +91,6 @@ common defaults import: GHC2024 build-depends: base ^>= {4.18.0, 4.19.0, 4.20.0, 4.21.0}, - no-recursion ^>= {0.2.0, 0.3.0}, ghc-options: -Weverything -- This one just reports unfixable things, AFAICT. @@ -93,7 +100,6 @@ common defaults -- Warns even when `Unsafe` is explicit, not inferred. See -- https://gitlab.haskell.org/ghc/ghc/-/issues/16689 -Wno-unsafe - -fplugin=NoRecursion if impl(ghc >= 9.8.1) ghc-options: -- Inference good. @@ -120,7 +126,13 @@ common defaults NoStarIsType NoTypeApplications if flag(noisy-deprecations) - cpp-options: -DSELLOUT_NOISY_DEPRECATIONS + cpp-options: + -DSELLOUT_NOISY_DEPRECATIONS + if flag(verify-no-recursion) + build-depends: + no-recursion ^>= {0.2.0, 0.3.0}, + ghc-options: + -fplugin=NoRecursion library import: defaults diff --git a/transformers/Setup.hs b/transformers/Setup.hs index 621e81e..aee59ef 100644 --- a/transformers/Setup.hs +++ b/transformers/Setup.hs @@ -7,7 +7,6 @@ -- Warns even when `Unsafe` is explicit, not inferred. See -- https://gitlab.haskell.org/ghc/ghc/-/issues/16689 {-# OPTIONS_GHC -Wno-unsafe #-} -{-# OPTIONS_GHC -fplugin=NoRecursion #-} module Main (main) where diff --git a/transformers/duoidal-transformers.cabal b/transformers/duoidal-transformers.cabal index 1fc21df..06a0bfb 100644 --- a/transformers/duoidal-transformers.cabal +++ b/transformers/duoidal-transformers.cabal @@ -37,17 +37,6 @@ source-repository head location: https://github.com/sellout/duoids.git subdir: transformers -flag noisy-deprecations - description: - Prior to GHC 9.10, the @DEPRECATED@ pragma can’t distinguish between terms - and types. Consenquently, you can get spurious warnings when there’s a name - collision and the name in the other namespace is deprecated. Or you can - choose to not get those warnings, at the risk of not being warned when - there’s a name collision and the namespace you’re referencing is the one - that’s deprecated. - default: True - manual: False - custom-setup setup-depends: -- TODO: Due to haskell/cabal#3751, `Cabal` has to be specified even though @@ -58,7 +47,26 @@ custom-setup Cabal >= 3.0 && < 99, base ^>= {4.18.0, 4.19.0, 4.20.0, 4.21.0}, cabal-doctest ^>= {1.0.0}, - no-recursion ^>= {0.2.0, 0.3.0}, + +flag noisy-deprecations + description: + Prior to GHC 9.10, the @DEPRECATED@ pragma can’t distinguish between terms + and types. Consenquently, you can get spurious warnings when there’s a name + collision and the name in the other namespace is deprecated. Or you can + choose to not get those warnings, at the risk of not being warned when + there’s a name collision and the namespace you’re referencing is the one + that’s deprecated. + default: True + -- Because disabling this flag won’t help the solver. + manual: True + +flag verify-no-recursion + description: + Compile with "NoRecursion" enabled. This is intended for developers of this + package. + default: False + -- Because disabling this flag won’t help the solver. + manual: True -- This mimics the GHC2024 extension -- (https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/control.html?highlight=doandifthenelse#extension-GHC2024), @@ -83,7 +91,6 @@ common defaults import: GHC2024 build-depends: base ^>= {4.18.0, 4.19.0, 4.20.0, 4.21.0}, - no-recursion ^>= {0.2.0, 0.3.0}, ghc-options: -Weverything -- This one just reports unfixable things, AFAICT. @@ -93,7 +100,6 @@ common defaults -- Warns even when `Unsafe` is explicit, not inferred. See -- https://gitlab.haskell.org/ghc/ghc/-/issues/16689 -Wno-unsafe - -fplugin=NoRecursion if impl(ghc >= 9.8.1) ghc-options: -- Inference good. @@ -120,7 +126,13 @@ common defaults NoStarIsType NoTypeApplications if flag(noisy-deprecations) - cpp-options: -DSELLOUT_NOISY_DEPRECATIONS + cpp-options: + -DSELLOUT_NOISY_DEPRECATIONS + if flag(verify-no-recursion) + build-depends: + no-recursion ^>= {0.2.0, 0.3.0}, + ghc-options: + -fplugin=NoRecursion library import: defaults