Skip to content

Cannot use ThreadId# with CApiFFI

In hashable there is

 foreign import ccall unsafe "rts_getThreadId" getThreadId
     :: ThreadId# -> CInt

code. If ccall is changed to capi, GHC panics:

<no location info>: error:
    panic! (the 'impossible' happened)
  GHC version 9.4.3:
	toCType
  ThreadId#
  Call stack:
      CallStack (from HasCallStack):
        callStackDoc, called at compiler/GHC/Utils/Panic.hs:182:37 in ghc:GHC.Utils.Panic
        pprPanic, called at compiler/GHC/HsToCore/Foreign/Decl.hs:764:17 in ghc:GHC.HsToCore.Foreign.Decl

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

cabal: Failed to build hashable-1.4.1.0 (which is required by
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information