[GHC] #2991: .tix file generation broken with -fhpc and --make flags with lhs modules (was: .mix files generation broken with -fhpc and --make flags with lhs modules)

GHC ghc-devs at haskell.org
Thu Dec 4 17:39:05 UTC 2014


#2991: .tix file generation broken with -fhpc and --make flags with lhs modules
-------------------------------------+-------------------------------------
              Reporter:  ppavel      |            Owner:  andy@…
                  Type:  bug         |           Status:  new
              Priority:  lowest      |        Milestone:  7.10.1
             Component:  Code        |          Version:  6.10.1
  Coverage                           |         Keywords:  hpc make lhs
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------
Changes (by thomie):

 * failure:   => None/Unknown


Old description:

> assume the project consisting of two files: !Main.lhs and !MyModule.hs.
> Main.lhs imports !MyModule via standard import. Build the project with
>
> ghc --make -fhpc -o main Main.lhs
>
> The generated .mix file contains relevant information and hpc markup
> correctly shows the coverage for !MyModule.
>
> Now rename !MyModule.hs to !MyModule.lhs and enclose the code there in
> \begin{code} / \end{code}. Build again. The compilation still succeeds
> and the executable works fine. But !MyModule.mix now seems wrong and no
> hpc coverage information is available for !MyModule

New description:

 Assume the project consisting of two files: Main.lhs and MyModule.hs.
 Main.lhs imports MyModule via standard import. Build the project with

 ghc --make -fhpc -o main Main.lhs

 The generated .tix file contains relevant information and hpc markup
 correctly shows the coverage for MyModule.

 Now rename MyModule.hs to MyModule.lhs and enclose the code there in
 \begin{code} / \end{code}. Build again. The compilation still succeeds and
 the executable works fine. But main.tix now seems wrong and no hpc
 coverage information is available for MyModule

--

Comment:

 I can reproduce this with HEAD or 7.8.3. Make sure `MyModule.lhs` is not
 empty.
 {{{
 $ cat Main.lhs
 \begin{code}
 import MyModule
 main = return ()
 \end{code}

 $ cat MyModule.lhs
 \begin{code}
 module MyModule where
 foo = undefined
 \end{code}

 $ ghc --make -fhpc -o main Main.lhs
 [1 of 2] Compiling MyModule         ( MyModule.lhs, MyModule.o )
 [2 of 2] Compiling Main             ( Main.lhs, Main.o )
 Linking main ...

 $ ./main

 $ cat main.tix
 Tix [ TixModule "Main" 1204325935 3 [0,1,1], TixModule "MyModule"
 1288191418 0 []]
 }}}

 Notice the `0 []` for "MyModule". That should be `2 [0,0]`.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/2991#comment:13>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list