From b1b6ccaee55c32e376923ddb965d882117c50b12 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Fri, 14 Feb 2025 18:55:08 +1300 Subject: [PATCH 1/2] Disable ghc docs by default --- compiler/ghc/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/ghc/default.nix b/compiler/ghc/default.nix index f72a3b8a95..583332c59e 100644 --- a/compiler/ghc/default.nix +++ b/compiler/ghc/default.nix @@ -52,6 +52,8 @@ let self = , # Wheter to build in NUMA support enableNUMA ? true +, enableDocs ? false # Choose between --docs=none and --docs=no-sphinx + , # 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 +319,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 From 7ae0cd7f2098ad10e236977c8216cb2d9ce6f357 Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Fri, 14 Feb 2025 19:22:03 +1300 Subject: [PATCH 2/2] Add a comment --- compiler/ghc/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compiler/ghc/default.nix b/compiler/ghc/default.nix index 583332c59e..52e1a76a5f 100644 --- a/compiler/ghc/default.nix +++ b/compiler/ghc/default.nix @@ -53,6 +53,15 @@ let self = 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.