Opened 9 years ago

Closed 3 years ago

Last modified 2 years ago

#2991 closed bug (fixed)

.tix file generation broken with -fhpc and --make flags with lhs modules

Reported by: ppavel Owned by: andy@…
Priority: lowest Milestone: 8.0.1
Component: Code Coverage Version: 6.10.1
Keywords: hpc make lhs Cc: andygill@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case: hpc/T2991
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D701
Wiki Page:

Description (last modified by thomie)

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

Change History (19)

comment:1 Changed 9 years ago by igloo

difficulty: Unknown
Milestone: 6.10.2

Thanks for the report

comment:2 Changed 9 years ago by simonmar

Cc: andygill@… added

Andy, any chance you could look at this?

comment:3 Changed 9 years ago by igloo

Milestone: 6.10.26.12 branch

comment:4 Changed 8 years ago by igloo

Component: CompilerCode Coverage
Owner: set to andy@…

See also #3191.

comment:5 Changed 7 years ago by igloo

Milestone: 6.12 branch6.12.3

comment:6 Changed 7 years ago by igloo

Milestone: 6.12.36.14.1
Priority: normallow

comment:7 Changed 7 years ago by igloo

Milestone: 7.0.17.0.2

comment:8 Changed 7 years ago by igloo

Milestone: 7.0.27.2.1

comment:9 Changed 6 years ago by igloo

Milestone: 7.2.17.4.1

comment:10 Changed 6 years ago by igloo

Milestone: 7.4.17.6.1
Priority: lowlowest

comment:11 Changed 5 years ago by igloo

Milestone: 7.6.17.6.2

comment:12 Changed 3 years ago by thoughtpolice

Milestone: 7.6.27.10.1

Moving to 7.10.1.

comment:13 Changed 3 years ago by thomie

Description: modified (diff)
Summary: .mix files generation broken with -fhpc and --make flags with lhs modules.tix file generation broken with -fhpc and --make flags with lhs modules
Type of failure: None/Unknown

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].

comment:14 Changed 3 years ago by thoughtpolice

Milestone: 7.10.17.12.1

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:15 Changed 3 years ago by thoughtpolice

Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:16 Changed 3 years ago by thomie

Differential Rev(s): Phab:D701
Status: newpatch
Test Case: hpc/T2991

comment:17 Changed 3 years ago by Thomas Miedema <thomasmiedema@…>

In f9344f3646156a9efff2dcfb90e1d5d67fd4f5a1/ghc:

Fix `ghc --make -fhpc` with imported lhs modules

See Note [Don't normalise input filenames] in
`compiler/main/DriverPipeline.hs`. Fixes #2991.

Reviewers: austin

Differential Revision: https://phabricator.haskell.org/D701

comment:18 Changed 3 years ago by thomie

Resolution: fixed
Status: patchclosed

comment:19 Changed 2 years ago by thoughtpolice

Milestone: 7.12.18.0.1

Milestone renamed

Note: See TracTickets for help on using tickets.