Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flake.nix: install cabal-install from head #324

Merged
merged 1 commit into from
Jul 28, 2023
Merged

flake.nix: install cabal-install from head #324

merged 1 commit into from
Jul 28, 2023

Conversation

d-xo
Copy link
Collaborator

@d-xo d-xo commented Jul 20, 2023

Description

This is pretty ugly (and will probably make updating to a newer nixpkgs annoying), but it does give us access to the multiple components features that were added to cabal in haskell/cabal#8726. Which is imo a large enough workflow upgrade that it's worth this temporary hack until we get an official release.

See https://well-typed.com/blog/2023/03/cabal-multi-unit/ for docs.

To spawn a repl session for the tests where :r will reload changes made in lib:hevm, and run a single test:

cabal repl --enable-multi-repl test lib:hevm lib:test-utils
ghci> import Main
ghci> runSubSet "<TESTNAME>"

One unfortunate downside is that Paths.getDataFileName seems to be broken in a multi-component repl, so the tests that trace vs geth and the Dapp-Tests test group are broken. They still work in the normal single component repl.

Checklist

  • tested locally
  • added automated tests
  • updated the docs
  • updated the changelog

@d-xo d-xo requested review from arcz and msooseth July 20, 2023 15:15
@msooseth
Copy link
Collaborator

Do you think we can add multi-repl: True in the hevm.cabal file? I think it'd make sense to make it default, no?

Copy link
Collaborator

@msooseth msooseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. I see what you mean about updating, seeing the nix file changes, but I think we can go back to released cabal once the multi-component support is released. So I think it's a good workaround, and it's definitely rather slow as-is.

@d-xo
Copy link
Collaborator Author

d-xo commented Jul 25, 2023

Do you think we can add multi-repl: True in the hevm.cabal file? I think it'd make sense to make it default, no?

oh good idea, didn't realise we could do that...

@d-xo d-xo merged commit efa4732 into main Jul 28, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants