GHC error in desugarer lookup in CLaSH.Core.TyCon: Can't find interface-file declaration for variable $tcType Probable cause: bug in .hi-boot file, or inconsistent .hi file Use -ddump-if-trace to get an idea of which file caused the error ghc: panic! (the 'impossible' happened) (GHC version 8.0.0.20160411 for x86_64-unknown-linux): initDs IOEnv failure Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
I'm terribly sorry that the current instructions for reproducing the bug are to build my project and all its dependencies. I'm having a lot of trouble reducing the bug to a sensible/small test case, so any hints as to what might be the cause of this bug would be helpful.
Trac metadata
Trac field
Value
Version
8.0.1-rc3
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
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
The output of the ddump-if-trace is now much shorter:
ghci CLaSH/Core/Type.hsGHCi, version 8.0.0.20160411: http://www.haskell.org/ghc/ :? for help[1 of 4] Compiling Unbound.Generics.LocallyNameless ( Unbound/Generics/LocallyNameless.hs, interpreted )[2 of 4] Compiling CLaSH.Core.Type[boot] ( CLaSH/Core/Type.hs-boot, interpreted )[3 of 4] Compiling CLaSH.Core.TyCon ( CLaSH/Core/TyCon.hs, interpreted )loadHiBootInterface CLaSH.Core.TyConConsidering whether to load PreludeConsidering whether to load GHC.GenericsConsidering whether to load Unbound.Generics.LocallyNamelessConsidering whether to load CLaSH.Core.Type {- SOURCE -}updating EPS_Considering whether to load GHC.Base {- SYSTEM -}Considering whether to load GHC.Float {- SYSTEM -}newGlobalBinder CLaSH.Core.TyCon AlgTyConRhs CLaSH/Core/TyCon.hs:(13,1)-(15,26) AlgTyConRhsnewGlobalBinder CLaSH.Core.TyCon NewTyCon CLaSH/Core/TyCon.hs:14:5-19 NewTyConConsidering whether to load GHC.Generics {- SYSTEM -}Considering whether to load Unbound.Generics.LocallyNameless {- SYSTEM -}Considering whether to load CLaSH.Core.Type {- SYSTEM -}newGlobalBinder CLaSH.Core.TyCon $tc'NewTyCon <no location info> $tc'NewTyConnewGlobalBinder CLaSH.Core.TyCon $WNewTyCon CLaSH/Core/TyCon.hs:14:5-19 $WNewTyConnewGlobalBinder CLaSH.Core.TyCon NewTyCon CLaSH/Core/TyCon.hs:14:5-19 NewTyConbuildDataCon 1 NewTyConbuildDataCon 2 NewTyConnewGlobalBinder CLaSH.Core.TyCon $tcAlgTyConRhs <no location info> $tcAlgTyConRhsnewGlobalBinder CLaSH.Core.TyCon $fGenericAlgTyConRhs CLaSH/Core/TyCon.hs:15:13-19 $fGenericAlgTyConRhsnewGlobalBinder CLaSH.Core.TyCon $fAlphaAlgTyConRhs CLaSH/Core/TyCon.hs:15:21-25 $fAlphaAlgTyConRhsnewGlobalBinder CLaSH.Core.TyCon Rep_AlgTyConRhs CLaSH/Core/TyCon.hs:(13,1)-(15,26) Rep_AlgTyConRhsnewGlobalBinder CLaSH.Core.TyCon $trModule CLaSH/Core/TyCon.hs:1:1 $trModuleConsidering whether to load GHC.Types {- SYSTEM -}checkWiredInTyCon DoubleCLaSH.Core.TyConConsidering whether to load GHC.Types {- SYSTEM -}Need decl for $tcTypeConsidering whether to load CLaSH.Core.Type {- SYSTEM -}GHC error in desugarer lookup in CLaSH.Core.TyCon: Can't find interface-file declaration for variable $tcType Probable cause: bug in .hi-boot file, or inconsistent .hi file Use -ddump-if-trace to get an idea of which file caused the errorghc: panic! (the 'impossible' happened) (GHC version 8.0.0.20160411 for x86_64-unknown-linux): initDs IOEnv failurePlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug
ghci CLaSH/Core/Type.hsGHCi, version 8.0.0.20160411: http://www.haskell.org/ghc/ :? for help[1 of 4] Compiling Unbound.Generics.LocallyNameless ( Unbound/Generics/LocallyNameless.hs, interpreted )[2 of 4] Compiling CLaSH.Core.Type[boot] ( CLaSH/Core/Type.hs-boot, interpreted )[3 of 4] Compiling CLaSH.Core.TyCon ( CLaSH/Core/TyCon.hs, interpreted )loadHiBootInterface CLaSH.Core.TyConConsidering whether to load PreludeConsidering whether to load Unbound.Generics.LocallyNamelessConsidering whether to load CLaSH.Core.Type {- SOURCE -}updating EPS_Considering whether to load GHC.Base {- SYSTEM -}Considering whether to load GHC.Float {- SYSTEM -}newGlobalBinder CLaSH.Core.TyCon AlgTyConRhs CLaSH/Core/TyCon.hs:(7,1)-(8,19) AlgTyConRhsnewGlobalBinder CLaSH.Core.TyCon NewTyCon CLaSH/Core/TyCon.hs:8:5-19 NewTyConConsidering whether to load Unbound.Generics.LocallyNameless {- SYSTEM -}Considering whether to load CLaSH.Core.Type {- SYSTEM -}Considering whether to load Unbound.Generics.LocallyNameless {- SYSTEM -}Considering whether to load Unbound.Generics.LocallyNameless {- SYSTEM -}newGlobalBinder CLaSH.Core.TyCon $tc'NewTyCon <no location info> $tc'NewTyConnewGlobalBinder CLaSH.Core.TyCon $WNewTyCon CLaSH/Core/TyCon.hs:8:5-19 $WNewTyConnewGlobalBinder CLaSH.Core.TyCon NewTyCon CLaSH/Core/TyCon.hs:8:5-19 NewTyConbuildDataCon 1 NewTyConbuildDataCon 2 NewTyConnewGlobalBinder CLaSH.Core.TyCon $tcAlgTyConRhs <no location info> $tcAlgTyConRhsnewGlobalBinder CLaSH.Core.TyCon $fAlphaAlgTyConRhs CLaSH/Core/TyCon.hs:10:10-26 $fAlphaAlgTyConRhsnewGlobalBinder CLaSH.Core.TyCon $trModule CLaSH/Core/TyCon.hs:1:1 $trModuleNeed decl for $tcTypeConsidering whether to load CLaSH.Core.Type {- SYSTEM -}GHC error in desugarer lookup in CLaSH.Core.TyCon: Can't find interface-file declaration for variable $tcType Probable cause: bug in .hi-boot file, or inconsistent .hi file Use -ddump-if-trace to get an idea of which file caused the errorghc: panic! (the 'impossible' happened) (GHC version 8.0.0.20160411 for x86_64-unknown-linux): initDs IOEnv failurePlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug
It seems to be a combination of the Typeable constraint, and the .hs-boot file. Because when I remove the Typeable constraint from:
instanceTypeablea=>Alpha(Namea)whereisTerm_=False
in Unbound/Generics/LocallyNameless.hs everything compiles successfully.
Hmm, I suspect the issue here is that we are not emitting the TypeableTyCon bindings into hi-boot files. This means things blow up when when the typechecker goes to construct Typeable evidence when only a SOURCE import of the module defining the type in question is in scope.