Closed fendor closed 3 years ago
Pinging @hvr. Historically, when I brought this fact up, it was brushed off as "Not Cabal's Problem", because it is primarily due to the way HPC produces garbage and doesn't clean up after itself. I tend to agree, but I think until HPC gets its ducks in a row, Cabal should handle the cleanup and teardown when it creates coverage reports.
I would welcome PR's that help with this, and PR's that improve the general state of Coverage as Cabal handles it in general.
Sounds like hpc needs some love.
It really does. It has no owner currently, and it's becoming bitrotten as a result. If you know anyone with free bandwidth to spare, hit up @bgamari or someone else on the GHC team and perhaps they can bring that person up to speed.
I feel it is even worse than reported here; in particular, I can induce this problem without any reference to profiling, e.g., cabal run cabal-testsuite:cabal-tests -- --with-cabal $(cabal list-bin cabal-install:cabal) cabal-testsuite/PackageTests/Backpack/T6385/cabal.test.hs
, rebuild cabal-install, and then run it again.
Now I understand why README.md say to use cabal install --project-file=cabal.project.release cabal-install
. But requiring all cabal devs to specify the project file on each command is definitely too much.
Is fixed (or work-arounded) by #7421
This is due to an (in my opinion) anti-feature of hpc: At program startup it tries to read in the .tix file and accumulates coverage information across multiple runs. This behaviour is documented in the hpc user guide:
The program may be run multiple times (e.g. with different test data), and the coverage data from the separate runs is accumulated in the .tix file. To reset the coverage data and start again, just remove the .tix file. You can control where the .tix file is generated using the environment variable HPCTIXFILE.
I just stumbled upon this problem myself. See https://gitlab.haskell.org/ghc/ghc/-/issues/23955
Describe the bug Executing the test-suite via
cabal run unit-tests
incabal-install
sub-directory works fine on the first run. After changing the test-suite, followed by executing the tests again the following error is thrown:To Reproduce Steps to reproduce the behavior:
Expected behavior Should not crash
System information
Linux archlinux 5.11.16-arch1-1 #1 SMP PREEMPT Wed, 21 Apr 2021 17:22:13 +0000 x86_64 GNU/Linux
cabal 3.4.0.0
installed via ghcupghc 8.10.2
installed via ghcup