From e42d10957d87a5837085cd3273f97e50b67e987d Mon Sep 17 00:00:00 2001 From: David Johnson Date: Mon, 3 Dec 2018 13:46:22 -0500 Subject: [PATCH] Add disable core optimizations (#51464) haskell.lib.disableOptimization: new function Adds a utility function for disabling GHC core optimizations. Significantly reduces build times. --- pkgs/development/haskell-modules/lib.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/haskell-modules/lib.nix b/pkgs/development/haskell-modules/lib.nix index 3d67ac213993..e3b73641989a 100644 --- a/pkgs/development/haskell-modules/lib.nix +++ b/pkgs/development/haskell-modules/lib.nix @@ -259,6 +259,9 @@ rec { */ buildStrictly = pkg: buildFromSdist (failOnAllWarnings pkg); + /* Disable core optimizations, significantly speeds up build time */ + disableOptimization = pkg: appendConfigureFlag pkg "--disable-optimization"; + /* Turn on most of the compiler warnings and fail the build if any of them occur. */ failOnAllWarnings = drv: appendConfigureFlag drv "--ghc-option=-Wall --ghc-option=-Werror";