From ca733b431bff805ccfc28f1ffeefe8a53c537f42 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sat, 6 Jan 2024 16:35:08 +0100 Subject: haskellPackages.extensions: use Cabal core pkg if possible For GHC 9.6 and 9.8 we can use the Cabal library bundled with GHC since it matches the requested version. This can prevent inconsistent dependencies later in e.g. haskell-language-server. For lower versions we may need to jailbreak and downgrade Cabal to which upstream seems to be open: > We need to pin a single major version of Cabal here because the main > reason we use Cabal is for its list of extensions. Later versions have > strictly more extensions, and we'll have missing patterns if we try to > support more than one major version. If this causes problems in > practice let's revisit this decision and come up with another > approach. Alternatively, hls-stan-plugin can be disabled. --- pkgs/development/haskell-modules/configuration-common.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'pkgs/development/haskell-modules') diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index d19950134d8f..4ed4e122ebfa 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -92,10 +92,13 @@ self: super: { guardian ; - # Extensions needs the latest version of Cabal for its list of Haskell language - # extensions. + # Extensions wants the latest version of Cabal for its list of Haskell + # language extensions. extensions = super.extensions.override { - Cabal = self.Cabal_3_10_2_1; + Cabal = + if versionOlder self.ghc.version "9.6" + then self.Cabal_3_10_2_1 + else null; # use GHC bundled version }; ####################################### -- cgit 1.4.1