From 2e9ff9aa98d6972757b5833d23969891e776d561 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sat, 18 Feb 2023 18:27:23 +0100 Subject: [PATCH] haskell.packages.*.ghc-tags: pick compatible version Since there is probably more movement going forward, testing this on Hydra for multiple GHC versions seems sensible. --- .../configuration-ghc-8.10.x.nix | 3 +++ .../configuration-ghc-9.0.x.nix | 3 +++ .../configuration-ghc-9.2.x.nix | 3 +++ .../configuration-hackage2nix/main.yaml | 1 + .../haskell-modules/hackage-packages.nix | 23 +++++++++++++++++++ pkgs/top-level/release-haskell.nix | 8 +++++++ 6 files changed, 41 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix b/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix index 7604a1c507a2..8b4439deb0b4 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix @@ -73,6 +73,9 @@ self: super: { # additional dependency to compile successfully. ghc-lib-parser-ex = addBuildDepend self.ghc-lib-parser super.ghc-lib-parser-ex; + # Needs to use ghc-lib due to incompatible GHC + ghc-tags = doDistribute (addBuildDepend self.ghc-lib self.ghc-tags_1_5); + # Jailbreak to fix the build. base-noprelude = doJailbreak super.base-noprelude; unliftio-core = doJailbreak super.unliftio-core; diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix index 5748691dd400..7f2ca4a1a5e8 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix @@ -121,6 +121,9 @@ self: super: { Cabal = lself.Cabal_3_6_3_0; })); + # Needs to use ghc-lib due to incompatible GHC + ghc-tags = doDistribute (addBuildDepend self.ghc-lib self.ghc-tags_1_5); + # This package is marked as unbuildable on GHC 9.2, so hackage2nix doesn't include any dependencies. # See https://github.com/NixOS/nixpkgs/pull/205902 for why we use `self..scope` hls-haddock-comments-plugin = unmarkBroken (addBuildDepends (with self.hls-haddock-comments-plugin.scope; [ diff --git a/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix b/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix index c9b864800d04..1c72ed517797 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-9.2.x.nix @@ -87,6 +87,9 @@ self: super: { # For -fghc-lib see cabal.project in haskell-language-server. stylish-haskell = enableCabalFlag "ghc-lib" super.stylish-haskell; + # Needs to match ghc version + ghc-tags = doDistribute self.ghc-tags_1_5; + # For "ghc-lib" flag see https://github.com/haskell/haskell-language-server/issues/3185#issuecomment-1250264515 hlint = enableCabalFlag "ghc-lib" super.hlint; diff --git a/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml b/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml index 03db8df060df..e11380f5c947 100644 --- a/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml +++ b/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml @@ -164,6 +164,7 @@ extra-packages: - commonmark-extensions < 0.2.3.3 # 2022-12-17: required by emanote 1.0.0.0 (to avoid a bug in 0.2.3.3) - ShellCheck == 0.8.0 # 2022-12-28: required by haskell-ci 0.14.3 - retrie < 1.2.0.0 # 2022-12-30: required for hls on ghc < 9.2 + - ghc-tags == 1.5.* # 2023-02-18: preserve for ghc-lib == 9.2.* package-maintainers: abbradar: diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix index f5ec9671f412..37f0aa792889 100644 --- a/pkgs/development/haskell-modules/hackage-packages.nix +++ b/pkgs/development/haskell-modules/hackage-packages.nix @@ -111299,6 +111299,29 @@ self: { hydraPlatforms = lib.platforms.none; }) {}; + "ghc-tags_1_5" = callPackage + ({ mkDerivation, aeson, async, attoparsec, base, bytestring + , containers, deepseq, directory, filepath, ghc, ghc-boot + , ghc-paths, optparse-applicative, process, stm, temporary, text + , time, vector, yaml + }: + mkDerivation { + pname = "ghc-tags"; + version = "1.5"; + sha256 = "0hscl49qq3lx2a5g6g7g1wa4rl52piizqsykicy1kvi4di7qnyqk"; + isLibrary = false; + isExecutable = true; + executableHaskellDepends = [ + aeson async attoparsec base bytestring containers deepseq directory + filepath ghc ghc-boot ghc-paths optparse-applicative process stm + temporary text time vector yaml + ]; + description = "Utility for generating ctags and etags with GHC API"; + license = lib.licenses.mpl20; + hydraPlatforms = lib.platforms.none; + mainProgram = "ghc-tags"; + }) {}; + "ghc-tags" = callPackage ({ mkDerivation, aeson, async, attoparsec, base, bytestring , containers, deepseq, directory, filepath, ghc-lib, ghc-paths diff --git a/pkgs/top-level/release-haskell.nix b/pkgs/top-level/release-haskell.nix index 8c38800b77cb..b8f72b4e4ee5 100644 --- a/pkgs/top-level/release-haskell.nix +++ b/pkgs/top-level/release-haskell.nix @@ -385,6 +385,14 @@ let ghc-lib = released; ghc-lib-parser = released; ghc-lib-parser-ex = released; + ghc-tags = [ + compilerNames.ghc8107 + compilerNames.ghc902 + compilerNames.ghc924 + compilerNames.ghc925 + compilerNames.ghc926 + compilerNames.ghc944 + ]; weeder = [ compilerNames.ghc8107 compilerNames.ghc902