From 823113f3a98cc4c663333ef8a2f2d9027c7871c4 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Thu, 18 Sep 2025 19:14:57 +0200 Subject: [PATCH] stack: provide hpack 0.38.1 to match upstream binaries (cherry picked from commit 4ede35a36fc0bf48bc0ce3fe31c30c64f8427348) --- .../haskell-modules/configuration-common.nix | 7 +- .../configuration-hackage2nix/main.yaml | 1 + .../haskell-modules/configuration-nix.nix | 27 ++-- .../haskell-modules/hackage-packages.nix | 135 ++++++++++++++++++ 4 files changed, 158 insertions(+), 12 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index b0e1766b4ac8..c3bbe1311e60 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -2193,12 +2193,15 @@ with haskellLib; # stack-3.7.1 requires Cabal < 3.12 stack = + let + stack' = super.stack.overrideScope (self: super: { hpack = self.hpack_0_38_1; }); + in if lib.versionOlder self.ghc.version "9.10" then - super.stack + stack' else lib.pipe # to reduce rebuilds, don't override Cabal in the entire scope - ((super.stack.override { Cabal = self.Cabal_3_10_3_0; }).overrideScope ( + ((stack'.override { Cabal = self.Cabal_3_10_3_0; }).overrideScope ( self: super: let downgradeCabal = diff --git a/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml b/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml index 035dd4d4d160..7f8e037af806 100644 --- a/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml +++ b/pkgs/development/haskell-modules/configuration-hackage2nix/main.yaml @@ -91,6 +91,7 @@ extra-packages: - hasql-pool < 1.1 # 2025-01-19: Needed for building postgrest - hasql-transaction < 1.1.1 # 2025-01-19: Needed for building postgrest - hlint == 3.6.* # 2025-04-14: needed for hls with ghc-lib-parser 9.6 + - hpack == 0.38.1 # 2025-09-18: to match exact version upstream stack-3.7.1 uses - hspec-megaparsec == 2.2.0 # 2023-11-18: Latest version compatible with ghc 9.0 - language-javascript == 0.7.0.0 # required by purescript - network-run == 0.4.0 # 2024-10-20: for GHC 9.10/network == 3.1.* diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index c10045f76349..312bf224c2e4 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -1878,16 +1878,23 @@ builtins.intersectAttrs super { extensions = enableSeparateBinOutput super.extensions; # These test cases access the network - hpack = overrideCabal (drv: { - testFlags = drv.testFlags or [ ] ++ [ - "--skip" - "/Hpack.Defaults/ensureFile/with 404/does not create any files/" - "--skip" - "/Hpack.Defaults/ensureFile/downloads file if missing/" - "--skip" - "/EndToEnd/hpack/defaults/fails if defaults don't exist/" - ]; - }) super.hpack; + inherit + (lib.mapAttrs ( + _: + overrideCabal (drv: { + testFlags = drv.testFlags or [ ] ++ [ + "--skip" + "/Hpack.Defaults/ensureFile/with 404/does not create any files/" + "--skip" + "/Hpack.Defaults/ensureFile/downloads file if missing/" + "--skip" + "/EndToEnd/hpack/defaults/fails if defaults don't exist/" + ]; + }) + ) super) + hpack + hpack_0_38_1 + ; doctest = overrideCabal (drv: { testFlags = drv.testFlags or [ ] ++ [ diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix index 649e211b6907..02c410053925 100644 --- a/pkgs/development/haskell-modules/hackage-packages.nix +++ b/pkgs/development/haskell-modules/hackage-packages.nix @@ -341274,6 +341274,141 @@ self: { } ) { }; + hpack_0_38_1 = callPackage ( + { + mkDerivation, + aeson, + base, + bifunctors, + bytestring, + Cabal, + containers, + crypton, + deepseq, + directory, + filepath, + Glob, + hspec, + hspec-discover, + http-client, + http-client-tls, + http-types, + HUnit, + infer-license, + interpolate, + mockery, + mtl, + pretty, + QuickCheck, + scientific, + template-haskell, + temporary, + text, + transformers, + unordered-containers, + vcr, + vector, + yaml, + }: + mkDerivation { + pname = "hpack"; + version = "0.38.1"; + sha256 = "03qygb51jb4r6sg2bkaz7k80h11wgjr27hgpx6h08xm8axdk2gba"; + revision = "1"; + editedCabalFile = "0dyd6pp2pk62nynp0x2j9kjddfv43p9inplk4iya7hdldyjs77k0"; + isLibrary = true; + isExecutable = true; + libraryHaskellDepends = [ + aeson + base + bifunctors + bytestring + Cabal + containers + crypton + deepseq + directory + filepath + Glob + http-client + http-client-tls + http-types + infer-license + mtl + pretty + scientific + text + transformers + unordered-containers + vector + yaml + ]; + executableHaskellDepends = [ + aeson + base + bifunctors + bytestring + Cabal + containers + crypton + deepseq + directory + filepath + Glob + http-client + http-client-tls + http-types + infer-license + mtl + pretty + scientific + text + transformers + unordered-containers + vector + yaml + ]; + testHaskellDepends = [ + aeson + base + bifunctors + bytestring + Cabal + containers + crypton + deepseq + directory + filepath + Glob + hspec + http-client + http-client-tls + http-types + HUnit + infer-license + interpolate + mockery + mtl + pretty + QuickCheck + scientific + template-haskell + temporary + text + transformers + unordered-containers + vcr + vector + yaml + ]; + testToolDepends = [ hspec-discover ]; + description = "A modern format for Haskell packages"; + license = lib.licenses.mit; + hydraPlatforms = lib.platforms.none; + mainProgram = "hpack"; + } + ) { }; + hpack = callPackage ( { mkDerivation,