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

stack test --coverage crashes #1162

Closed
soenkehahn opened this issue Oct 15, 2015 · 4 comments
Closed

stack test --coverage crashes #1162

soenkehahn opened this issue Oct 15, 2015 · 4 comments

Comments

@soenkehahn
Copy link

stack test --coverage crashes with the following message:
/home/shahn/dead-code-detection/.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/package.conf.inplace/dead-code-detection-0.4-inplace.conf: openFile: does not exist (No such file or directory)

stack revision: ddc4588 (recent master)

Running stack test --coverage in https://github.com/soenkehahn/dead-code-detection/tree/b405254521faf4cce78ee9fc819a323fbcdac983.

@mgsloan
Copy link
Contributor

mgsloan commented Oct 15, 2015

Hey Soenke, thanks for reporting this! I can indeed reproduce the issue, it's due to a change I made a few hours ago in an attempt to fix coverage results. I've reverted the change.

The problem is that I need to get a package key (those things that look like deadc_A7pNEgFOJJW9nvvA3ldIjb) for a package that just got built. ghc-pkg can tell me info about these packages, since they are installed locally even for stack build or stack test. However, it seems to give me the wrong package keys sometimes... I need to investigate this further.

@mgsloan
Copy link
Contributor

mgsloan commented Oct 18, 2015

@soenkehahn I've reverted the commit that caused this, so this particular issue is now fixed.

The core issue is unfortunately unresolved: #1181

It'll get fixed one way or another, though.

@mgsloan mgsloan closed this as completed Oct 18, 2015
mgsloan added a commit that referenced this issue Oct 19, 2015
This brings back e26dc62, but with
better error reporting (not fatal, and put in the output HTML), and
gracefully handles the case that the cabal file does not have a library
stanza (#1162)
@soenkehahn
Copy link
Author

I added a library section to the cabal file and let the test suite depend on it. Then everything works. It would be nice if that weren't necessary of course.

Btw, this is not at all urgent to me. It just would be great if stack supported this out of the box. Thanks for working on this!

@mgsloan
Copy link
Contributor

mgsloan commented Oct 21, 2015

@soenkehahn Welcome! I've added some more explanation of why it's done this way here: #1008 (comment)

Also, I've just added a stack hpc report command, which lets you create reports from tix files. If you specify multiple tix files / package components, then the coverage info gets unioned together.

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