[GHC] #9619: HPC Code Coverage complains when two exactly the same mix files are on the path

#9619: HPC Code Coverage complains when two exactly the same mix files are on the path -------------------------------------+------------------------------------- Reporter: Kasper | Owner: Type: bug | Status: new Priority: lowest | Milestone: Component: Code Coverage | Version: 7.8.3 Keywords: | Operating System: Linux Architecture: x86_64 (amd64) | Type of failure: Incorrect Difficulty: Unknown | result at runtime Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Cabal's --enable-library-coverage flag generates the .mix files in the dist/mix directory that cabal creates during compilation. I have two test suites, integration tests and unit tests. Those test suites calll tests for moduleA in moduleATest. Unfortunately, in a first version, the integration tests and unit tests for moduleA were both present in moduleATest. Therefore, the unit test suite (in UnitTests.hs) and the integration test suite (in IntegrationTests.hs) both 'use' the moduleATest by linking in tests from that module. This leads to cabal generating a directory integration-tests and a directory unit-tests with .mix files, but the moduleATest.mix file is present in both directories. When performing hpc sum and hpc markup to get the total result of the test runs I need to specify the directories where the mix files are present (so dist/hpc/mix/unit-tests and dist/hpc/mix/integration-tests) and it will then complain that it finds moduleATest.mix file twice. This issue is not present when using the -fhpc flag, as the directory structure with integration-tests and unit-tests is not present in the .hpc directory at that moment. That being said, I don't think it's a cabal issue as it's more or less expected what they're doing, generating the mix files necessary to instrument integration-tests and unit-tests separately. Priority put to lowest because I can work around it by diving moduleATest up in moduleATest and moduleAIntegrationTest, which is saner in the end anyway. But I guess somebody will come up with a use case where a split up isn't possible, in the future. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9619 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9619: HPC Code Coverage complains when two exactly the same mix files are on the path -------------------------------------+------------------------------------- Reporter: Kasper | Owner: Type: bug | Status: new Priority: lowest | Milestone: Component: Code | Version: 7.8.3 Coverage | Keywords: Resolution: | Architecture: x86_64 (amd64) Operating System: Linux | Difficulty: Unknown Type of failure: Incorrect | Blocked By: result at runtime | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by thomie): Thank you for the report. Could you add attach the files needed to reproduce the problem, with instructions on how to run them, and the current and expected output. Please note that hpc hasn't seen any updates in a long time, so it might take a while for someone to take a look. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9619#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9619: HPC Code Coverage complains when two exactly the same mix files are on the
path
-------------------------------------+-------------------------------------
Reporter: Kasper | Owner:
Type: bug | Status: infoneeded
Priority: lowest | Milestone:
Component: Code Coverage | Version: 7.8.3
Resolution: | Keywords:
Operating System: Linux | Architecture: x86_64
Type of failure: Incorrect result | (amd64)
at runtime | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Changes (by thomie):
* status: new => infoneeded
Comment:
@Kasper: I need your help here. I can't reproduce your problem.
Here's what I've tried. Source code:
{{{
cat > ./T9619.cabal <

#9619: HPC Code Coverage complains when two exactly the same mix files are on the path -------------------------------------+------------------------------------- Reporter: Kasper | Owner: Type: bug | Status: infoneeded Priority: lowest | Milestone: Component: Code Coverage | Version: 7.8.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thomie): Ok, it's not `hpc sum` that fails, only `hpc markup`: {{{ $ hpc markup dist/hpc/vanilla/tix/IntegrationTests/IntegrationTests.tix --hpcdir=dist/hpc/vanilla/mix/IntegrationTests/ --hpcdir=dist/hpc/vanilla/mix/UnitTests/ hpc: found 2 instances of ModuleATest in ["./.hpc","./dist/hpc/vanilla/mix/UnitTests/","./dist/hpc/vanilla/mix/IntegrationTests/"] }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9619#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9619: HPC Code Coverage complains when two exactly the same mix files are on the path -------------------------------------+------------------------------------- Reporter: Kasper | Owner: Type: bug | Status: infoneeded Priority: lowest | Milestone: Component: Code Coverage | Version: 7.8.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by Kasper): Ok, sorry, bad bug report, I did indeed do a combination of hcp markup and hpc sum. I moved away from this approach right now, so I don't really have the problem anymore, clarification might have been very difficult. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9619#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9619: HPC Code Coverage complains when two exactly the same mix files are on the path -------------------------------------+------------------------------------- Reporter: Kasper | Owner: Type: bug | Status: patch Priority: lowest | Milestone: 7.12.1 Component: Code Coverage | Version: 7.8.3 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: Phab:D704 -------------------------------------+------------------------------------- Changes (by thomie): * status: infoneeded => patch * differential: => Phab:D704 * milestone: => 7.12.1 Comment: A potential fix can be found here (pending validation): https://github.com/ghc/packages-hpc/tree/wip/T9619 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9619#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9619: HPC Code Coverage complains when two exactly the same mix files are on the
path
-------------------------------------+-------------------------------------
Reporter: Kasper | Owner:
Type: bug | Status: patch
Priority: lowest | Milestone: 7.12.1
Component: Code Coverage | Version: 7.8.3
Resolution: | Keywords:
Operating System: Linux | Architecture: x86_64
Type of failure: Incorrect result | (amd64)
at runtime | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions: Phab:D704
-------------------------------------+-------------------------------------
Comment (by Thomas Miedema

#9619: HPC Code Coverage complains when two exactly the same mix files are on the path -------------------------------------+------------------------------------- Reporter: Kasper | Owner: Type: bug | Status: closed Priority: lowest | Milestone: 7.12.1 Component: Code Coverage | Version: 7.8.3 Resolution: fixed | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | libraries/hpc/tests/simple/tixs/T9619 Related Tickets: | Blocking: | Differential Revisions: Phab:D704 -------------------------------------+------------------------------------- Changes (by thomie): * status: patch => closed * testcase: => libraries/hpc/tests/simple/tixs/T9619 * resolution: => fixed Comment: This will be fixed in 7.12. The relevant commit in the hpc library: https://github.com/ghc/packages- hpc/commit/f601495ac5f93f24cbcaa95f45b1bc26ad644ac9 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9619#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9619: HPC Code Coverage complains when two exactly the same mix files are on the path -------------------------------------+------------------------------------- Reporter: Kasper | Owner: Type: bug | Status: merge Priority: lowest | Milestone: 7.10.1 Component: Code Coverage | Version: 7.8.3 Resolution: fixed | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | libraries/hpc/tests/simple/tixs/T9619 Related Tickets: | Blocking: | Differential Revisions: Phab:D704 -------------------------------------+------------------------------------- Changes (by hvr): * status: closed => merge * milestone: 7.12.1 => 7.10.1 Comment: Since this landed into GHC HEAD a bit too soon, we're gonna have to cherry pick this into 7.10 to avoid git branching in the hpc submodule :-/ -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9619#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9619: HPC Code Coverage complains when two exactly the same mix files are on the path -------------------------------------+------------------------------------- Reporter: Kasper | Owner: Type: bug | Status: closed Priority: lowest | Milestone: 7.10.1 Component: Code Coverage | Version: 7.8.3 Resolution: fixed | Keywords: Operating System: Linux | Architecture: x86_64 Type of failure: Incorrect result | (amd64) at runtime | Test Case: Blocked By: | libraries/hpc/tests/simple/tixs/T9619 Related Tickets: | Blocking: | Differential Revisions: Phab:D704 -------------------------------------+------------------------------------- Changes (by hvr): * status: merge => closed Comment: merged to GHC 7.10 via 029a296a770addbd096bbfd6de0936327ee620d4 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9619#comment:9 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC