Building locally
CLB uses GHC 9.6.6 with cabal
and CHaP (opens in a new tab).
We lock all versions of dependencies with cabal.project.freeze
file.
Since some Cardano dependencies require some specific setup it might be tricky to use a default GHC, you need to install alternative cryptographic libraries manually. So instead we recommend one of two ways:
- Use Nix CLB devshell shipped with CLB.
- Use IOG's
devx
default devshell.
(1) is a preferred method since it brings all the needed stuff to the shell - linters, formatters, pre-commit hooks, and so on.
Nix devshell
Ensure you run nix
greater than version 2.18.4.
Type nix develop
to enter the dev shell:
$ nix develop
[nix CLB ~/src/mlabs/clb]$ cabal update
...
[nix CLB ~/src/mlabs/clb]$ cabal build all
...
To run tools use pre-commit
command:
$ pre-commit run --all-files
cabal-fmt................................................................Passed
deadnix..................................................................Passed
fourmolu.................................................................Passed
hlint....................................................................Passed
nixpkgs-fmt..............................................................Passed
statix...................................................................Passed
devx
default shell
To enter the default devx
shell use the following command:
$ nix develop github:input-output-hk/devx#ghc96-iog-full --no-write-lock-file --refresh
$ cabal update
...
$ cabal build all
...