Skip to content

Commit

Permalink
Support ghc 9.4.3 (reflex-frp#486)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ali-abrar authored Dec 22, 2022
1 parent 8a186c4 commit 82c2b5e
Show file tree
Hide file tree
Showing 10 changed files with 97 additions and 40 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ jobs:
build:
strategy:
matrix:
ghc: ['8.4.4', '8.6.5', '8.8.4', '8.10.2', '9.0.1', '9.2.2']
ghc: ['8.4.4', '8.6.5', '8.8.4', '8.10.7', '9.0.1', '9.2.5', '9.4.3']
os: ['ubuntu-latest', 'macos-latest']
runs-on: ${{ matrix.os }}

name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: haskell/actions/setup@v1
- uses: haskell/actions/setup@v2
with:
ghc-version: ${{ matrix.ghc }}
- name: Cache
uses: actions/cache@v1
uses: actions/cache@v3
env:
cache-name: cache-cabal
with:
Expand All @@ -30,9 +30,7 @@ jobs:
${{ runner.os }}
- name: Install dependencies
run: |
cabal update
cabal build --only-dependencies --enable-tests --enable-benchmarks
run: cabal build --only-dependencies --enable-tests --enable-benchmarks
- name: Build
run: cabal build --enable-tests --enable-benchmarks all
- name: Run tests
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ tags
hsenv.log
\#*#
.#*
/shell.nix
/ghci-tmp
*.dump-*
*.verbose-core2core
2 changes: 2 additions & 0 deletions nixpkgs/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# DO NOT HAND-EDIT THIS FILE
import (import ./thunk.nix)
8 changes: 8 additions & 0 deletions nixpkgs/github.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"owner": "NixOS",
"repo": "nixpkgs",
"branch": "nixpkgs-unstable",
"private": false,
"rev": "e37ef84b478fa8da0ced96522adfd956fde9047a",
"sha256": "03qak39mn2142gp6zglrzrkdbig6h4r3da1psmvf3q2dwcw3zsfv"
}
12 changes: 12 additions & 0 deletions nixpkgs/thunk.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# DO NOT HAND-EDIT THIS FILE
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
if !fetchSubmodules && !private then builtins.fetchTarball {
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
} else (import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/3aad50c30c826430b0270fcf8264c8c41b005403.tar.gz";
sha256 = "0xwqsf08sywd23x0xvw4c4ghq0l28w2ki22h0bdn766i16z9q2gr";
}) {}).fetchFromGitHub {
inherit owner repo rev sha256 fetchSubmodules private;
};
json = builtins.fromJSON (builtins.readFile ./github.json);
in fetch json
15 changes: 15 additions & 0 deletions overlay.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{ haskellLib, self, super }:
{
# jailbreak here because callHackageDirect doesn't give us a way to get the latest revision of a package
# 0.1.0.0-r3 would work just fine
commutative-semigroups = haskellLib.doJailbreak (self.callHackageDirect {
pkg = "commutative-semigroups";
ver = "0.1.0.0";
sha256 = "0xmv20n3iqjc64xi3c91bwqrg8x79sgipmflmk21zz4rj9jdkv8i";
} {});
patch = self.callHackageDirect {
pkg = "patch";
ver = "0.0.8.1";
sha256 = "0q5rxnyilhbnfph48fnxbclggsbbhs0pkn0kfiadm0hmfr440cgk";
} {};
}
18 changes: 9 additions & 9 deletions reflex.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ extra-source-files:
ChangeLog.md

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

flag use-reflex-optimizer
description: Use the GHC plugin Reflex.Optimizer on some of the modules in the package. This is still experimental.
Expand Down Expand Up @@ -71,7 +71,7 @@ library
hs-source-dirs: src
build-depends:
MemoTrie == 0.6.*,
base >= 4.11 && < 4.17,
base >= 4.11 && < 4.18,
bifunctors >= 5.2 && < 5.6,
comonad >= 5.0.4 && < 5.1,
commutative-semigroups >= 0.1 && <0.2,
Expand All @@ -81,7 +81,7 @@ library
data-default >= 0.5 && < 0.8,
dependent-map >= 0.3 && < 0.5,
exception-transformers == 0.4.*,
lens >= 4.7 && < 5.2,
lens >= 4.7 && < 5.3,
mmorph >= 1.0 && < 1.2,
monad-control >= 1.0.1 && < 1.1,
mtl >= 2.1 && < 2.3,
Expand All @@ -95,7 +95,7 @@ library
semigroupoids >= 4.0 && < 6,
stm >= 2.4 && < 2.6,
syb >= 0.5 && < 0.8,
time >= 1.4 && < 1.12,
time >= 1.4 && < 1.13,
transformers >= 0.5.6.0 && < 0.6,
unbounded-delays >= 0.1.0.0 && < 0.2,
witherable >= 0.4 && < 0.5
Expand Down Expand Up @@ -188,7 +188,7 @@ library
dependent-sum >= 0.6 && < 0.8,
haskell-src-exts >= 1.16 && < 1.24,
haskell-src-meta >= 0.6 && < 0.9,
template-haskell >= 2.9 && < 2.19
template-haskell >= 2.9 && < 2.20
exposed-modules:
Reflex.Dynamic.TH
other-extensions: TemplateHaskell
Expand Down Expand Up @@ -260,10 +260,10 @@ test-suite hlint
, directory
, filepath
, filemanip
if impl(ghc >= 8.8)
build-depends: hlint >= 3 && < 4
if impl(ghc < 9.2)
build-depends: hlint (< 2.1 || >= 2.2.2) && < 3.5
else
build-depends: hlint (< 2.1 || >= 2.2.2) && < 4
build-depends: hlint >= 3.5 && < 3.6
if impl(ghcjs)
buildable: False

Expand Down
29 changes: 5 additions & 24 deletions release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
}:

let
native-reflex-platform = reflex-platform-fun {};
native-reflex-platform = reflex-platform-fun { __useNewerCompiler = true; };
inherit (native-reflex-platform.nixpkgs) lib;

perPlatform = lib.genAttrs supportedSystems (system: let
reflex-platform = reflex-platform-fun { inherit system; };
reflex-platform = reflex-platform-fun { inherit system; __useNewerCompiler = true; };
compilers = [
"ghc"
"ghcjs"
Expand All @@ -25,32 +25,13 @@ let
variationPkgs = lib.genAttrs variations (variation: let
reflex-platform = reflex-platform-fun {
inherit system;
__useNewerCompiler = true;
__useTemplateHaskell = variation == "reflex"; # TODO hack
haskellOverlays = [
(self: super: {
commutative-semigroups = self.callHackageDirect {
pkg = "commutative-semigroups";
ver = "0.1.0.0";
sha256 = "0xmv20n3iqjc64xi3c91bwqrg8x79sgipmflmk21zz4rj9jdkv8i";
} {};
patch = self.callHackageDirect {
pkg = "patch";
ver = "0.0.8.0";
sha256 = "1nnp7jn0vbx9zrnf57dxbknp6fbkqz7bca4i40aa6fabpwjw97kg";
} {};
})
(self: super: import ./overlay.nix { inherit self super; haskellLib = native-reflex-platform.nixpkgs.haskell.lib; })
# Use this package's source for reflex
(self: super: {
_dep = super._dep // {
reflex = builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [
"release.nix"
".git"
"dist"
"cabal.haskell-ci"
"cabal.project"
".travis.yml"
])) ./.;
};
_dep = super._dep // { reflex = import ./src.nix; };
})
];
};
Expand Down
34 changes: 34 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Enter a shell for this project, with some choice of compiler. By default, we
# select the version of ghc provided by reflex-platform, but you can choose a
# later version from nixpkgs as well by doing:
# $ nix-shell --argstr compiler "ghc943"
{ compiler ? "reflex-platform" # or "ghc943", "ghc924"
}:
let
rp = import ./dep/reflex-platform { __useNewerCompiler = true; };
pkgs = rp.nixpkgs;
haskellLib = pkgs.haskell.lib;
system = builtins.currentSystem;
nixpkgsGhc = ((import ./nixpkgs {}).haskell.packages.${compiler}).override {
overrides = self: super: import ./overlay.nix { inherit self super haskellLib; } // {
hlint = self.callHackageDirect {
pkg = "hlint";
ver = "3.5";
sha256 = "1np43k54918v54saqqgnd82ccd6225njwxpg2031asi70jam80x9";
} {};
};
};
reflexEnv = if compiler == "reflex-platform"
then (import ./release.nix {}).${system}.ghc.reflex.env
else (nixpkgsGhc.callCabal2nix "reflex" (import ./src.nix) {}).env;
in
pkgs.mkShell {
name = "shell";
buildInputs = [
pkgs.cabal-install
pkgs.ghcid
];
inputsFrom = [
reflexEnv
];
}
8 changes: 8 additions & 0 deletions src.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
builtins.filterSource (path: type: !(builtins.elem (baseNameOf path) [
"release.nix"
".git"
"dist"
"cabal.haskell-ci"
"cabal.project"
".travis.yml"
])) ./.

0 comments on commit 82c2b5e

Please sign in to comment.