Skip to content

Error reporting is worse/missing under ghc 9.12.2 (compared to 9.10.3) #855

@mfussenegger

Description

@mfussenegger

Hi - thanks for your work on shake. I noticed that the error reporting degraded somewhat under ghc 9.12.2:

In a Example.hs like:

#!/usr/bin/env cabal
{- cabal:
build-depends:
    base
  , shake
-}

import Development.Shake

main :: IO ()
main = shakeArgs shakeOptions $ do
  want ["foo.txt"]

  "*.txt" %> \out -> do
    pure ()

Running this with ghc 9.10.3:

~
❮ ghcup set ghc 9.10.3
[ Info  ] GHC 9.10.3 successfully set as default version

Gives a helpful error message:

~
↪  ./Example.hs
Error when running Shake build system:
  at want, called at /path/to/Example.hs:14:3 in fake-package-0-inplace-script-Example.hs:Main
* Depends on: foo.txt
  at error, called at src/Development/Shake/Internal/Rules/File.hs:179:58 in shake-0.19.8-488b5a5cc87df829ac1c6a3ebfeceebc03fee9a278623f5d982bfc78c9b4a532:Development.Shake.Internal.Rules.File
* Raised the exception:
Error, rule finished running but did not produce file:
  foo.txt

But with ghc 9.12.2:

ghcup set ghc 9.12.2

It returns:

cabal-script-Example.hs: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:

ErrorCallWithLocation has been deprecated in favour of ErrorCall (which does not have a location). Backtraces are now handled by the backtrace exception mechanisms exclusively.

HasCallStack backtrace:
  error, called at libraries/ghc-internal/src/GHC/Internal/Exception.hs:184:68 in ghc-internal:GHC.Internal.Exception

Update: Looks like there were already some commits related to this (fc82eee). Is only a release missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions