about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2017-09-10 20:39:29 +0200
committerGitHub <noreply@github.com>2017-09-10 20:39:29 +0200
commitb60fca2edbccb4b31e478b91b748502f62cd9080 (patch)
treed9290f879b6ad9caf3f651885de10e303586e89b
parent397fc0dacac23515ee09b8de6a14dc9019f325e2 (diff)
parentb4ea459eabf7f52cfec0964d31354e3d6385151f (diff)
Merge pull request #29194 from LumiGuide/haskell-failOnAllWarnings
haskell: introduce failOnAllWarnings
-rw-r--r--doc/languages-frameworks/haskell.md13
-rw-r--r--pkgs/development/haskell-modules/lib.nix4
2 files changed, 12 insertions, 5 deletions
diff --git a/doc/languages-frameworks/haskell.md b/doc/languages-frameworks/haskell.md
index 8efc60f1e17ac..da3fd770ce728 100644
--- a/doc/languages-frameworks/haskell.md
+++ b/doc/languages-frameworks/haskell.md
@@ -875,12 +875,17 @@ to your own Haskell packages and integrate that in a Continuous Integration
 server like [hydra](https://nixos.org/hydra/) to assure your packages maintain a
 minimum level of quality. This section discusses some of these functions.
 
+#### failOnAllWarnings
+
+Applying `haskell.lib.failOnAllWarnings` to a Haskell package enables the
+`-Wall` and `-Werror` GHC options to turn all warnings into build failures.
+
 #### buildStrictly
 
-Applying `haskell.lib.buildStrictly` to a Haskell package enables the `-Wall`
-and `-Werror` GHC options to turn all warnings into build failures. Additionally
-the source of your package is gotten from first invoking `cabal sdist` to ensure
-all needed files are listed in the Cabal file.
+Applying `haskell.lib.buildStrictly` to a Haskell package calls
+`failOnAllWarnings` on the given package to turn all warnings into build
+failures. Additionally the source of your package is gotten from first invoking
+`cabal sdist` to ensure all needed files are listed in the Cabal file.
 
 #### checkUnusedPackages
 
diff --git a/pkgs/development/haskell-modules/lib.nix b/pkgs/development/haskell-modules/lib.nix
index 48110cffabf8b..fcb4258deb149 100644
--- a/pkgs/development/haskell-modules/lib.nix
+++ b/pkgs/development/haskell-modules/lib.nix
@@ -117,7 +117,9 @@ rec {
     '';
   });
 
-  buildStrictly = pkg: buildFromSdist (appendConfigureFlag pkg "--ghc-option=-Wall --ghc-option=-Werror");
+  buildStrictly = pkg: buildFromSdist (failOnAllWarnings pkg);
+
+  failOnAllWarnings = drv: appendConfigureFlag drv "--ghc-option=-Wall --ghc-option=-Werror";
 
   checkUnusedPackages =
     { ignoreEmptyImports ? false