[GHC] #10529: hpc: Improve error messages in readMix

#10529: hpc: Improve error messages in readMix -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 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: | -------------------------------------+------------------------------------- See https://hackage.haskell.org/package/hpc-0.6.0.2/docs/src/Trace-Hpc- Mix.html#readMix The generic `error $ "can not find " ++ modName ++ " in " ++ show dirNames` error message is used for all kinds of cases, for example when `h == tixModuleHash tix` isn't true. It would be very helpful if the error message could be specific for these cases (e.g. "hashes don't agree") instead of being a catch-all for all `Nothing`s. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10529 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10529: hpc: Improve error messages in readMix -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: patch Priority: normal | Milestone: 7.12.1 Component: Code Coverage | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * status: new => patch Comment: I have a patch here: https://github.com/ghc/packages- hpc/commit/eaf1906f4456765becd3b52dee0188750feab2bf The error messages would look like this now: {{{ hpc: can not parse ./.hpc/NoParse.mix hpc: hash in .tix file does not match hash in ./.hpc/Main.mix hpc: can not find NonExistingModule in ["./.hpc"] }}} nh2: does that look alright to you? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10529#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10529: hpc: Improve error messages in readMix -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: patch Priority: normal | Milestone: 7.12.1 Component: Code Coverage | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by nh2): @thomie, yes that looks good to me. The only thing I'd change is adding more detail to the error message, e.g. mentioning the `modName` and what the values of the two hashes are that aren't matching - that makes it much easier to debug what's wrong when something is wrong. I'll also add a comment on Github for this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10529#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10529: hpc: Improve error messages in readMix -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: patch Priority: normal | Milestone: 7.12.1 Component: Code Coverage | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thomie): Updated patch: https://github.com/ghc/packages- hpc/commit/6b88e91c8a0e7806d44d999616983c60a0b8eb78 Now you'll get something like this: {{{ hpc: hash in tix file for module Main (1234567890) does not match hash in ./.hpc/Main.mix (2454134535) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10529#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10529: hpc: Improve error messages in readMix -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: patch Priority: normal | Milestone: 7.12.1 Component: Code Coverage | Version: 7.10.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by nh2): Yes that looks great to me! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10529#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10529: hpc: Improve error messages in readMix -------------------------------------+------------------------------------- Reporter: nh2 | Owner: Type: bug | Status: closed Priority: normal | Milestone: 7.12.1 Component: Code Coverage | Version: 7.10.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | simple/tixs/T10529{a,b,c} | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * status: patch => closed * testcase: => simple/tixs/T10529{a,b,c} * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10529#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10529: hpc: Improve error messages in readMix
-------------------------------------+-------------------------------------
Reporter: nh2 | Owner:
Type: bug | Status: closed
Priority: normal | Milestone: 7.12.1
Component: Code Coverage | Version: 7.10.1
Resolution: fixed | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
| simple/tixs/T10529{a,b,c}
Blocked By: | Blocking:
Related Tickets: | Differential Revisions:
-------------------------------------+-------------------------------------
Comment (by Thomas Miedema
participants (1)
-
GHC