diff --git a/doc/languages-frameworks/haskell.section.md b/doc/languages-frameworks/haskell.section.md index e8970b2d0335..247daf8d1dbe 100644 --- a/doc/languages-frameworks/haskell.section.md +++ b/doc/languages-frameworks/haskell.section.md @@ -1076,6 +1076,9 @@ benchmark component. `disableLibraryProfiling drv` : Sets the `enableLibraryProfiling` argument to `false` for `drv`. +`disableParallelBuilding drv` +: Sets the `enableParallelBuilding` argument to `false` for `drv`. + #### Library functions in the Haskell package sets {#haskell-package-set-lib-functions} Some library functions depend on packages from the Haskell package sets. Thus they are diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index fc9829b0576c..00b300a664d6 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -2458,9 +2458,7 @@ self: super: { # See: https://gitlab.haskell.org/ghc/ghc/-/issues/17188 # # Overwrite the build cores - raaz = overrideCabal (drv: { - enableParallelBuilding = false; - }) super.raaz; + raaz = disableParallelBuilding super.raaz; # https://github.com/andreymulik/sdp/issues/3 sdp = disableLibraryProfiling super.sdp; diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.10.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.10.x.nix index 665cfecb26aa..e0ca8e9e442d 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.10.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.10.x.nix @@ -5,7 +5,6 @@ with haskellLib; let inherit (pkgs) lib; - disableParallelBuilding = haskellLib.overrideCabal (drv: { enableParallelBuilding = false; }); in self: super: { diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix index 98a8cb4d49b8..068e18c880ce 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.12.x.nix @@ -3,7 +3,6 @@ let inherit (pkgs) lib; - disableParallelBuilding = haskellLib.overrideCabal (drv: { enableParallelBuilding = false; }); in self: super: { diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.6.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.6.x.nix index 90d8bc7ff034..f893846cab2d 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.6.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.6.x.nix @@ -15,8 +15,6 @@ let builtins.throw "Check if '${msg}' was resolved in ${pkg.pname} ${pkg.version} and update or remove this"; jailbreakForCurrentVersion = p: v: checkAgainAfter p v "bad bounds" (doJailbreak p); - # Workaround for a ghc-9.6 issue: https://gitlab.haskell.org/ghc/ghc/-/issues/23392 - disableParallelBuilding = overrideCabal (drv: { enableParallelBuilding = false; }); in self: super: { diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.8.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.8.x.nix index 9094f1f8e9ea..712ea1bbf578 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.8.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.8.x.nix @@ -5,7 +5,6 @@ with haskellLib; let inherit (pkgs.stdenv.hostPlatform) isDarwin; - disableParallelBuilding = haskellLib.overrideCabal (drv: { enableParallelBuilding = false; }); in self: super: { diff --git a/pkgs/development/haskell-modules/configuration-ghcjs-9.x.nix b/pkgs/development/haskell-modules/configuration-ghcjs-9.x.nix index 044a3a8f69d8..448f04228bec 100644 --- a/pkgs/development/haskell-modules/configuration-ghcjs-9.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghcjs-9.x.nix @@ -2,12 +2,6 @@ with haskellLib; -let - disableParallelBuilding = overrideCabal (drv: { - enableParallelBuilding = false; - }); -in - # cabal2nix doesn't properly add dependencies conditional on arch(javascript) (self: super: { diff --git a/pkgs/development/haskell-modules/lib/compose.nix b/pkgs/development/haskell-modules/lib/compose.nix index 09de1d228d94..3661c74d499a 100644 --- a/pkgs/development/haskell-modules/lib/compose.nix +++ b/pkgs/development/haskell-modules/lib/compose.nix @@ -184,6 +184,13 @@ rec { markBrokenVersion = version: drv: assert drv.version == version; markBroken drv; markUnbroken = overrideCabal (drv: { broken = false; }); + /* disableParallelBuilding drops the -j option from the GHC + command line for the given package. This can be useful in rare + situations where parallel building of a package causes GHC to + fail for some reason. + */ + disableParallelBuilding = overrideCabal (drv: { enableParallelBuilding = false; }); + enableLibraryProfiling = overrideCabal (drv: { enableLibraryProfiling = true; }); disableLibraryProfiling = overrideCabal (drv: { enableLibraryProfiling = false; }); diff --git a/pkgs/development/haskell-modules/lib/default.nix b/pkgs/development/haskell-modules/lib/default.nix index 2bcd8f25d114..976e62afc630 100644 --- a/pkgs/development/haskell-modules/lib/default.nix +++ b/pkgs/development/haskell-modules/lib/default.nix @@ -176,6 +176,8 @@ rec { markBrokenVersion = compose.markBrokenVersion; markUnbroken = compose.markUnbroken; + disableParallelBuilding = compose.disableParallelBuilding; + enableLibraryProfiling = compose.enableLibraryProfiling; disableLibraryProfiling = compose.disableLibraryProfiling;