Skip to content

Commit 82c2b5e

Browse files
authored
Support ghc 9.4.3 (#486)
* ci: enable ghc 9.4.3 * cabal: loosen bounds * ci: remove extra cabal update * Add shell.nix; Allow compiler selection when entering shell * ci: update github cache action * cabal: loosen version bounds; Improve shell.nix * cabal: loosen time bounds * ci: fix reflex-platform build
1 parent 8a186c4 commit 82c2b5e

File tree

10 files changed

+97
-40
lines changed

10 files changed

+97
-40
lines changed

.github/workflows/haskell.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ jobs:
66
build:
77
strategy:
88
matrix:
9-
ghc: ['8.4.4', '8.6.5', '8.8.4', '8.10.2', '9.0.1', '9.2.2']
9+
ghc: ['8.4.4', '8.6.5', '8.8.4', '8.10.7', '9.0.1', '9.2.5', '9.4.3']
1010
os: ['ubuntu-latest', 'macos-latest']
1111
runs-on: ${{ matrix.os }}
1212

1313
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
1414
steps:
1515
- uses: actions/checkout@v2
16-
- uses: haskell/actions/setup@v1
16+
- uses: haskell/actions/setup@v2
1717
with:
1818
ghc-version: ${{ matrix.ghc }}
1919
- name: Cache
20-
uses: actions/cache@v1
20+
uses: actions/cache@v3
2121
env:
2222
cache-name: cache-cabal
2323
with:
@@ -30,9 +30,7 @@ jobs:
3030
${{ runner.os }}
3131
3232
- name: Install dependencies
33-
run: |
34-
cabal update
35-
cabal build --only-dependencies --enable-tests --enable-benchmarks
33+
run: cabal build --only-dependencies --enable-tests --enable-benchmarks
3634
- name: Build
3735
run: cabal build --enable-tests --enable-benchmarks all
3836
- name: Run tests

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ tags
3232
hsenv.log
3333
\#*#
3434
.#*
35-
/shell.nix
3635
/ghci-tmp
3736
*.dump-*
3837
*.verbose-core2core

nixpkgs/default.nix

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# DO NOT HAND-EDIT THIS FILE
2+
import (import ./thunk.nix)

nixpkgs/github.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"owner": "NixOS",
3+
"repo": "nixpkgs",
4+
"branch": "nixpkgs-unstable",
5+
"private": false,
6+
"rev": "e37ef84b478fa8da0ced96522adfd956fde9047a",
7+
"sha256": "03qak39mn2142gp6zglrzrkdbig6h4r3da1psmvf3q2dwcw3zsfv"
8+
}

nixpkgs/thunk.nix

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# DO NOT HAND-EDIT THIS FILE
2+
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
3+
if !fetchSubmodules && !private then builtins.fetchTarball {
4+
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
5+
} else (import (builtins.fetchTarball {
6+
url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz";
7+
sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr";
8+
}) {}).fetchFromGitHub {
9+
inherit owner repo rev sha256 fetchSubmodules private;
10+
};
11+
json = builtins.fromJSON (builtins.readFile ./github.json);
12+
in fetch json

overlay.nix

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{ haskellLib, self, super }:
2+
{
3+
# jailbreak here because callHackageDirect doesn't give us a way to get the latest revision of a package
4+
# 0.1.0.0-r3 would work just fine
5+
commutative-semigroups = haskellLib.doJailbreak (self.callHackageDirect {
6+
pkg = "commutative-semigroups";
7+
ver = "0.1.0.0";
8+
sha256 = "0xmv20n3iqjc64xi3c91bwqrg8x79sgipmflmk21zz4rj9jdkv8i";
9+
} {});
10+
patch = self.callHackageDirect {
11+
pkg = "patch";
12+
ver = "0.0.8.1";
13+
sha256 = "0q5rxnyilhbnfph48fnxbclggsbbhs0pkn0kfiadm0hmfr440cgk";
14+
} {};
15+
}

reflex.cabal

+9-9
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ extra-source-files:
2828
ChangeLog.md
2929

3030
tested-with:
31-
GHC ==8.4.4 || ==8.6.5 || ==8.8.1 || ==8.10.2 || ==9.0.1 || ==9.2.2,
32-
GHCJS ==8.6
31+
GHC ==8.4.4 || ==8.6.5 || ==8.8.1 || ==8.10.7 || ==9.0.1 || ==9.2.5 || ==9.4.3,
32+
GHCJS ==8.6 || ==8.10
3333

3434
flag use-reflex-optimizer
3535
description: Use the GHC plugin Reflex.Optimizer on some of the modules in the package. This is still experimental.
@@ -71,7 +71,7 @@ library
7171
hs-source-dirs: src
7272
build-depends:
7373
MemoTrie == 0.6.*,
74-
base >= 4.11 && < 4.17,
74+
base >= 4.11 && < 4.18,
7575
bifunctors >= 5.2 && < 5.6,
7676
comonad >= 5.0.4 && < 5.1,
7777
commutative-semigroups >= 0.1 && <0.2,
@@ -81,7 +81,7 @@ library
8181
data-default >= 0.5 && < 0.8,
8282
dependent-map >= 0.3 && < 0.5,
8383
exception-transformers == 0.4.*,
84-
lens >= 4.7 && < 5.2,
84+
lens >= 4.7 && < 5.3,
8585
mmorph >= 1.0 && < 1.2,
8686
monad-control >= 1.0.1 && < 1.1,
8787
mtl >= 2.1 && < 2.3,
@@ -95,7 +95,7 @@ library
9595
semigroupoids >= 4.0 && < 6,
9696
stm >= 2.4 && < 2.6,
9797
syb >= 0.5 && < 0.8,
98-
time >= 1.4 && < 1.12,
98+
time >= 1.4 && < 1.13,
9999
transformers >= 0.5.6.0 && < 0.6,
100100
unbounded-delays >= 0.1.0.0 && < 0.2,
101101
witherable >= 0.4 && < 0.5
@@ -188,7 +188,7 @@ library
188188
dependent-sum >= 0.6 && < 0.8,
189189
haskell-src-exts >= 1.16 && < 1.24,
190190
haskell-src-meta >= 0.6 && < 0.9,
191-
template-haskell >= 2.9 && < 2.19
191+
template-haskell >= 2.9 && < 2.20
192192
exposed-modules:
193193
Reflex.Dynamic.TH
194194
other-extensions: TemplateHaskell
@@ -260,10 +260,10 @@ test-suite hlint
260260
, directory
261261
, filepath
262262
, filemanip
263-
if impl(ghc >= 8.8)
264-
build-depends: hlint >= 3 && < 4
263+
if impl(ghc < 9.2)
264+
build-depends: hlint (< 2.1 || >= 2.2.2) && < 3.5
265265
else
266-
build-depends: hlint (< 2.1 || >= 2.2.2) && < 4
266+
build-depends: hlint >= 3.5 && < 3.6
267267
if impl(ghcjs)
268268
buildable: False
269269

release.nix

+5-24
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
}:
44

55
let
6-
native-reflex-platform = reflex-platform-fun {};
6+
native-reflex-platform = reflex-platform-fun { __useNewerCompiler = true; };
77
inherit (native-reflex-platform.nixpkgs) lib;
88

99
perPlatform = lib.genAttrs supportedSystems (system: let
10-
reflex-platform = reflex-platform-fun { inherit system; };
10+
reflex-platform = reflex-platform-fun { inherit system; __useNewerCompiler = true; };
1111
compilers = [
1212
"ghc"
1313
"ghcjs"
@@ -25,32 +25,13 @@ let
2525
variationPkgs = lib.genAttrs variations (variation: let
2626
reflex-platform = reflex-platform-fun {
2727
inherit system;
28+
__useNewerCompiler = true;
2829
__useTemplateHaskell = variation == "reflex"; # TODO hack
2930
haskellOverlays = [
30-
(self: super: {
31-
commutative-semigroups = self.callHackageDirect {
32-
pkg = "commutative-semigroups";
33-
ver = "0.1.0.0";
34-
sha256 = "0xmv20n3iqjc64xi3c91bwqrg8x79sgipmflmk21zz4rj9jdkv8i";
35-
} {};
36-
patch = self.callHackageDirect {
37-
pkg = "patch";
38-
ver = "0.0.8.0";
39-
sha256 = "1nnp7jn0vbx9zrnf57dxbknp6fbkqz7bca4i40aa6fabpwjw97kg";
40-
} {};
41-
})
31+
(self: super: import ./overlay.nix { inherit self super; haskellLib = native-reflex-platform.nixpkgs.haskell.lib; })
4232
# Use this package's source for reflex
4333
(self: super: {
44-
_dep = super._dep // {
45-
reflex = builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [
46-
"release.nix"
47-
".git"
48-
"dist"
49-
"cabal.haskell-ci"
50-
"cabal.project"
51-
".travis.yml"
52-
])) ./.;
53-
};
34+
_dep = super._dep // { reflex = import ./src.nix; };
5435
})
5536
];
5637
};

shell.nix

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Enter a shell for this project, with some choice of compiler. By default, we
2+
# select the version of ghc provided by reflex-platform, but you can choose a
3+
# later version from nixpkgs as well by doing:
4+
# $ nix-shell --argstr compiler "ghc943"
5+
{ compiler ? "reflex-platform" # or "ghc943", "ghc924"
6+
}:
7+
let
8+
rp = import ./dep/reflex-platform { __useNewerCompiler = true; };
9+
pkgs = rp.nixpkgs;
10+
haskellLib = pkgs.haskell.lib;
11+
system = builtins.currentSystem;
12+
nixpkgsGhc = ((import ./nixpkgs {}).haskell.packages.${compiler}).override {
13+
overrides = self: super: import ./overlay.nix { inherit self super haskellLib; } // {
14+
hlint = self.callHackageDirect {
15+
pkg = "hlint";
16+
ver = "3.5";
17+
sha256 = "1np43k54918v54saqqgnd82ccd6225njwxpg2031asi70jam80x9";
18+
} {};
19+
};
20+
};
21+
reflexEnv = if compiler == "reflex-platform"
22+
then (import ./release.nix {}).${system}.ghc.reflex.env
23+
else (nixpkgsGhc.callCabal2nix "reflex" (import ./src.nix) {}).env;
24+
in
25+
pkgs.mkShell {
26+
name = "shell";
27+
buildInputs = [
28+
pkgs.cabal-install
29+
pkgs.ghcid
30+
];
31+
inputsFrom = [
32+
reflexEnv
33+
];
34+
}

src.nix

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [
2+
"release.nix"
3+
".git"
4+
"dist"
5+
"cabal.haskell-ci"
6+
"cabal.project"
7+
".travis.yml"
8+
])) ./.

0 commit comments

Comments
 (0)