Skip to content

Commit

Permalink
Fix nix flake devshell (#3897)
Browse files Browse the repository at this point in the history
Follow-up to
#3890

- update GHC from 9.6.4 to 9.6.5
- update Stackage LTS from 22.10 to 22.23
- use HLS from Nix pkgs, upgrading it to 2.8.0.0
- update `all-cabal-hashes`
- remove `cabal.project.freeze`, but keep the scrips to generate it in
case we ever want it back
- update README with up-to-date information about updating Haskell
dependencies
- add `stack` to Nix dev shell

---------

Co-authored-by: Sam Balco <[email protected]>
  • Loading branch information
geo2a and goodlyrottenapple authored May 27, 2024
1 parent dc44cc9 commit 069533c
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 261 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ on:
- master

env:
ghc_version: "9.6.4"
ghc_version: "9.6.5"
stack_version: "2.15.1"
hpack_version: '0.34.2'
hpack_version: '0.36'

jobs:
release:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ concurrency:
cancel-in-progress: true

env:
ghc_version: "9.6.4"
ghc_version: "9.6.5"
stack_version: "2.15.1"
hpack_version: '0.34.2'
hpack_version: '0.36'

jobs:
formatting:
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,13 @@ Note that only `cabal` currently works within the nix shell and since it does no

### Upgrading dependencies

When one of the package description files (`kore.cabal`, `kore-rpc-types.cabal`) changes, or when upgrading to a newer `stack` resolver, the dependencies need to be consolidated to avoid accidental breakage from incompatible up-stream updates. We use a `cabal.project.freeze` file to pin the dependencies to what the current `stack` resolver is using.
We use `stack.yaml` (and hence `stack.yaml.lock`) as the source of truth about the Haskell package set the project is built with. The Nix flake uses [stacklock2nix](https://github.com/cdepillabout/stacklock2nix) to make the packages specified by the lock file available to `cabal-install` inside Nix.

The script [`scripts/freeze-cabal-to-stack-resolver.sh`](https://github.com/runtimeverification/haskell-backend/tree/master/scripts/freeze-cabal-to-stack-resolver.sh) should do most of that work (the existing `freeze` file must be removed before running it), and [`scripts/check-cabal-stack-sync.sh`](https://github.com/runtimeverification/haskell-backend/tree/master/scripts/check-cabal-stack-sync.sh) checks the result. Some manual adjustments will still be necessary for the `nix` builds in CI and locally to work.
Any GHC or resolver upgrades must double-check the `ghcVersion` value in the [`flake.nix`](https://github.com/runtimeverification/haskell-backend/blob/master/flake.nix#L32) file.

In addition, any GHC or resolver upgrades must double-check the `compiler-nix-name` and `index-state` values in the [`flake.nix`](https://github.com/runtimeverification/haskell-backend/blob/master/flake.nix#L41-L42) file.
It may also be required to update [`all-cabal-hashes`](https://github.com/runtimeverification/haskell-backend/blob/master/flake.nix#L101).

To support the scenario of building the project with `cabal-install` outside of Nix, We use a `cabal.project.freeze` file to pin the dependencies to what the current `stack` resolver is using. The script [`scripts/freeze-cabal-to-stack-resolver.sh`](https://github.com/runtimeverification/haskell-backend/tree/master/scripts/freeze-cabal-to-stack-resolver.sh) should do most of that work, and [`scripts/check-cabal-stack-sync.sh`](https://github.com/runtimeverification/haskell-backend/tree/master/scripts/check-cabal-stack-sync.sh) checks the result. Some manual adjustments will still be necessary for the `nix` builds in CI and locally to work.

### Integration tests

Expand Down
Loading

0 comments on commit 069533c

Please sign in to comment.