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

Replicating coverage report on user side #1278

Open
ivanperez-keera opened this issue Dec 28, 2023 · 2 comments
Open

Replicating coverage report on user side #1278

ivanperez-keera opened this issue Dec 28, 2023 · 2 comments

Comments

@ivanperez-keera
Copy link

I'm trying to replicate the coverage report we are getting on this package: https://hackage.haskell.org/package/copilot-core

When I run what I believe are the same instructions locally, I'm met with:

# cabal v2-test --enable-coverage --test-log=testFile --test-show-details=never --disable-optimization 
Resolving dependencies...
Error:
    Internal libraries only supported with per-component builds.
    Per-component builds were disabled because program coverage is enabled
    In the package 'attoparsec-0.14.4'

I reported this on cabal's repo a while back (haskell/cabal#6440 (comment)) and a fix was pushed 2 weeks ago; however, hackage is somehow still obtaining some coverage metrics, so there's gotta be a way to get that same coverage result without needed a new version of cabal.

I tried reviewing the build and test logs but they do not include the commands being executed (it'd be nice if they did).

What commands is hackage running on our package to produce that coverage result?

@gbaz
Copy link
Contributor

gbaz commented Jan 6, 2024

here's the relevant function in the hackage builder: https://github.com/haskell/hackage-server/blob/master/exes/BuildClient.hs#L652

Not sure why the results would be different on hackage vs locally.

@gbaz
Copy link
Contributor

gbaz commented Jan 6, 2024

oh -- i see! in the working setup, cabal is ensuring that program coverage is only enabled for the current library being built. (because it builds the other code first, i believe). somehow, i suspect that the --enable-coverage flag set on the command line with that version of cabal is instead being scoped over dependencies -- hence causing the problem not with copilot itself, but rather with attoparsec.

i'm not sure the story with scoping of such flags in the latest version of cabal, but i hope its improved.

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

No branches or pull requests

2 participants