diff --git a/default.nix b/default.nix index 6fca87d..a16d1f2 100644 --- a/default.nix +++ b/default.nix @@ -13,7 +13,8 @@ let overrides = distributedClosureOverlay; }; distributedClosureOverlay = self: super: { - "distributed-closure" = super.callCabal2nix "distributed-closure" source { }; + "distributed-closure" = pkgs.haskell.lib.enableCabalFlag + (super.callCabal2nix "distributed-closure" source { }) "dev"; }; in { distributed-closure = haskellPackages.distributed-closure; diff --git a/distributed-closure.cabal b/distributed-closure.cabal index ae4bf9a..b18aadf 100644 --- a/distributed-closure.cabal +++ b/distributed-closure.cabal @@ -17,6 +17,11 @@ source-repository head type: git location: https://github.com/tweag/distributed-closure +flag dev + description: Turn on development settings. + manual: True + default: False + library exposed-modules: Control.Applicative.Static @@ -38,29 +43,47 @@ library template-haskell >= 2.10 hs-source-dirs: src default-language: Haskell2010 - ghc-options: -Wall + if flag(dev) + ghc-options: -Wall -Werror -Wcompat + -Wincomplete-record-updates + -Wincomplete-uni-patterns + -Wnoncanonical-monad-instances + else + ghc-options: -Wall test-suite tests type: exitcode-stdio-1.0 default-language: Haskell2010 hs-source-dirs: tests main-is: test.hs - ghc-options: -Wall build-depends: base >= 4.8, binary >= 0.7, distributed-closure, hspec >= 2.1, QuickCheck >= 2.8 + if flag(dev) + ghc-options: -Wall -Werror -Wcompat + -Wincomplete-record-updates + -Wincomplete-uni-patterns + -Wnoncanonical-monad-instances + else + ghc-options: -Wall executable example-client-server main-is: ClientServer.hs hs-source-dirs: examples default-language: Haskell2010 - ghc-options: -Wall build-depends: base >= 4.8, async >= 2.1, binary >= 0.7, bytestring >= 0.10, distributed-closure + if flag(dev) + ghc-options: -Wall -Werror -Wcompat + -Wincomplete-record-updates + -Wincomplete-uni-patterns + -Wnoncanonical-monad-instances + else + ghc-options: -Wall