Skip to content

panic! (the 'impossible' happened) when building haskhol-core with 9.6.2

Summary

Fails with GHCs 9.6.2 and 9.4.5. Works with 9.2.8 though.

Resolving dependencies...
Build profile: -w ghc-9.6.2 -O1
In order, the following will be built (use -v for more details):
 - haskhol-core-1.3.0 (lib) (configuration changed)
Warning: HaskHOL-Core.cabal:12:22: Packages with 'cabal-version: 1.12' or
later should specify a specific version of the Cabal spec of the form
'cabal-version: x.y'. Use 'cabal-version: 1.22'.
Configuring library for haskhol-core-1.3.0..
Preprocessing library for haskhol-core-1.3.0..
Building library for haskhol-core-1.3.0..
[ 4 of 24] Compiling HaskHOL.Core.Kernel.Types

<no location info>: error:
    panic! (the 'impossible' happened)
  GHC version 9.6.2:
	lookupIdSubst
  x_i8PE
  InScope {wild_00 tyorda_a7l5 alphavars_a7l6 tyordas_a7l7
           $dMonad_a7Yf $dMonadCatch_a7YB $dMonadThrow_a7YT $cvalidSubst_a8fp
           $cvalidSubst_a8fE $cvalidSubst_a8fT $krep_a8ib $krep_a8ic
           $krep_a8id $krep_a8ie $krep_a8if $krep_a8ig $krep_a8ih $krep_a8ii
           $krep_a8ij $krep_a8ik $krep_a8il $krep_a8im $krep_a8in $krep_a8io
           a_i8Ho ds_i8Hp a_i8WW $dEq_i8WX l1_i8WY tyAlphaOrder tyAConv
           isVarType isType mkVarType destVarType destType tyVars catTyVars
           typeSubst typeSubstFull typeTypeSubst tyBool tyBottom tyA tyB
           destFunTy typeOf isTypeOpVar newPrimitiveTypeOp mkTypeOpVar
           destTypeOp tyOpBool tyOpBottom tyOpFun tyApp typeOpVars
           catTypeOpVars typeOpSubst typeOpInst isUType isSmall mkUType
           mkUTypes uTypeFromTypeOpVar mkSmall destUType destUTypes
           containsUType variantTyVar variantTyVars initTypeConstants
           typeMatch $tcTypeSubst $tc'C:TypeSubst $fTypeSubstTypeOpHOLType
           $fTypeSubstTypeOpTypeOp $fTypeSubstHOLTypeHOLType $mTyOpFun
           $mTyOpBool $mTyB $mTyA $mTyFun $m:-> $mTyBool $trModule
           $trModule_s8HR $trModule_s8HS $trModule_s8HT $trModule_s8HU
           $krep_s8HV $krep_s8HW $krep_s8HX $krep_s8HY $krep_s8HZ
           $tcTypeSubst_s8I0 $tcTypeSubst_s8I1 $krep_s8I2 $krep_s8I3
           $tc'C:TypeSubst_s8I4 $tc'C:TypeSubst_s8I5 tyOpFun_s8IS tyOpFun_s8IT
           tyOpBottom_s8Ja tyOpBottom_s8Jb tyOpBool_s8Jc tyOpBool_s8Jd
           tyB_s8LQ tyA_s8LR catTypeOpVars_s8Xb}
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/GHC/Utils/Panic.hs:189:37 in ghc:GHC.Utils.Panic
        pprPanic, called at compiler/GHC/Core/Subst.hs:197:17 in ghc:GHC.Core.Subst
  CallStack (from HasCallStack):
    panic, called at compiler/GHC/Utils/Error.hs:454:29 in ghc:GHC.Utils.Error


Please report this as a GHC bug:  https://www.haskell.org/ghc/reportabug

Error: cabal: Failed to build haskhol-core-1.3.0.

Steps to reproduce

Download from github as Hackage version is likely outdated.

  • git clone https://github.com/ecaustin/haskhol-core
  • cd haskhol-core
  • cabal build

Expected behavior

Package builds without internal errors. May fail to build due to real errors though, haven't checked fully.

Environment

  • GHC version used:

9.6.2, 9.4.5

  • Operating System: Linux
  • System Architecture: amd64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information