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

cabal test slow because of lack of caching #8428

Open
oberblastmeister opened this issue Aug 24, 2022 · 4 comments
Open

cabal test slow because of lack of caching #8428

oberblastmeister opened this issue Aug 24, 2022 · 4 comments

Comments

@oberblastmeister
Copy link

oberblastmeister commented Aug 24, 2022

Describe the bug
cabal test is slower than running cabal run tests when nothing has changed. This issue is exacerbated when using the new code generators feature, which makes cabal recompile the test suite on every invocation.

To Reproduce

Clone https://github.com/gbaz/cabal-doctest-demo.

$ cabal v2-test

Running the second time still recompiles the test suite.

$ cabal v2-test

Expected behavior
Cabal should not recompile the entire test suite when nothing has changed.

System information

  • NixOS 22.05
  • Cabal 3.8.1.0
  • GHC 9.2.4
@Mikolaj
Copy link
Member

Mikolaj commented Aug 24, 2022

Do you mean "cabal test is slower"?

@oberblastmeister oberblastmeister changed the title cabal-test slow because of lack of caching cabal test slow because of lack of caching Aug 24, 2022
@oberblastmeister
Copy link
Author

Yeah, updated it

@Mikolaj
Copy link
Member

Mikolaj commented Aug 24, 2022

cabal test slower than running cabal run tests is a separate issue and there may already be a ticket about that.

Recompilation due to code generators is a new problem, because it's a new feature. I can't repro, though, because compilation fails with

Error: cabal-3.8.1.0: Main.hs doesn't exist

@gbaz
Copy link
Collaborator

gbaz commented Aug 25, 2022

I suspect what is happening is the demo codegen drivers always emit new code even if it is bit-for-bit identical with old code, and that in turn triggers the rebuild -- i.e. it isn't a cabal issue, but just that the demo code is not very sophisticated. I also consider this somewhat low priority, in that it is not clear to me why someone would want to repeatedly rerun tests that are not recompiled, as they will continue to yield the same results?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants