From c145f7930df909d583fe6d7fc862ff963a095f7a Mon Sep 17 00:00:00 2001 From: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org> Date: Thu, 10 Jun 2021 14:52:55 +0200 Subject: [PATCH] haskellPackages.hackage-db: downgrade to 2.1.0 if Cabal < 3.4 Stackage Nighly recently upgraded their version of hackage-db from 2.1.0 to 2.1.1. 2.1.1 had a compatibility fix for Cabal 3.4 [1]. However it did not increase the version bound on Cabal nor fails to compile with Cabal 3.2, so Stackage was able to update it. Unfortunately hackage-db with Cabal 3.2 causes observable issues [2] in cabal2nix, so we need to downgrade it for all compilers that still ship a Cabal version < 3.4. Also ideally we should update the constraints for hackage-db 2.1.0 and hackage-db 2.1.1 on hackage. See also [3]. [1]: https://github.com/peti/hackage-db/pull/12 [2]: https://github.com/NixOS/cabal2nix/issues/501 [3]: https://github.com/peti/hackage-db/pull/14 --- .../configuration-ghc-8.10.x.nix | 4 ++++ .../configuration-ghc-8.6.x.nix | 4 ++++ .../configuration-ghc-8.8.x.nix | 4 ++++ .../configuration-hackage2nix/main.yaml | 1 + .../haskell-modules/hackage-packages.nix | 22 +++++++++++++++++++ 5 files changed, 35 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 36fe13151f3c..2c4612daac34 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-8.10.x.nix @@ -87,4 +87,8 @@ self: super: { # Break out of "Cabal < 3.2" constraint. stylish-haskell = doJailbreak super.stylish-haskell; + # hackage-db 2.1.1 is incompatible with Cabal < 3.4 + # See https://github.com/NixOS/cabal2nix/issues/501 + hackage-db = super.hackage-db_2_1_0; + } diff --git a/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix b/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix index 99b53b9f14f3..42fa603d3313 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-8.6.x.nix @@ -106,4 +106,8 @@ self: super: { # https://github.com/haskellari/time-compat/issues/23 time-compat = dontCheck super.time-compat; + # hackage-db 2.1.1 is incompatible with Cabal < 3.4 + # See https://github.com/NixOS/cabal2nix/issues/501 + hackage-db = super.hackage-db_2_1_0; + } diff --git a/pkgs/development/haskell-modules/configuration-ghc-8.8.x.nix b/pkgs/development/haskell-modules/configuration-ghc-8.8.x.nix index aab26897cca4..7908066ebb59 100644 --- a/pkgs/development/haskell-modules/configuration-ghc-8.8.x.nix +++ b/pkgs/development/haskell-modules/configuration-ghc-8.8.x.nix @@ -135,4 +135,8 @@ self: super: { # vector 0.12.2 indroduced doctest checks that don‘t work on older compilers vector = dontCheck super.vector; + + # hackage-db 2.1.1 is incompatible with Cabal < 3.4 + # See https://github.com/NixOS/cabal2nix/issues/501 + hackage-db = super.hackage-db_2_1_0; } diff --git a/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml b/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml index 02739f83c4ea..3dc1a40c9de9 100644 --- a/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml +++ b/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml @@ -125,6 +125,7 @@ extra-packages: - gi-gtk < 4.0 # 2021-05-07: For haskell-gi 0.25 without gtk4 - gi-gdkx11 == 3.0.11 # 2021-05-07: For haskell-gi 0.25 without gtk4 - ShellCheck == 0.7.1 # 2021-05-09: haskell-ci 0.12.1 pins this version + - hackage-db < 2.1.1 # 2021-06-10: Need older hackage-db as long as Cabal < 3.4, see https://github.com/NixOS/cabal2nix/issues/501 package-maintainers: abbradar: diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix index 44069b6a40c8..2bf76a6f2e0e 100644 --- a/pkgs/development/haskell-modules/hackage-packages.nix +++ b/pkgs/development/haskell-modules/hackage-packages.nix @@ -114128,6 +114128,28 @@ self: { broken = true; }) {}; + "hackage-db_2_1_0" = callPackage + ({ mkDerivation, aeson, base, bytestring, Cabal, containers + , directory, exceptions, filepath, tar, time, utf8-string + }: + mkDerivation { + pname = "hackage-db"; + version = "2.1.0"; + sha256 = "1vsc0lrbrb525frycqq0c5z846whymgcjl888gnlqd16nknbsn3l"; + revision = "1"; + editedCabalFile = "1h3x5a8xmqkkcd3h1m7z0il1vbsh2c77685y68zmyp21zb1y88hy"; + isLibrary = true; + isExecutable = true; + libraryHaskellDepends = [ + aeson base bytestring Cabal containers directory exceptions + filepath tar time utf8-string + ]; + description = "Access cabal-install's Hackage database via Data.Map"; + license = lib.licenses.bsd3; + hydraPlatforms = lib.platforms.none; + maintainers = with lib.maintainers; [ peti ]; + }) {}; + "hackage-db" = callPackage ({ mkDerivation, aeson, base, bytestring, Cabal, containers , directory, exceptions, filepath, tar, time, utf8-string