Skip to content

Commit ae9074c

Browse files
committed
project: deprecate ghc-8.10.7
1 parent a99bf39 commit ae9074c

File tree

5 files changed

+62
-46
lines changed

5 files changed

+62
-46
lines changed

.github/workflows/ci.yml

+2-6
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ jobs:
3131
ghc: "9.2.5"
3232
os: ubuntu-latest
3333

34-
- cabal: "3.2"
35-
ghc: "8.10.7"
36-
os: ubuntu-latest
37-
3834
# latest GHC, non-default OS
3935
- cabal: "3.8"
4036
ghc: "9.6"
@@ -106,8 +102,8 @@ jobs:
106102

107103
- name: Build
108104
run: |
109-
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
105+
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --no-nix
110106
111107
- name: Test
112108
run: |
113-
stack test --system-ghc
109+
stack test --system-ghc --no-nix

flake.lock

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+47-26
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,57 @@
11
{
2-
description = "A Klister flake";
3-
4-
inputs = {
5-
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
6-
flake-utils.url = "github:numtide/flake-utils";
7-
};
2+
description = "A klister flake";
3+
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
4+
inputs.flake-utils.url = "github:numtide/flake-utils";
85

96
outputs = { self, nixpkgs, flake-utils }:
107
flake-utils.lib.eachDefaultSystem (system:
118
let
12-
pkgs = nixpkgs.legacyPackages.${system};
13-
overlay = final: prev: {
14-
klister = prev.callCabal2nix "klister" ./. { };
9+
pkgs = nixpkgs.legacyPackages.${system};
10+
11+
hPkgs =
12+
pkgs.haskell.packages."ghc966"; # need to match Stackage LTS version
13+
# from stack.yaml snapshot
14+
15+
myDevTools = [
16+
hPkgs.ghc # GHC compiler in the desired version (will be available on PATH)
17+
hPkgs.ghcid # Continuous terminal Haskell compile checker
18+
hPkgs.ormolu # Haskell formatter
19+
hPkgs.hlint # Haskell codestyle checker
20+
hPkgs.hoogle # Lookup Haskell documentation
21+
hPkgs.haskell-language-server # LSP server for editor
22+
hPkgs.implicit-hie # auto generate LSP hie.yaml file from cabal
23+
hPkgs.retrie # Haskell refactoring tool
24+
# hPkgs.cabal-install
25+
stack-wrapped
26+
pkgs.zlib # External C library needed by some Haskell packages
27+
];
28+
29+
# Wrap Stack to work with our Nix integration. We don't want to modify
30+
# stack.yaml so non-Nix users don't notice anything.
31+
# - no-nix: We don't want Stack's way of integrating Nix.
32+
# --system-ghc # Use the existing GHC on PATH (will come from this Nix file)
33+
# --no-install-ghc # Don't try to install GHC if no matching GHC found on PATH
34+
stack-wrapped = pkgs.symlinkJoin {
35+
name = "stack"; # will be available as the usual `stack` in terminal
36+
paths = [ pkgs.stack ];
37+
buildInputs = [ pkgs.makeWrapper ];
38+
postBuild = ''
39+
wrapProgram $out/bin/stack \
40+
--add-flags "\
41+
--no-nix \
42+
--system-ghc \
43+
--no-install-ghc \
44+
"
45+
'';
1546
};
16-
haskellPackages = pkgs.haskellPackages.extend overlay;
1747
in {
18-
# nix build
19-
packages.default = haskellPackages.klister;
48+
devShells.default = pkgs.mkShell {
49+
buildInputs = myDevTools;
2050

21-
# nix develop
22-
devShells.default = haskellPackages.shellFor {
23-
withHoogle = true;
24-
packages = p: [ p.klister ];
25-
buildInputs = with haskellPackages; [
26-
cabal-install
27-
haskell-language-server
28-
eventlog2html
29-
];
30-
shellHook = ''
31-
export KLISTERPATH="$(pwd)"/examples/
32-
'';
51+
# Make external Nix c libraries like zlib known to GHC, like
52+
# pkgs.haskell.lib.buildStackProject does
53+
# https://github.com/NixOS/nixpkgs/blob/d64780ea0e22b5f61cd6012a456869c702a72f20/pkgs/development/haskell-modules/generic-stack-builder.nix#L38
54+
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath myDevTools;
3355
};
34-
}
35-
);
56+
});
3657
}

klister.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ author: David Christiansen <[email protected]>, Samuel Géline
88
maintainer: David Christiansen <[email protected]>, Samuel Gélineau <[email protected]>
99
license: BSD-3-Clause
1010
license-file: LICENSE
11-
tested-with: GHC==8.10.7, GHC==9.2.5, GHC==9.4, GHC==9.6
11+
tested-with: GHC==9.2.5, GHC==9.4, GHC==9.6
1212
build-type: Simple
1313
data-files:
1414
stdlib/defun.kl

stack.yaml

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
resolver: lts-20.25
1+
resolver: lts-22.39
22
packages:
33
- .
44
extra-deps:
5-
- transformers-0.6.1.0@sha256:7e7feea5fc9071375a973a48290fee6664e3eba38eb7028ce04850911f1ad0d4,3146
6-
- mtl-2.3.1
7-
- exceptions-0.10.7
8-
- hedgehog-1.2
9-
- tasty-hedgehog-1.4.0.0@sha256:d29ba1e363d9d41da5b34d4f320ab761cbc9c19fda6091d2d650351604c2d9aa,1795
5+
6+
# mark nix as disable. Nix users can use cabal and the nix flake
7+
nix:
8+
enable: false

0 commit comments

Comments
 (0)