hpc-coveralls icon indicating copy to clipboard operation
hpc-coveralls copied to clipboard

Stack support

Open valpackett opened this issue 10 years ago • 8 comments

stack is the new build tool that's better than cabal-install. It uses a different directory layout, so hpc-coveralls currently fails:

Couldn't find the hpc data directory
Couldn't find the directory dist/
Dumping dist/ directory content:
hpc-coveralls: dist/: getDirectoryContents: does not exist (No such file or directory)

valpackett avatar Jul 30 '15 19:07 valpackett

If I understand well, https://github.com/myfreeweb/sweetroll is an example project using stack? Can you please tell me where are the *.tix and *.mix files located in your project once you've run the tests with coverage enabled?

killy971 avatar Jul 31 '15 00:07 killy971

It doesn't use hpc, but https://github.com/myfreeweb/http-link-header does.

After running tests, tests.tix is created right in the project directory. The .hpc folder with the *.mix stuff is right there too.

valpackett avatar Jul 31 '15 01:07 valpackett

Is there any progress on stack support? Do you need help?

mrkkrp avatar Nov 02 '15 15:11 mrkkrp

I'm interested as well, what needs to be done exactly to support Stack?

rubik avatar Nov 04 '15 21:11 rubik

I wrote stack-hpc-coveralls, which is based on hpc-coveralls code. It's just an experiment, but at least it's working for my repositories.

The changes are pretty heavy and it's really meant to work with Stack out of the box, with little to no configuration. Therefore I did not submit a PR. I may in the future if the author is interested.

rubik avatar Nov 13 '15 22:11 rubik

@rubik You're welcome to help adding support for stack to hpc-coveralls!

It would be nice if we can keep the functionality backward compatible with cabal and be able to auto-detect whether the project is using cabal or stack (or a new flag could be introduced to specify to use stack, and if not specified it would switch back to cabal).

killy971 avatar Nov 24 '15 13:11 killy971

@guillaume-nargeot the files get generated under .stack-work:

$PROJECT_ROOT/.stack-work/install/x86_64-osx/lts-3.9/7.10.2/hpc/skylark-core/test/test.tix

Which is discoverable from the stack tool:

$ stack path --local-hpc-root
$PROJECT_ROOT/.stack-work/install/x86_64-osx/lts-3.9/7.10.2/hpc

And in the stack library: hpcDirFromDir.

mfine avatar Jan 15 '16 22:01 mfine

@guillaume-nargeot Detecting if a project is using Stack or Cabal should be a matter of just looking for the existence of the stack.yaml file in the main directory of the project.

If the file is there, then it should be assumed that the project is using Stack. Or if it is not there, then the project should be assumed to be using Cabal.

ExcaliburZero avatar May 21 '16 05:05 ExcaliburZero