Skip to content

Wrong error message for TH when GHCi is not enabled

A user reported this confusing error message:

Data/FileEmbed.hs:69:15:
    Template Haskell bracket illegal in a stage-1 compiler
      [| stringToBs |]

The compiler was not stage-1, but:

ghc --info
 [("Project name","The Glorious Glasgow Haskell Compilation System")
 ,("Project version","7.0.4")
 ,("Booter version","7.0.4")
 ,("Stage","2")
 ,("Build platform","powerpc-unknown-linux")
 ,("Host platform","powerpc-unknown-linux")
 ,("Target platform","powerpc-unknown-linux")
 ,("Have interpreter","NO")
 ,("Object splitting","YES")
 ,("Have native code generator","YES")
 ,("Have llvm code generator","YES")
 ,("Support SMP","YES")
 ,("Unregisterised","NO")
...
 ]

So it looks like the problem is not stage-1, but the fact that ("Have interpreter","NO").

So the error message should report that the Template Haskell extension requires that ghc is built with ghci/interpreter support.

Trac metadata
Trac field Value
Version 7.0.4
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information