diff --git a/compiler/ghc/default.nix b/compiler/ghc/default.nix index f72a3b8a95..52e1a76a5f 100644 --- a/compiler/ghc/default.nix +++ b/compiler/ghc/default.nix @@ -52,6 +52,17 @@ let self = , # Wheter to build in NUMA support enableNUMA ? true +, enableDocs ? false # Choose between --docs=none and --docs=no-sphinx + # Turning this off saves around 600MB for each GHC build + # If you need GHC docs use an overlay like this: + # final: prev: { + # haskell-nix = prev.haskell-nix // { + # compiler = final.lib.mapAttrs (_: x: x.override ({ + # enableDocs = true; + # })) prev.haskell-nix.compiler; + # }; + # } + , # What flavour to build. An empty string indicates no # specific flavour and falls back to ghc default values. ghcFlavour ? lib.optionalString haskell-nix.haskellLib.isCrossTarget ( @@ -317,7 +328,7 @@ let + lib.optionalString enableDWARF "+debug_info" + lib.optionalString ((enableNativeBignum && hadrianHasNativeBignumFlavour) || targetPlatform.isGhcjs) "+native_bignum" + lib.optionalString targetPlatform.isGhcjs "+no_profiled_libs" - } --docs=no-sphinx -j --verbose" + } --docs=${if enableDocs then "no-sphinx" else "none"} -j --verbose" # This is needed to prevent $GCC from emitting out of line atomics. # Those would then result in __aarch64_ldadd1_sync and others being referenced, which # we don't handle in the RTS properly yet. Until we figure out how to _properly_ deal