Allow building with GHC 9.12 - #1828
Conversation
XXX: ideally we wouldn't need to do this
Fixes build problem with recent Data.Text.
|
There's a rather scary-looking error when compiling This appears to be a GHC bug, and one that is exclusive to GHC 9.12. I've opened https://gitlab.haskell.org/ghc/ghc/-/issues/27261 to track this. Thus far, the only workaround that I've discovered is to ensure that the calls to diff --git a/crucible-mir/src/Mir/Trans.hs b/crucible-mir/src/Mir/Trans.hs
index a0bb1125b..93748cb51 100644
--- a/crucible-mir/src/Mir/Trans.hs
+++ b/crucible-mir/src/Mir/Trans.hs
@@ -1300,8 +1300,8 @@ mkTraitObject :: forall h s ret.
MirExp s ->
MirGenerator h s ret (MirExp s)
mkTraitObject traitName' vtableName e = do
- handles <- Maybe.fromMaybe (error $ "missing vtable handles for " ++ show vtableName) <$>
- use (cs . vtableMap . at vtableName)
+ mbHandles <- use (cs . vtableMap . at vtableName)
+ let handles = Maybe.fromMaybe (error $ "missing vtable handles for " ++ show vtableName) mbHandles
col <- use $ cs . collection
vtable <- case col ^. vtables . at vtableName of
@@ -1323,9 +1323,10 @@ mkTraitObject traitName' vtableName e = do
-- trait. A mismatch would cause runtime errors at calls to trait methods.
trait <- Maybe.fromMaybe (error $ "unknown trait " ++ show traitName') <$>
use (cs . collection . M.traits . at traitName')
- Some vtableTy' <- case traitVtableType col trait of
- Left err -> error ("mkTraitObject: " ++ err)
- Right x -> return x
+ let someVtableTy' = case traitVtableType col trait of
+ Left err -> error ("mkTraitObject: " ++ err)
+ Right x -> x
+ Some vtableTy' <- pure someVtableTy'
case testEquality vtableTy vtableTy' of
Just _ -> return ()
Nothing -> error $ unwords |
| -- there is no ring-buffer that permits GHC 9.12's base version | ||
| -- and boomerang doesn't permit GHC 9.12's template-haskell | ||
| allow-newer: ring-buffer:base | ||
| allow-newer: boomerang:template-haskell |
There was a problem hiding this comment.
I generally like to file issues on the upstream repos and link to them in these comments to make it easier to track whether or not we can remove the allow-newers.
There was a problem hiding this comment.
That is a good idea, I will make sure that gets done if we still need them by the time this gets merged.
|
DetailsAs far as I can tell, this is a regression in GHC's typechecker, which I have reported upstream at https://gitlab.haskell.org/ghc/ghc/-/issues/27262. A workaround is to enable |
This isn't working yet