Decoupling hpc-bin from GHC
Through some fortunate circumstances, a group of people found each other who are all interested in revitalizing the development of the hpc (haskell program coverage) ecosystem. We are currently communicating on the #haskell-program-coverage channel on the Haskell Foundation Slack (cf. https://haskell.foundation/contact/). Everyone who is also interested is very welcome to join us there. This issue is about one technical stumbling block, the close coupling of hpc and ghc, which makes developing hpc-bin more complicated than it needs to be.
To make the discussion easier to follow, I propose to use the following terminology:
- hpc-ghc: The parts of the compiler which are responsible for instrumenting Haskell code, and which emit the .tix files upon execution.
- hpc-lib: The library which is responsible for encoding/decoding .tix and .mix files. This library lives in its own gitlab repository here: https://gitlab.haskell.org/ghc/packages/hpc and is published on Hackage.
- hpc-bin: The command line tool which can read in .tix and .mix files and create reports in various formats, such as textual, XML and html. hpc-bin has a dependency on hpc-lib,but it does not have its own repository and is part of the main GHC repository here: https://gitlab.haskell.org/ghc/ghc/-/tree/master/utils/hpc
This concrete issue is mainly about hpc-bin, and about a way forward to make the development of hpc-bin easier for everyone involved. From a technical point of view, hpc-bin is a downstream consumer of ghc. I think it is part of the ghc repository for historical reasons, mainly that ghc always maintained all kinds of small utilities (hp2ps etc.) itself.
Development of hpc-bin is strictly coupled to the development of ghc due to the fact that it lives within the ghc repository: They share the issue tracker, merge requests, CI infrastructure, documentation (the documentation of hpc-bin is part of the ghc user manual). The only technical reason which supports this choice, I think, is that hpc is distributed with the other haskell tools.
So the two concrete technical points I would like to bring up are the following:
- Would it be possible to create an independent repository for hpc-bin, and include it as a git submodule in the ghc tree. (Similarly to how haddock, for example, is included as a git submodule).
- Does the documentation of hpc-bin have to live within the ghc user manual? For example, if we add a feature to generate coverall reports from the hpc binary, it will then probably only be documented in the most current version of the ghc user manual, even though the feature is more or less completely independent from the ghc version used to generate the .tix files.