rubik / stack-hpc-coveralls

Coveralls support for Stack projects
ISC License
33 stars 15 forks source link

Help with simple setup #18

Open hyperthunk opened 7 years ago

hyperthunk commented 7 years ago

I have the following travis config:

install:
- stack ${ARGS} setup --no-terminal

script:
- case "$COVER" of
  true)
    stack ${ARGS} test --coverage --no-terminal
    ./coverage.sh
    ;;
  *)
    stack ${ARGS} test --test-arguments='--plain'
    ;;
  esac

and a coverage script that does this:

#! /bin/sh

travis_retry curl -L https://github.com/rubik/stack-hpc-coveralls/releases/download/v0.0.4.0/shc-linux-x64-$GHCVER.tar.bz2 | tar -xj
shc -- --hpc-dir=$(stack $ARGS path --local-install-root)`/hpc/combined --dont-send combined all

but this doesn't work, and neither does it work without --hpc-dir - I consistently get this error:

shc: readCoverageData/filePath/stackProj: couldn't find distributed-process-extras-0.2.1.2-436qbc7bQkYA8cHMHRpzU2
CallStack (from HasCallStack):
  error, called at src/SHC/Coverage.hs:92:38 in stack-hpc-coveralls-0.0.4.0-3jO1AkdzEnhHM63skfTcNd:SHC.Coverage

Any hints as to what I'm doing wrong?

https://github.com/haskell-distributed/distributed-process-extras

rubik commented 7 years ago

What Stack version are you using? It's possible that they changed something that broke SHC.

hyperthunk commented 7 years ago
$ stack --version
Version 1.3.2, Git revision 3f675146590da4f3edf768b89355f798229da2a5 (4395 commits) x86_64 hpack-0.15.0

I figured that might be the case. I had issues with 1.0.4 too though. I'm having issues locally on OSX too, though I doubt that's relevant. Thanks for the quick reply btw!

pascalpoizat commented 7 years ago

Hello.

First of all, a great thanks to @rubik for SHC!

I use SHC in a template project for Haskell (I do such templates for my students at the University), see here:

https://github.com/pascalpoizat/template-haskell-project.

It used to work perfectly for LTS 7.19 / GHC 8.0.1. However, some days ago I had to upgrade to LTS 8.3 / GHC 8.0.2 on my laptop in order to have the IDEA/intero interaction to work (don't know why it began to fail, maybe some OS X issue once more ...). But now, it seems that coverage data are no longer sent to coveralls.

Still, if you have a project that runs under LTS 7.19 / GHC 8.0.1 you may possible take inspiration from my template. Only 2 changes are then required:

I hope it may help.

Pascal PS: I will continue tests, eg to see if the format of coverage data has changed. PPS: indeed, I have to use the binary SHC 0.0.4.0 version, trying to build it in the build script of my template fails :-(

pascalpoizat commented 7 years ago

I used GHCVER=8.0.2 instead of GHCVER=8.0.1 in my travis.yml file in order to cope with the GHC I used. However, there was no SHC release to get with this version. Using GHCVER=8.0.1 everything works now.