Skip to content

Commit

Permalink
depricate use of ghc8.10
Browse files Browse the repository at this point in the history
  • Loading branch information
Cmdv committed Dec 13, 2024
1 parent 63eda8a commit 9bed37a
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Add your description here, if it fixes a particular issue please provide a [link
- [ ] Commits have useful messages
- [ ] New tests are added if needed and existing tests are updated
- [ ] Any changes are noted in the [changelog](https://github.com/IntersectMBO/cardano-db-sync/blob/master/db-sync/CHANGELOG.md)
- [ ] Code is formatted with [`fourmolu`](https://github.com/fourmolu/fourmolu) on version 0.10.1.0 (which can be run with `scripts/fourmolize.sh`)
- [ ] Code is formatted with [`fourmolu`](https://github.com/fourmolu/fourmolu) on version 0.16.2.0 (which can be run with `scripts/fourmolize.sh`)
- [ ] Self-reviewed the diff

# Migrations
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-fourmolu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
- name: Run fourmolu
uses: haskell-actions/run-fourmolu@v9
with:
version: "0.10.1.0"
version: "0.16.2.0"
2 changes: 1 addition & 1 deletion .github/workflows/check-hlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up HLint
uses: rwe/actions-hlint-setup@v1
with:
version: "3.2.7"
version: "3.8"

- name: Run HLint
uses: rwe/actions-hlint-run@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
matrix:
os: [ubuntu-latest]
# TODO: Add ghc910 when input-output-hk/devx is fixed
compiler-nix-name: [ghc810, ghc96, ghc98]
compiler-nix-name: [ghc96, ghc98]
include:
# We want a single job, because macOS runners are scarce.
- os: macos-latest
Expand Down
2 changes: 1 addition & 1 deletion doc/building-running.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ If building locally, to find `cardano-db-sync` executable location use:

```
find . -name cardano-db-sync -executable -type f
./dist-newstyle/build/x86_64-linux/ghc-8.10.4/cardano-db-sync-12.0.0/build/cardano-db-sync/cardano-db-sync
./dist-newstyle/build/x86_64-linux/ghc-9.6.5/cardano-db-sync-12.0.0/build/cardano-db-sync/cardano-db-sync
```

On macOS `brew install postgresl [email protected]` and extend PKG_CONFIG_PATH with
Expand Down
14 changes: 7 additions & 7 deletions doc/installing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ This guide assumes you have the following tools:

In addition, Cardano DB Sync requires the following software (instructions below):

* [GHC](https://www.haskell.org/ghcup/install/) >= 8.10.7
* [Cabal](https://www.haskell.org/ghcup/install/) >= 3.10.1.0
* [GHC](https://www.haskell.org/ghcup/install/) >= 9.6.5
* [Cabal](https://www.haskell.org/ghcup/install/) >= 3.12.1.0
* [libsodium-vrf](https://github.com/IntersectMBO/libsodium)
* [secp256k1](https://github.com/bitcoin-core/secp256k1)
* [blst](https://github.com/supranational/blst)
Expand Down Expand Up @@ -41,10 +41,10 @@ dependencies.
Once GHCup is installed, open a new terminal (to get an updated environment) and run:

```bash
ghcup install ghc 8.10.7
ghcup install cabal 3.10.1.0
ghcup set ghc 8.10.7
ghcup set cabal 3.10.1.0
ghcup install ghc 9.6.5
ghcup install cabal 3.12.1.0
ghcup set ghc 9.6.5
ghcup set cabal 3.12.1.0
```

Check that you will use the GHCup tools (and not any other installation on the system):
Expand Down Expand Up @@ -235,7 +235,7 @@ Explicitly set the GHC version that we installed earlier. This avoids defaulting
system version of GHC that might be different than the one you have installed.

```bash
echo "with-compiler: ghc-8.10.7" >> cabal.project.local
echo "with-compiler: ghc-9.6.5" >> cabal.project.local
```

macOS installs OpenSSL in a different location than expected by default. If you have
Expand Down
29 changes: 9 additions & 20 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,15 @@
})

(final: prev: {
# HLint 3.2.x requires GHC >= 8.10 && < 9.0
hlint = final.haskell-nix.tool "ghc8107" "hlint" {
version = "3.2.7";
hlint = final.haskell-nix.tool "ghc96" "hlint" {
version = "3.8";
};

# Fourmolu 0.10.x requires GHC >= 9.0 && < 9.6
fourmolu = final.haskell-nix.tool "ghc928" "fourmolu" {
version = "0.10.1.0";
fourmolu = final.haskell-nix.tool "ghc96" "fourmolu" {
version = "0.16.2.0";
};

# Weeder 2.2.0 requires GHC >= 8.10 && < 9.0
weeder = final.haskell-nix.tool "ghc8107" "weeder" {
version = "2.2.0";
weeder = final.haskell-nix.tool "ghc96" "weeder" {
version = "2.9.0";
};
})

Expand Down Expand Up @@ -141,10 +137,7 @@
project = (nixpkgs.haskell-nix.cabalProject' ({ config, lib, pkgs, ... }: rec {
src = ./.;
name = "cardano-db-sync";
compiler-nix-name =
if system == "x86_64-linux"
then lib.mkDefault "ghc810"
else lib.mkDefault "ghc96";
compiler-nix-name = lib.mkDefault "ghc96";
flake.variants =
let
compilers =
Expand All @@ -168,11 +161,7 @@
shell.tools = {
cabal = "latest";
haskell-language-server = {
src =
if config.compiler-nix-name == "ghc8107" then
nixpkgs.haskell-nix.sources."hls-1.10"
else
nixpkgs.haskell-nix.sources."hls-2.9";
src = nixpkgs.haskell-nix.sources."hls-2.9";
};
};
# Now we use pkgsBuildBuild, to make sure that even in the cross
Expand All @@ -181,7 +170,7 @@
shell.buildInputs = with nixpkgs.pkgsBuildBuild; [
gitAndTools.git
hlint
] ++ lib.optionals (config.compiler-nix-name == "ghc8107") [
] ++ lib.optionals (config.compiler-nix-name == "ghc96") [
# Weeder requires the GHC version to match HIE files
weeder
] ++ lib.optionals (system != "aarch64-darwin") [
Expand Down

0 comments on commit 9bed37a

Please sign in to comment.