[GHC] #10502: Bad interaction of sandboxes and coverage

#10502: Bad interaction of sandboxes and coverage -------------------------------------+------------------------------------- Reporter: qnikst | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Code | Version: 7.10.1 Coverage | Operating System: Unknown/Multiple Keywords: | Type of failure: None/Unknown Architecture: | Blocked By: Unknown/Multiple | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- It seems that when using sandboxes with project and coverage (`--enable- coverage`) cabal fails to generate and find .mix files for dependencies. Steps to reproduce: 1. create shared sandbox (not sure that shared sandbox plays it's role here): {{{cabal sandbox init --sandbox=../.shared}}} 2. install all dependencies with enable-coverage {{{cabal install --dependencies-only --enable-coverage --enable-tests}}} 3. install library {{{cabal install --enable-coverage --run-tests}}} Expected results: 1. Library will be built, coverage output will be generated. Actual results: hpc fails to find .mix files: {{{ hpc: can not find netwo_Bdsn6Y1VKLa3MCczwSV70J/Network.Socket.ByteString.MsgHdr in ["./.hpc" ,"./dist/dist-sandbox-f7da581b/hpc/vanilla/mix/network-transport- tcp-0.4.1" ,"./dist/dist-sandbox-f7da581b/hpc/vanilla/mix/TestTCP"] }}} Tested on ghc-7.10.1 in clear official docker container on network- transport-tcp package. Side node: during tests on bigger project I have seen similar failures even on step 2 (e.g. network package fails with similar error message), but I was not able to reproduce it in minimal example. Possibly related report: #10259 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10502 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10502: Bad interaction of sandboxes and coverage -------------------------------------+------------------------------------- Reporter: qnikst | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Code Coverage | Version: 7.10.1 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by rwbarton): * status: new => closed * resolution: => invalid Comment: This is a Cabal issue, not a GHC issue. Cabal does not really support installing packages built with `--enable-coverage`. The installation will succeed, and the libraries themselves work, but Cabal does not install the `.mix` files anywhere, so running hpc on a program that uses the libraries will fail, as you found. You can just omit `--enable-coverage` from the `install --dependencies- only` command to get a coverage report that includes the modules from the library you are testing (here network-transport-tcp). If you really want to get a report of how the network-transport-tcp tests cover the modules in its dependencies, then you need support for this to be added to Cabal. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10502#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC