
#10952: Use IPids instead of package keys in HPC tix files -------------------------------------+------------------------------------- Reporter: mgsloan | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Code Coverage | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): -------------------------------------+------------------------------------- Description changed by mgsloan: Old description:
With GHC 7.10.2, HPC module names are stored in the format "package_key/Module.Name", rather than "package_id/Module.Name". In stack, we restrict the coverage results to just the library modules by using the "--include" flag. For GHC 7.10, this means I need to ask ghc- pkg what the package key is in order to figure out what to pass in for " --include" (see this issue: https://github.com/commercialhaskell/stack/issues/785).
I thought this was done correctly, but now I'm seeing some cases where coverage is reporting (0/0) due to the wrong package key being passed in... I think I need to run the ghc-pkg query with the package's ipid rather than name.. So, I need to have the correct ipid somewhere, in order to run ghc-pkg describe, parse its results to find out what the package key is, and then finally pass this in as a CLI argument. The hpc program's CLI is already woefully error-prone (see https://ghc.haskell.org/trac/ghc/ticket/10951), but this makes it plain hellish.
Is there a better way to do what I need to do here?
I think the right approach to resolving this is to put the full ipid in the HPC files. Then, the hpc program should be modified to allow "-- include" argument to take multiple package identification formats - ipid, package identifier, or package name.
If the full package name was included, I could at least do some custom tix file munging based on just the package name. As things stand, the only way I can meaningfully operate on tix files is if I have the correct package key.
New description: With GHC 7.10.2, HPC module names are stored in the format "package_key/Module.Name", rather than "package_id/Module.Name". In stack, we restrict the coverage results to just the library modules by using the "--include" flag. For GHC 7.10, this means I need to ask ghc- pkg what the package key is in order to figure out what to pass in for "-- include" (see this issue: https://github.com/commercialhaskell/stack/issues/785). I thought this was done correctly, but now I'm seeing some cases where coverage is reporting (0/0) due to the wrong package key being passed in... I think I need to run the ghc-pkg query with the package's ipid rather than name.. So, I need to have the correct ipid somewhere, in order to run ghc-pkg describe, parse its results to find out what the package key is, and then finally pass this in as a CLI argument. The hpc program's CLI is already woefully error-prone (see https://ghc.haskell.org/trac/ghc/ticket/10951), but this makes it plain hellish. Is there a better way to do what I need to do here? I think the right approach to resolving this is to put the full ipid in the HPC files. Then, the hpc program should be modified to allow "-- include" argument to take multiple package identification formats - ipid, package identifier, or package name. This should also make it possible to remove the explici If the full package name was included, I could at least do some custom tix file munging based on just the package name. As things stand, the only way I can meaningfully operate on tix files is if I have the correct package key. There isn't enough information in the files to perform operations based on package name. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10952#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler