Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 9 additions & 41 deletions pkgs/development/haskell-modules/configuration-common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -127,34 +127,7 @@ with haskellLib;
# to bogus references to some dependencies.
overrideCabal (
old:
{
# Ignore unix bound intended to prevent an unix bug on 32bit systems.
# We apply a patch for this issue to the GHC core packages directly.
# See unix-fix-ctimeval-size-32-bit.patch in ../compilers/ghc/common-*.nix
patches =
old.patches or [ ]
++
lib.optionals
(
scope.unix == null
&& lib.elem self.ghc.version [
"9.6.1"
"9.6.2"
"9.6.3"
"9.6.4"
"9.6.5"
"9.6.6"
"9.8.1"
"9.8.2"
"9.8.3"
"9.10.1"
]
)
[
./patches/cabal-install-3.16-lift-unix-bound.patch
];
}
// lib.optionalAttrs (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) {
lib.optionalAttrs (pkgs.stdenv.hostPlatform.isDarwin && pkgs.stdenv.hostPlatform.isAarch64) {
postInstall = ''
${old.postInstall or ""}
remove-references-to -t ${scope.HTTP} "$out/bin/.cabal-wrapped"
Expand Down Expand Up @@ -529,19 +502,14 @@ with haskellLib;

# Fixes compilation for basement on i686
# https://github.com/haskell-foundation/foundation/pull/573
# Don't apply patch for GHC == 9.2.* on 64bit where it breaks compilation:
# https://github.com/haskell-foundation/foundation/pull/573#issuecomment-1669468867
basement = appendPatches (lib.optionals
(pkgs.stdenv.hostPlatform.is32bit || lib.versions.majorMinor self.ghc.version != "9.2")
[
(fetchpatch {
name = "basement-i686-ghc-9.4.patch";
url = "https://github.com/haskell-foundation/foundation/pull/573/commits/38be2c93acb6f459d24ed6c626981c35ccf44095.patch";
sha256 = "17kz8glfim29vyhj8idw8bdh3id5sl9zaq18zzih3schfvyjppj7";
stripLen = 1;
})
]
) super.basement;
basement = appendPatches [
(fetchpatch {
name = "basement-i686-ghc-9.4.patch";
url = "https://github.com/haskell-foundation/foundation/pull/573/commits/38be2c93acb6f459d24ed6c626981c35ccf44095.patch";
sha256 = "17kz8glfim29vyhj8idw8bdh3id5sl9zaq18zzih3schfvyjppj7";
stripLen = 1;
})
] super.basement;

# Fixes compilation of memory with GHC >= 9.4 on 32bit platforms
# https://github.com/vincenthz/hs-memory/pull/99
Expand Down
160 changes: 3 additions & 157 deletions pkgs/development/haskell-modules/configuration-ghc-9.0.x.nix
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
{
config,
pkgs,
haskellLib,
}:

with haskellLib;

let
inherit (pkgs.stdenv.hostPlatform) isDarwin;
inherit (pkgs) lib;
in
{ }:

self: super: {

# Disable GHC 9.0.x core libraries.
array = null;
base = null;
Expand Down Expand Up @@ -42,152 +30,10 @@ self: super: {
rts = null;
stm = null;
template-haskell = null;
# GHC only builds terminfo if it is a native compiler
terminfo =
if pkgs.stdenv.hostPlatform == pkgs.stdenv.buildPlatform then
null
else
doDistribute self.terminfo_0_4_1_7;
terminfo = null;
text = null;
time = null;
transformers = null;
unix = null;
# GHC only bundles the xhtml library if haddock is enabled, check if this is
# still the case when updating: https://gitlab.haskell.org/ghc/ghc/-/blob/0198841877f6f04269d6050892b98b5c3807ce4c/ghc.mk#L463
xhtml = if self.ghc.hasHaddock or true then null else doDistribute self.xhtml_3000_4_0_0;

# Need the Cabal-syntax-3.6.0.0 fake package for Cabal < 3.8 to allow callPackage and the constraint solver to work
Cabal-syntax = self.Cabal-syntax_3_6_0_0;
# These core package only exist for GHC >= 9.4. The best we can do is feign
# their existence to callPackages, but their is no shim for lower GHC versions.
system-cxx-std-lib = null;

# Becomes a core package in GHC >= 9.8
semaphore-compat = doDistribute self.semaphore-compat_1_0_0;

# Becomes a core package in GHC >= 9.10
os-string = doDistribute self.os-string_1_0_0;

# Becomes a core package in GHC >= 9.10, no release compatible with GHC < 9.10 is available
ghc-internal = null;
# Become core packages in GHC >= 9.10, but aren't uploaded to Hackage
ghc-toolchain = null;
ghc-platform = null;

# Only required for ghc >= 9.2
nothunks = super.nothunks.override {
wherefrom-compat = null;
};

# Needs base-orphans for GHC < 9.8 / base < 4.19
some = addBuildDepend self.base-orphans super.some;

# Jailbreaks & Version Updates

# tar > 0.6 requires os-string which can't be built with bytestring < 0.11
tar = doDistribute (doJailbreak self.tar_0_6_0_0);
# text-metrics >= 0.3.3 requires GHC2021
text-metrics = doDistribute self.text-metrics_0_3_2;

# For GHC < 9.4, some packages need data-array-byte as an extra dependency
primitive = addBuildDepends [ self.data-array-byte ] super.primitive;
# hashable >= 1.5 only supports GHC >= 9.6 / base >= 4.18
hashable = self.hashable_1_4_7_0;
hashable_1_4_7_0 =
# extra deps for GHC < 9.4
addBuildDepends
[
self.data-array-byte
self.base-orphans
]
# For GHC < 9.2, os-string is not required
(super.hashable_1_4_7_0.override { os-string = null; });

# Too strict lower bounds on base
primitive-addr = doJailbreak super.primitive-addr;

hashable-time = doJailbreak super.hashable-time;
tuple = addBuildDepend self.base-orphans super.tuple;
vector-th-unbox = doJailbreak super.vector-th-unbox;

ormolu = self.ormolu_0_5_2_0.override {
Cabal-syntax = self.Cabal-syntax_3_8_1_0;
};

stylish-haskell = doJailbreak super.stylish-haskell_0_14_4_0;

doctest = dontCheck super.doctest;

haskell-language-server =
lib.throwIf config.allowAliases
"haskell-language-server has dropped support for ghc 9.0 in version 2.4.0.0, please use a newer ghc version or an older nixpkgs version"
(markBroken super.haskell-language-server);

# test suite depends on vcr since hpack >= 0.38.1 which requires GHC2021
hpack = dontCheck super.hpack;

# Needs to use ghc-lib due to incompatible GHC
ghc-tags = doDistribute self.ghc-tags_1_5;

# ghc-lib >= 9.6 and friends no longer build with GHC 9.0
ghc-lib-parser = doDistribute self.ghc-lib-parser_9_2_8_20230729;
ghc-lib-parser-ex = doDistribute self.ghc-lib-parser-ex_9_2_1_1;
ghc-lib = doDistribute self.ghc-lib_9_2_8_20230729;

# Test suite sometimes segfaults with GHC 9.0.1 and 9.0.2
# due to a GHC bug that has been fixed for GHC >= 9.2.2
# https://github.com/ekmett/reflection/issues/51 krank:ignore-line
# https://gitlab.haskell.org/ghc/ghc/-/issues/21141 krank:ignore-line
reflection = dontCheck super.reflection;

ghc-api-compat = unmarkBroken super.ghc-api-compat;

# 2021-09-18: cabal2nix does not detect the need for ghc-api-compat.
hiedb = overrideCabal (old: {
libraryHaskellDepends = old.libraryHaskellDepends ++ [ self.ghc-api-compat ];
}) super.hiedb;

# https://github.com/lspitzner/butcher/issues/7
butcher = doJailbreak super.butcher;

# Tests require nothunks < 0.3 (conflicting with Stackage) for GHC < 9.8
aeson = dontCheck super.aeson;

# 2022-05-31: weeder 2.4.* requires GHC 9.2
weeder = doDistribute self.weeder_2_3_1;
# Unnecessarily strict upper bound on lens
weeder_2_3_1 = doJailbreak (
super.weeder_2_3_1.override {
# weeder < 2.6 only supports algebraic-graphs < 0.7
# We no longer have matching test deps for algebraic-graphs 0.6.1 in the set
algebraic-graphs = dontCheck self.algebraic-graphs_0_6_1;
}
);

# Later versions only support GHC >= 9.2
ghc-exactprint = self.ghc-exactprint_0_6_4;

retrie = dontCheck self.retrie_1_1_0_0;

# Needs OneTuple for ghc < 9.2
binary-orphans = addBuildDepends [ self.OneTuple ] super.binary-orphans;

hspec-megaparsec = super.hspec-megaparsec_2_2_0;

# No instance for (Show B.Builder) arising from a use of ‘print’
http-types = dontCheck super.http-types;

# Packages which need compat library for GHC < 9.6
inherit (lib.mapAttrs (_: addBuildDepends [ self.foldable1-classes-compat ]) super)
indexed-traversable
these
;
base-compat-batteries = addBuildDepends [
self.foldable1-classes-compat
self.OneTuple
] super.base-compat-batteries;
OneTuple = addBuildDepends [
self.foldable1-classes-compat
self.base-orphans
] super.OneTuple;
xhtml = null;
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,13 @@ default-package-overrides:

# keep-sorted start skip_lines=1 case=no numeric=yes
extra-packages:
- algebraic-graphs < 0.7 # 2023-08-14: Needed for building weeder < 2.6.0
- ansi-wl-pprint >= 0.6 && < 0.7 # 2025-07-07: used by gren <= 0.5.4
- attoparsec == 0.13.* # 2022-02-23: Needed to compile elm for now
- Cabal == 3.10.*
- Cabal == 3.12.*
- Cabal == 3.14.*
- Cabal == 3.16.* # version required for cabal-install and other packages
- cabal-add == 0.1 # 2025-09-09: Only needed for hls 2.11 can be removed once we are past it.
- Cabal-syntax == 3.6.* # Dummy package that ensures packages depending on Cabal-syntax can work for Cabal < 3.8
- Cabal-syntax == 3.8.* # version required for ormolu and fourmolu on ghc 9.0
- Cabal-syntax == 3.10.*
- Cabal-syntax == 3.12.*
- Cabal-syntax == 3.14.*
Expand All @@ -64,23 +61,17 @@ extra-packages:
- fourmolu == 0.14.0.0 # 2023-11-13: for ghc-lib-parser 9.6 compat
- fourmolu == 0.15.0.0 # 2025-09-21: for ghc-lib-parser 9.8 compat
- fuzzyset == 0.2.4 # 2023-12-20: Needed for building postgrest > 10
- ghc-exactprint == 0.6.* # 2022-12-12: needed for GHC < 9.2
- ghc-exactprint == 1.5.* # 2023-03-30: needed for GHC == 9.2
- ghc-exactprint == 1.6.* # 2023-03-30: needed for GHC == 9.4
- ghc-exactprint == 1.7.* # 2025-03-09: needed for GHC == 9.6
- ghc-exactprint == 1.8.* # 2024-05-20: needed for GHC == 9.8
- ghc-exactprint == 1.9.* # 2024-08-27: needed for GHC == 9.10
- ghc-exactprint == 1.12.* # 2025-10-15: needed for GHC == 9.12
- ghc-lib == 9.2.* # 2022-02-17: preserve for GHC 9.0
- ghc-lib == 9.6.* # 2022-02-17: preserve for GHC 9.2, 9.4
- ghc-lib == 9.6.* # 2022-02-17: preserve for GHC 9.4
- ghc-lib == 9.10.* # 2024-12-30: preserve for GHC 9.10/ghc-tags 1.9
- ghc-lib-parser == 9.2.* # 2022-02-17: preserve for GHC 9.0
- ghc-lib-parser == 9.6.* # 2024-05-19: preserve for GHC 9.2, 9.4
- ghc-lib-parser == 9.6.* # 2024-05-19: preserve for GHC 9.4
- ghc-lib-parser == 9.8.* # 2024-12-26: preserve for GHC 9.6, 9.8
- ghc-lib-parser-ex == 9.2.* # 2022-07-13: preserve for GHC 9.0
- ghc-lib-parser-ex == 9.6.* # 2024-05-19: preserve for GHC 9.2, 9.4
- ghc-lib-parser-ex == 9.6.* # 2024-05-19: preserve for GHC 9.4
- ghc-lib-parser-ex == 9.8.* # 2024-12-26: preserve for GHC 9.6, 9.8
- ghc-tags == 1.5.* # 2023-02-18: preserve for ghc-lib == 9.2.*
- ghc-tags == 1.7.* # 2023-02-18: preserve for ghc-lib == 9.6.*
- ghc-tags == 1.8.* # 2023-02-18: preserve for ghc-lib == 9.8.*
- ghc-typelits-natnormalise < 0.8 # 2025-09-15: Stackage is stuck at 0.7.10
Expand All @@ -95,31 +86,21 @@ extra-packages:
- 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
- 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.*
- ormolu == 0.5.2.0 # 2023-08-08: preserve for ghc 9.0
- ormolu == 0.7.2.0 # 2023-11-13: for ghc-lib-parser 9.6 compat
- ormolu == 0.7.4.0 # 2023-09-21: for ghc-lib-parser 9.8 compat
- os-string == 1.* # 2025-07-30: dummy package we need for pre os-string GHCs
- path == 0.9.5 # 2025-09-21: Pin for hls on ghc 9.4
- postgresql-binary < 0.14 # 2025-01-19: Needed for building postgrest
- primitive-unlifted == 0.1.3.1 # 2024-03-16: preserve for ghc 9.2
- retrie < 1.2.0.0 # 2022-12-30: preserve for ghc < 9.2
- shake-cabal < 0.2.2.3 # 2023-07-01: last version to support Cabal 3.6.*
- ShellCheck == 0.9.0 # 2024-03-21: pinned by haskell-ci
- simple-get-opt < 0.5 # 2025-05-01: for crux-0.7.2
- stylish-haskell == 0.14.4.0 # 2022-09-19: preserve for ghc 9.0
- stylish-haskell == 0.14.5.0 # 2025-04-14: needed for hls with ghc-lib 9.6
- stylish-haskell == 0.14.6.0 # 2025-09-21: needed for hls with ghc-lib 9.8
- stylish-haskell == 0.15.0.1 # 2025-04-14: needed for hls with ghc-lib 9.10
- tar == 0.6.0.0 # 2025-02-08: last version to not require os-string (which can't be built with GHC < 9.2)
- tar == 0.6.3.0 # 2025-08-17: last version to not require file-io and directory-ospath-streaming (for GHC < 9.6)
- text-builder < 1 # 2025-08-27: Needed for building postgrest
- text-builder-dev < 0.4 # 2025-08-27: Needed for building postgrest
- text-metrics < 0.3.3 # 2025-02-08: >= 0.3.3 uses GHC2021
- weeder == 2.3.* # 2022-05-31: preserve for GHC 9.0.2
- weeder == 2.4.* # 2023-02-02: preserve for GHC 9.2.*
# keep-sorted end

# keep-sorted start skip_lines=1 case=no
Expand Down
Loading
Loading