Closed killy971 closed 9 years ago
I'm currently being affected by this issue. Has there been any progress?
@zovt I'm working on it when I can find some time, and hope to fix it soon. Will keep you updated.
I've already implemented the module to read the package name-version.
Background analysis
Below is the current implementation of the
getMixPath
function, which computes a mix file path based on the hpc data directory, the test suite name, and the tix module:In some cases, this function doesn't return the correct path. For a concrete example, see this build output: https://travis-ci.org/guillaume-nargeot/hpc-coveralls/jobs/50498362 (throw away test branch hpc-data-dir-troubleshooting)
As a result of this build, the partial directory tree of the
dist/hpc/vanilla/
folder is:In both
hpc-coveralls-0.8.4.tix
andtest-all.tix
, themodName
value for theTraceHpcCoveralls.Util
module ishpcco_IlD5BmmDkZU34g6Jd9zefP/Trace.Hpc.Coveralls.Util
.When building the same package with cabal 1.20 and ghc 7.8 (instead of cabal 1.22 and ghc 7.10), the
hpcco_IlD5BmmDkZU34g6Jd9zefP
bit found in the module name and directory structure ishpc-coveralls-0.8.4
, which seems to be more correct.This strange looking string is the reason why the
getMixPath
function fails, as it will produce the following path, which doesn't exist:The correct path should instead be:
The fact that the referenced mix file paths have this additional indirection (two times the package name) is yet to be understood. A simpler package, such as this one, used for hpc-coveralls testing, doesn't seem to generate mix files in such a way (see this build), and therefore doesn't suffer from this issue.
Objective
Either find a way to better control hpc and where it outputs the tix/mix data files, or try to access the package name and pass it to the
getMixPath
function.The package name can be parsed from the cabal file using
Distribution.PackageDescription
(distributed with cabal, so it should always be available). A new command line option may have to be introduced in order to specify the cabal file, or it could be found by inspecting the current folder.Feature branch: read-cabal-file