Skip to content

Commit

Permalink
chore: upgrade to GHC 9.10.1
Browse files Browse the repository at this point in the history
Note that Protolude upstream doesn't support GHC 9.10, so we use
a (hopefully temporary) fork.

Temporary workarounds required:

* Disable `hlint`: ndmitchell/hlint#1594
* Disable `cabal-fmt`: input-output-hk/haskell.nix#2205

Signed-off-by: Drew Hess <src@drewhess.com>
  • Loading branch information
dhess committed Jul 18, 2024
1 parent e7be104 commit 226069b
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 46 deletions.
20 changes: 9 additions & 11 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,7 @@ haddock-quickjump: True
haddock-hyperlink-source: True
haddock-internal: True

allow-newer:
, hedgehog-classes:hedgehog
, hedgehog-classes:pretty-show
, hedgehog:pretty-show
, logging-effect:base
, refined:base
, refined:deepseq
, refined:template-haskell
, refined:aeson
, these-skinny:base
, selda:bytestring
allow-newer: all

package *
ghc-options: -fwrite-ide-info
Expand All @@ -58,6 +48,14 @@ if arch(wasm32)
package tasty
flags: -unix

-- Protolude upstream doesn't support GHC 9.10, and appears to
-- be dormant.
source-repository-package
type: git
location: https://github.com/tomjaguarpaw/protolude
tag: 57ffd726d9685a862df8c9773f3eb09de2b89594
--sha256: 1z9z887s4f1wv0pv3njyd8h8zgr2ha89jyvaxz3k5k3rk6h2g1cp

-- We need a newer version of Selda than what's been released to
-- Hackage, plus some GHC 9.6 fixes from a community fork.
source-repository-package
Expand Down
2 changes: 1 addition & 1 deletion docs/haskell-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ import Foreword
* We can't make promises on backward compatibility with GHC releases older than the one we're currently using to develop the project, but we won't break compatibility arbitrarily.
* We will make a best-effort attempt to test all supported GHC versions in CI.
* As a general rule, we would like to avoid CPP-style conditional compilation, except as a last resort.
* We expect the 1.0 release of the project to have a minimum requirement of at least [GHC `9.6.1`](https://www.haskell.org/ghc/download_ghc_9_6_1.html), as we want to take advantage of that version's support for [JavaScript](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/javascript.html) and [WebAssembly](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/wasm.html?highlight=wasm) targets.
* We expect the 1.0 release of the project to have a minimum requirement of at least [GHC `9.10.1`](https://www.haskell.org/ghc/download_ghc_9_6_1.html), as we want to take advantage of that version's support for [JavaScript](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/javascript.html) and [WebAssembly](https://ghc.gitlab.haskell.org/ghc/doc/users_guide/wasm.html?highlight=wasm) targets.
* We do not plan to support Haskell implementations other than GHC.

## Spelling & grammar
Expand Down
24 changes: 12 additions & 12 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 30 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
in
builtins.trace "Nix Primer version is ${v}" "git-${v}";

ghcVersion = "ghc982";
ghcVersion = "ghc9101";

# We must keep the weeder version in sync with the version of
# GHC we're using.
Expand All @@ -62,7 +62,7 @@
inputs.self.overlays.default
];

# cabal-fmt needs an override for GHC 9.8.1.
# cabal-fmt needs an override for GHC > 9.8.1.
cabal-fmt-override = {
version = "latest";
cabalProject = ''
Expand Down Expand Up @@ -299,30 +299,40 @@
];

haskellNixTools = pkgs.haskell-nix.tools ghcVersion {
hlint = "latest";
# Disabled for GHC 9.10.
# https://github.com/ndmitchell/hlint/pull/1594
#hlint = "latest";
fourmolu = fourmoluVersion;
cabal-fmt = cabal-fmt-override;

# Disabled for GHC 9.10.
# https://github.com/input-output-hk/haskell.nix/issues/2205
#cabal-fmt = cabal-fmt-override;
};
in
{
projectRootFile = "flake.nix";

programs.hlint = {
enable = true;
package = haskellNixTools.hlint;
};
programs.cabal-fmt = {
enable = true;
package = haskellNixTools.cabal-fmt;
};
# Disabled for GHC 9.10.
# programs.hlint = {
# enable = true;
# package = haskellNixTools.hlint;
# };

# Disabled for GHC 9.10.
# programs.cabal-fmt = {
# enable = true;
# package = haskellNixTools.cabal-fmt;
# };
programs.fourmolu = {
enable = true;
package = haskellNixTools.fourmolu;
};
programs.nixpkgs-fmt.enable = true;
programs.shellcheck.enable = true;

settings.formatter.hlint.excludes = haskellExcludes;
# Disabled for GHC 9.10.
#settings.formatter.hlint.excludes = haskellExcludes;

settings.formatter.fourmolu.excludes = haskellExcludes;
};

Expand All @@ -337,8 +347,8 @@
wasm = pkgs.mkShell {
packages = with inputs.ghc-wasm.packages.${system};
[
wasm32-wasi-ghc-9_8
wasm32-wasi-cabal-9_8
wasm32-wasi-ghc-9_10
wasm32-wasi-cabal-9_10
wasmtime

pkgs.gnumake
Expand Down Expand Up @@ -481,14 +491,17 @@
implicit-hie = "latest";

cabal = "latest";
hlint = "latest";

# Disabled for GHC 9.10.
#hlint = "latest";

# Disabled, as it doesn't currently build with Nix.
#weeder = weederVersion;

fourmolu = fourmoluVersion;

cabal-fmt = cabal-fmt-override;
# Disabled for GHC 9.10.
#cabal-fmt = cabal-fmt-override;

#TODO Explicitly requiring tasty-discover shouldn't be necessary - see the commented-out `build-tool-depends` in primer.cabal.
tasty-discover = "latest";
Expand Down
2 changes: 1 addition & 1 deletion primer-api/primer-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ library
-Wmissing-deriving-strategies -fhide-source-paths

build-depends:
, base >=4.12 && <4.20
, base >=4.12 && <4.21
, containers >=0.6.0.1 && <0.7.0
, deriving-aeson >=0.2 && <0.3.0
, extra >=1.7.10 && <1.8.0
Expand Down
2 changes: 1 addition & 1 deletion primer-benchmark/primer-benchmark.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ library
exposed-modules: Benchmarks
build-depends:
, aeson >=2.0 && <2.3
, base >=4.12 && <4.20
, base >=4.12 && <4.21
, containers >=0.6.0.1 && <0.7.0
, criterion ^>=1.6.0.0
, deepseq ^>=1.5
Expand Down
2 changes: 1 addition & 1 deletion primer-selda/primer-selda.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ library

build-depends:
, aeson >=2.0 && <2.3
, base >=4.12 && <4.20
, base >=4.12 && <4.21
, bytestring >=0.10.8.2 && <0.13
, containers >=0.6.0.1 && <0.7.0
, logging-effect ^>=1.4
Expand Down
2 changes: 1 addition & 1 deletion primer-service/primer-service.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ library

build-depends:
, aeson >=2.0 && <2.3
, base >=4.12 && <4.20
, base >=4.12 && <4.21
, containers >=0.6.0.1 && <0.8
, deriving-aeson >=0.2 && <0.3.0
, exceptions >=0.10.4 && <0.11.0
Expand Down
2 changes: 1 addition & 1 deletion primer/primer.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ library
build-depends:
, aeson >=2.0 && <2.3
, assoc ^>=1.1
, base >=4.12 && <4.20
, base >=4.12 && <4.21
, base64-bytestring ^>=1.2.1
, containers >=0.6.0.1 && <0.7.0
, deriving-aeson >=0.2 && <0.3.0
Expand Down

0 comments on commit 226069b

Please sign in to comment.