about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development')
-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