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/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 35159c80c2e1..98b53b550d7e 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -102,20 +102,33 @@ self: super: { ####################################### # All jailbreaks in this section due to: https://github.com/haskell/haskell-language-server/pull/4316#discussion_r1667684895 - haskell-language-server = doJailbreak (dontCheck (super.haskell-language-server.overrideScope (lself: lsuper: { - # For most ghc versions, we overrideScope Cabal in the configuration-ghc-???.nix, - # because some packages, like ormolu, need a newer Cabal version. - # ghc-paths is special because it depends on Cabal for building - # its Setup.hs, and therefor declares a Cabal dependency, but does - # not actually use it as a build dependency. - # That means ghc-paths can just use the ghc included Cabal version, - # without causing package-db incoherence and we should do that because - # otherwise we have different versions of ghc-paths - # around which have the same abi-hash, which can lead to confusions and conflicts. - ghc-paths = lsuper.ghc-paths.override { Cabal = null; }; - }))); + haskell-language-server = + lib.pipe + (super.haskell-language-server.overrideScope (lself: lsuper: { + # For most ghc versions, we overrideScope Cabal in the configuration-ghc-???.nix, + # because some packages, like ormolu, need a newer Cabal version. + # ghc-paths is special because it depends on Cabal for building + # its Setup.hs, and therefor declares a Cabal dependency, but does + # not actually use it as a build dependency. + # That means ghc-paths can just use the ghc included Cabal version, + # without causing package-db incoherence and we should do that because + # otherwise we have different versions of ghc-paths + # around which have the same abi-hash, which can lead to confusions and conflicts. + ghc-paths = lsuper.ghc-paths.override { Cabal = null; }; + })) + [ + doJailbreak + dontCheck + ]; + hls-plugin-api = doJailbreak super.hls-plugin-api; - ghcide = doJailbreak super.ghcide; + ghcide = doJailbreak (appendPatch (pkgs.fetchpatch { + name = "ghcide-ghc-9.8.3.patch"; + url = "https://github.com/haskell/haskell-language-server/commit/6d0a6f220226fe6c1cb5b6533177deb55e755b0b.patch"; + sha256 = "1jwxldar9qzkg2z6vsx8f2yih3vkf4yjk9p3mryv0azn929qn3h1"; + stripLen = 1; + excludes = [ "cabal.project" ]; + }) super.ghcide); # For -f-auto see cabal.project in haskell-language-server. ghc-lib-parser-ex = addBuildDepend self.ghc-lib-parser (disableCabalFlag "auto" super.ghc-lib-parser-ex); diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.14.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.14.x.nix new file mode 100644 index 000000000000..6d45b7041f1b --- /dev/null +++ b/pkgs/development/haskell-modules/configuration-ghc-9.14.x.nix @@ -0,0 +1,61 @@ +{ pkgs, haskellLib }: + +let + inherit (pkgs) lib; + +in + +self: super: { + llvmPackages = lib.dontRecurseIntoAttrs self.ghc.llvmPackages; + + # Disable GHC core libraries + array = null; + base = null; + binary = null; + bytestring = null; + Cabal = null; + Cabal-syntax = null; + containers = null; + deepseq = null; + directory = null; + exceptions = null; + file-io = null; + filepath = null; + ghc-bignum = null; + ghc-boot = null; + ghc-boot-th = null; + ghc-compact = null; + ghc-experimental = null; + ghc-heap = null; + ghc-internal = null; + ghc-platform = null; + ghc-prim = null; + ghc-toolchain = null; + ghci = null; + haddock-api = null; + haddock-library = null; + haskeline = null; + hpc = null; + integer-gmp = null; + mtl = null; + os-string = null; + parsec = null; + pretty = null; + process = null; + rts = null; + semaphore-compat = null; + stm = null; + system-cxx-std-lib = null; + template-haskell = null; + # GHC only builds terminfo if it is a native compiler + terminfo = + if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then + null + else + haskellLib.doDistribute self.terminfo_0_4_1_6; + text = null; + time = null; + transformers = null; + unix = null; + xhtml = null; +} 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 similarity index 100% rename from pkgs/development/tools/haskell/hadrian/disable-hyperlinked-source.patch rename to pkgs/development/tools/haskell/hadrian/disable-hyperlinked-source-pre-9.8.patch diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix index b3f6a71d3315..ececbd86ee3e 100644 --- a/pkgs/top-level/haskell-packages.nix +++ b/pkgs/top-level/haskell-packages.nix @@ -429,13 +429,8 @@ in { ghc910 = compiler.ghc9101; ghcHEAD = callPackage ../development/compilers/ghc/head.nix { bootPkgs = - # For GHC 9.6 no armv7l bindists are available. - if stdenv.buildPlatform.isAarch32 then - bb.packages.ghc963 - else if stdenv.buildPlatform.isPower64 && stdenv.buildPlatform.isLittleEndian then - bb.packages.ghc963 - else - bb.packages.ghc963Binary; + # No suitable bindist packaged yet + bb.packages.ghc9101; inherit (buildPackages.python3Packages) sphinx; # Need to use apple's patched xattr until # https://github.com/xattr/xattr/issues/44 and @@ -604,7 +599,7 @@ in { ghcHEAD = callPackage ../development/haskell-modules { buildHaskellPackages = bh.packages.ghcHEAD; ghc = bh.compiler.ghcHEAD; - compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.12.x.nix { }; + compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-9.14.x.nix { }; }; ghcjs = packages.ghcjs810;