about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsternenseemann2024-11-08 15:32:25 +0100
committersternenseemann2024-11-14 00:15:38 +0100
commitec3ec6038a01c6e22637565976ed82e1625fa006 (patch)
treef2c873b9a88b5b1d959eee567ba63beec8bf37f0
parentbba794ffb78904066e527ddca1ab63e1ea1b6230 (diff)
haskell.compiler.ghcHEAD: disable --hyperlinked-source on aarch64 haskell-updates
Disable enableHyperlinkedSource for GHC >= 9.11 to keep GHC under the
3GB Hydra output limit. Note that we use a patch as opposed to the new
extraArgs interfaces for the reasons given in the comments added in this
commit.
-rw-r--r--pkgs/development/compilers/ghc/common-hadrian.nix21
-rw-r--r--pkgs/development/tools/haskell/hadrian/disable-hyperlinked-source-extra-args.patch13
-rw-r--r--pkgs/development/tools/haskell/hadrian/disable-hyperlinked-source-pre-9.8.patch (renamed from pkgs/development/tools/haskell/hadrian/disable-hyperlinked-source.patch)0
3 files changed, 26 insertions, 8 deletions
diff --git a/pkgs/development/compilers/ghc/common-hadrian.nix b/pkgs/development/compilers/ghc/common-hadrian.nix
index b062a2d514d4..7bb2135779a4 100644
--- a/pkgs/development/compilers/ghc/common-hadrian.nix
+++ b/pkgs/development/compilers/ghc/common-hadrian.nix
@@ -169,10 +169,11 @@
 
       patches =
         let
-          # Disable haddock generating pretty source listings to stay under 3GB on aarch64-linux
           enableHyperlinkedSource =
-            lib.versionAtLeast version "9.8" ||
-            !(stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux);
+            # Disable haddock generating pretty source listings to stay under 3GB on aarch64-linux
+            !(stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux)
+            # 9.8 and 9.10 don't run into this problem for some reason
+            || (lib.versionAtLeast version "9.8" && lib.versionOlder version "9.11");
         in
         [
           # Fix docs build with Sphinx >= 7 https://gitlab.haskell.org/ghc/ghc/-/issues/24129
@@ -207,12 +208,16 @@
            then ./Cabal-at-least-3.6-paths-fix-cycle-aarch64-darwin.patch
            else ./Cabal-3.12-paths-fix-cycle-aarch64-darwin.patch)
         ]
-        # Prevents passing --hyperlinked-source to haddock. This is a custom
-        # workaround as we wait for this to be configurable via userSettings or
-        # similar. https://gitlab.haskell.org/ghc/ghc/-/issues/23625
+        # Prevents passing --hyperlinked-source to haddock. Note that this can
+        # be configured via a user defined flavour now. Unfortunately, it is
+        # impossible to import an existing flavour in UserSettings, so patching
+        # the defaults is actually simpler and less maintenance intensive
+        # compared to keeping an entire flavour definition in sync with upstream
+        # manually. See also https://gitlab.haskell.org/ghc/ghc/-/issues/23625
         ++ lib.optionals (!enableHyperlinkedSource) [
-          # TODO(@sternenseemann): Doesn't apply for GHC >= 9.8
-          ../../tools/haskell/hadrian/disable-hyperlinked-source.patch
+          (if lib.versionOlder version "9.8"
+           then ../../tools/haskell/hadrian/disable-hyperlinked-source-pre-9.8.patch
+           else ../../tools/haskell/hadrian/disable-hyperlinked-source-extra-args.patch)
         ]
         # Incorrect bounds on Cabal in hadrian
         # https://gitlab.haskell.org/ghc/ghc/-/issues/24100
diff --git a/pkgs/development/tools/haskell/hadrian/disable-hyperlinked-source-extra-args.patch b/pkgs/development/tools/haskell/hadrian/disable-hyperlinked-source-extra-args.patch
new file mode 100644
index 000000000000..dbbf126a4425
--- /dev/null
+++ b/pkgs/development/tools/haskell/hadrian/disable-hyperlinked-source-extra-args.patch
@@ -0,0 +1,13 @@
+diff --git a/hadrian/src/Settings/Default.hs b/hadrian/src/Settings/Default.hs
+index 0b743788ec..a7ff841609 100644
+--- a/hadrian/src/Settings/Default.hs
++++ b/hadrian/src/Settings/Default.hs
+@@ -249,7 +249,7 @@ defaultExtraArgs =
+ 
+ defaultHaddockExtraArgs :: Args
+ defaultHaddockExtraArgs = builder (Haddock BuildPackage) ?
+-  mconcat [ arg "--hyperlinked-source", arg "--hoogle", arg "--quickjump" ]
++  mconcat [ arg "--hoogle", arg "--quickjump" ]
+ 
+ 
+ -- | Default source arguments, e.g. optimisation settings.
diff --git a/pkgs/development/tools/haskell/hadrian/disable-hyperlinked-source.patch b/pkgs/development/tools/haskell/hadrian/disable-hyperlinked-source-pre-9.8.patch
index 103871bb65e1..103871bb65e1 100644
--- a/pkgs/development/tools/haskell/hadrian/disable-hyperlinked-source.patch
+++ b/pkgs/development/tools/haskell/hadrian/disable-hyperlinked-source-pre-9.8.patch