stack: adjust overrides to stack 3.9.1 (#483395)

This commit is contained in:
sternenseemann
2026-01-26 14:44:19 +00:00
committed by GitHub
4 changed files with 45 additions and 200 deletions
@@ -2136,70 +2136,6 @@ with haskellLib;
);
gi-gtk-declarative-app-simple = doJailbreak super.gi-gtk-declarative-app-simple;
# 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
stack'
else
lib.pipe
# to reduce rebuilds, don't override Cabal in the entire scope
((stack'.override { Cabal = self.Cabal_3_10_3_0; }).overrideScope (
self: super:
let
downgradeCabal =
drv:
lib.pipe drv [
# Since Cabal and Cabal-syntax are in the global package db, we can't
# remove them from the available packages. Instead, we pass a constraint.
(appendConfigureFlags [
"--constraint=Cabal<3.12"
"--constraint=Cabal-syntax<3.12"
])
(addBuildDepends [
self.Cabal-syntax_3_10_3_0
self.Cabal_3_10_3_0
])
];
in
lib.mapAttrs (_: downgradeCabal) {
inherit (super)
hpack
hackage-security
pantry
rio-prettyprint
;
}
))
[
# In order to apply a patch to a file with DOS line endings with GNU patch(1),
# we need to use --binary with a patch that has DOS line endings.
(overrideCabal (drv: {
prePatch = ''
${drv.prePatch or ""}
patchFlags="--binary -p1"
'';
}))
(appendPatch (
pkgs.fetchpatch {
postFetch = ''
sed -e 's/$/\r/' -i "$out"
'';
# Type equality operator warning and failure with text >= 2.1.2
# We filter out all Cabal related changes from this patch as Cabal bumps may change the behavior of stack.
name = "stack-ghc-9.10.patch";
url = "https://github.com/commercialhaskell/stack/commit/6a672dd12f25151707cf45e9823447334728d245.patch";
hash = "sha256-MVwYIvFwiuBx9r6QUR0dHejmsQxVI6KFoZlujSXYJPM=";
includes = [
"src/Stack/Prelude.hs"
"src/Stack/Types/CompilerBuild.hs"
];
}
))
];
# 2023-04-09: haskell-ci needs Cabal-syntax 3.10
# 2024-03-21: pins specific version of ShellCheck
# 2025-03-10: jailbreak, https://github.com/haskell-CI/haskell-ci/issues/771
@@ -68,6 +68,51 @@ in
# “Unfortunately we are unable to support GHC 9.10.”
apply-refact = dontDistribute (markBroken super.apply-refact);
stack =
# Setup.hs depends on Cabal-syntax >= 3.14
overrideCabal
(drv: {
setupHaskellDepends = drv.setupHaskellDepends or [ ] ++ [
self.Cabal-syntax_3_14_2_0
self.Cabal_3_14_2_0
];
# We need to tell GHC to ignore the Cabal core libraries while
# compiling Setup.hs since it depends on Cabal >= 3.14.
# ATTN: This override assumes we are using GHC 9.10.3 since we need
# to give an exact Cabal version at the GHC (!) command line.
# FIXME(@sternenseemann): make direct argument to generic-builder.nix
env = drv.env or { } // {
setupCompileFlags = lib.concatStringsSep " " [
"-hide-package"
"Cabal-syntax-3.12.1.0"
"-hide-package"
"Cabal-3.12.1.0"
];
};
})
# Stack itself depends on Cabal >= 3.14 which also needs to be updated for deps
(
super.stack.overrideScope (
sself: ssuper:
let
upgradeCabal =
drv:
lib.pipe drv [
(addBuildDepends [ sself.Cabal_3_14_2_0 ])
(appendConfigureFlags [ "--constraint=Cabal>=3.14" ])
];
in
{
pantry = upgradeCabal ssuper.pantry_0_11_2;
rio-prettyprint = upgradeCabal ssuper.rio-prettyprint;
hackage-security = upgradeCabal ssuper.hackage-security;
hpack = upgradeCabal sself.hpack_0_39_1;
stack = upgradeCabal ssuper.stack;
}
)
);
#
# Version upgrades
#
@@ -92,7 +92,6 @@ extra-packages:
- 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
- hlint == 3.8.* # 2025-09-21: needed for hls with ghc-lib-parser 9.8
- hpack == 0.38.1 # 2025-09-18: to match exact version upstream stack-3.7.1 uses
- language-javascript == 0.7.0.0 # required by purescript
- network-run == 0.4.0 # 2024-10-20: for GHC 9.10/network == 3.1.*
- ormolu == 0.7.2.0 # 2023-11-13: for ghc-lib-parser 9.6 compat
-135
View File
@@ -346181,141 +346181,6 @@ 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,