Skip to content

Commit a50b496

Browse files
authored
Update flake.nix to make GHC 9.10.1 and GHC 9.8.2 available (#2810)
* Update GHC 9.6.2 to 9.6.6. * Enable GHC 9.8.2 and remove GHC 9.0.2. * Export ghcVersion from flake.nix. * Remove Hackage calls for packages already in nixpkgs. * Add GHC 9.10.1. * Add comments to overlays. * Make GHC 9.10 the default in flake.nix. * Remove commented code.
1 parent fbd486e commit a50b496

File tree

7 files changed

+118
-72
lines changed

7 files changed

+118
-72
lines changed

flake.lock

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
# The versions of GHC that we want to be able to build / develop against
3737
# within the nix environment. Since nix is lazy, only derivations for
3838
# versions of GHC which are used are actually evaluated.
39-
ghcVersions = [ "ghc902" "ghc962" ];
39+
ghcVersions = [ "ghc96" "ghc98" "ghc910" ];
4040

4141
# We pick a single version of GHC to use by default within nix. This is
4242
# probably cleaner than always having N copies of each package / app and
4343
# being forced to refer to them by their GHC version.
44-
defaultGhcVersion = "ghc962";
44+
defaultGhcVersion = "ghc910";
4545

4646
# Overlays are not per-system, so let's only compute them once.
4747
# For each version of GHC we produce a `pkgs.clashPackages-ghcVER`, e.g.
@@ -83,6 +83,9 @@
8383
in
8484
assert pkgs.lib.asserts.assertOneOf "defaultGhcVersion" defaultGhcVersion ghcVersions;
8585
{
86+
# Export the variable so that other flakes can use it.
87+
ghcVersion = defaultGhcVersion;
88+
8689
packages = {
8790
inherit (pkgs."clashPackages-${defaultGhcVersion}")
8891
clash-benchmark

nix/overlay-ghc902.nix

Lines changed: 0 additions & 33 deletions
This file was deleted.

nix/overlay-ghc910.nix

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{ pkgs }:
2+
final: prev:
3+
let
4+
inherit (pkgs.haskell.lib) dontCheck doJailbreak markUnbroken;
5+
in
6+
{
7+
# Use an older version than the default in nixpkgs. Since rewrite-inspector
8+
# is basically abandonware it catches fire with brick 1.0+.
9+
brick = doJailbreak prev.brick_0_70_1;
10+
11+
# brick 0.70.1 requires vty < 6.0.
12+
vty = doJailbreak (prev.callHackage "vty" "5.39" { });
13+
14+
# Relies on older versions of some libraries.
15+
hint = doJailbreak prev.hint;
16+
17+
# Marked as broken in nixpkgs, since it specifies much older dependencies
18+
# than the defaults in nixpkgs.
19+
rewrite-inspector = doJailbreak (markUnbroken prev.rewrite-inspector);
20+
21+
# Requires some old versions of libraries, but still works.
22+
derive-storable-plugin = doJailbreak prev.derive-storable-plugin;
23+
24+
# Marken as broken, but compiles anyway.
25+
hedgehog-fakedata = doJailbreak (markUnbroken prev.hedgehog-fakedata);
26+
27+
# Fails on GHC 9.10 with:
28+
# library/Text/Regex/PCRE/Heavy.hs:123: failure in expression `head $ scan [re|\s*entry (\d+) (\w+)\s*&?|] (" entry 1 hello &entry 2 hi" :: String)'
29+
# expected: (" entry 1 hello &",["1","hello"])
30+
# but got: <interactive>:55:1: warning: [GHC-63394] [-Wx-partial]
31+
# ^
32+
# In the use of ‘head’
33+
# (imported from Prelude.Compat, but defined in GHC.Internal.List):
34+
# "This is a partial function, it throws an error on empty lists. Use pattern matching, 'Data.List.uncons' or 'Data.Maybe.listToMaybe' instead. Consider refactoring to use "Data.List.NonEmpty"."
35+
# (" entry 1 hello &",["1","hello"])
36+
37+
pcre-heavy = dontCheck prev.pcre-heavy;
38+
39+
# Relies on older versions of text.
40+
string-random = doJailbreak prev.string-random;
41+
42+
# We need the newest version from nixpkgs for these packages.
43+
singletons-base = prev.singletons-base_3_4;
44+
45+
microstache = prev.microstache_1_0_3;
46+
47+
th-desugar = prev.th-desugar_1_17;
48+
49+
singletons-th = prev.singletons-th_3_4;
50+
51+
# nixplgs doesn't include revision 1, changing dependency on template-haskell.
52+
string-interpolate = pkgs.haskell.lib.compose.overrideCabal (drv: {
53+
revision = "1";
54+
editedCabalFile = "sha256-oh0tR+LDFcVzQnm4kSrmhAU+P7wdai536d72Cvhzipg=";
55+
}) (prev.callHackageDirect {
56+
pkg = "string-interpolate";
57+
ver = "0.3.4.0";
58+
sha256 = "sha256-KA8P6cc6N7pZ9/ay3edcEGx4vpKtp+EY7tn8U1NrbG8=";
59+
} { });
60+
}
Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
{ pkgs }:
22
final: prev:
33
let
4-
inherit (pkgs.haskell.lib) doJailbreak dontCheck markUnbroken;
4+
inherit (pkgs.haskell.lib) doJailbreak markUnbroken;
55
in
66
{
77
# Use an older version than the default in nixpkgs. Since rewrite-inspector
88
# is basically abandonware it catches fire with brick 1.0+.
99
brick = doJailbreak prev.brick_0_70_1;
1010

11+
vty = prev.callHackage "vty" "5.39" { };
12+
13+
# Marked as broken in nixpkgs, since it needs on a newer hashable than the
14+
# .cabal file currently uploaded to hackage.
15+
concurrent-supply = doJailbreak (markUnbroken prev.concurrent-supply);
1116

1217
# Use a branch with changes to support GHC 9.6.1.
1318
hint =
@@ -25,25 +30,15 @@ in
2530
# than the defaults in nixpkgs.
2631
rewrite-inspector = doJailbreak (markUnbroken prev.rewrite-inspector);
2732

28-
# We want a version that matches with singletons-th, but the tests in here
29-
# are also a bit flaky since GHC 9.6 isn't officially supported.
30-
singletons-base = dontCheck prev.singletons-base_3_2;
31-
32-
# Use a newer version than the default in nixpkgs.
33-
singletons-th = prev.singletons-th_3_2;
34-
3533
# Needs a newer text than the .cabal file currently uploaded to hackage.
3634
string-qq = doJailbreak prev.string-qq;
3735

38-
# Needs a newer version than the default in nixpkgs.
39-
th-desugar = prev.th-desugar_1_15;
40-
4136
# Needs a newer base than the .cabal file currently uploaded to hackage.
4237
vector-binary-instances = doJailbreak prev.vector-binary-instances;
4338

44-
# Use an older version than the default in nixpkgs.
45-
th-abstraction = prev.th-abstraction_0_5_0_0;
46-
4739
# type-errors 0.2.0.2 is bounded on doctest >=0.16.0.1 && <0.22
4840
doctest = prev.callHackage "doctest" "0.21.1" { };
41+
42+
# Marken as broken, but compiles anyway.
43+
hedgehog-fakedata = doJailbreak (markUnbroken prev.hedgehog-fakedata);
4944
}

nix/overlay-ghc98.nix

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{ pkgs }:
2+
final: prev:
3+
let
4+
inherit (pkgs.haskell.lib) doJailbreak markUnbroken;
5+
in
6+
{
7+
# Use an older version than the default in nixpkgs. Since rewrite-inspector
8+
# is basically abandonware it catches fire with brick 1.0+.
9+
brick = doJailbreak prev.brick_0_70_1;
10+
11+
# brick 0.70.1 requires vty < 6.0.
12+
vty = doJailbreak (prev.callHackage "vty" "5.39" { });
13+
14+
# Marked as broken in nixpkgs, since it specifies much older dependencies
15+
# than the defaults in nixpkgs.
16+
rewrite-inspector = doJailbreak (markUnbroken prev.rewrite-inspector);
17+
18+
# Requires some old versions of libraries, but still works.
19+
derive-storable-plugin = doJailbreak prev.derive-storable-plugin;
20+
21+
# Marken as broken, but compiles anyway.
22+
hedgehog-fakedata = doJailbreak (markUnbroken prev.hedgehog-fakedata);
23+
}

nix/overlay.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ let
4848
"ghc-typelits-natnormalise"
4949
"${ghc-typelits-natnormalise}"
5050
{ };
51-
# doctest-parallel = hprev.callHackage "doctest-parallel" "0.3.1" { };
52-
doctest-parallel = hprev.callHackageDirect { pkg = "doctest-parallel"; ver = "0.3.1"; sha256 = "sha256-j0mk4RTEau6Cl90E8vMWZiA/ldRRurtLSYbGGE+q/vk="; } {};
5351
};
5452

5553
# An overlay with the packages in this repository.

0 commit comments

Comments
 (0)