Zubin pushed to branch wip/9.10.3-backports at Glasgow Haskell Compiler / GHC Commits: 4d4269b6 by Zubin Duggal at 2025-07-23T20:29:51+05:30 In commit "Don't cache solved [W] HasCallStack constraints" (256ac29c8df4f17a1d50ea243408d506ebf395d6), we attempt to use `tryM` to avoid errors when looking up certain known-key names like CallStack while compiling ghc-prim and ghc-internal. Unfortunately, `tryM` doesn't catch module lookup errors. This manifests as a failure to build ghc-prim in `--make` mode on the GHC 9.10 branch. Instead, we explicitly avoid doing lookups when we are compiling ghc-prim or ghc-internal instead of relying on catching the exception. - - - - - 1 changed file: - compiler/GHC/Tc/Solver/Monad.hs Changes: ===================================== compiler/GHC/Tc/Solver/Monad.hs ===================================== @@ -178,7 +178,7 @@ import GHC.Types.Var.Set import GHC.Types.Unique.Supply import GHC.Types.Unique.Set( elementOfUniqSet ) -import GHC.Unit.Module ( HasModule, getModule, extractModule ) +import GHC.Unit.Module ( HasModule, getModule, extractModule, primUnit, moduleUnit, ghcInternalUnit) import qualified GHC.Rename.Env as TcM import GHC.Utils.Outputable @@ -508,7 +508,11 @@ updSolvedDicts what dict_ct@(DictCt { di_cls = cls, di_tys = tys, di_ev = ev }) -- See Note [Using isCallStackTy in mentionsIP]. is_tyConTy :: (Type -> Bool) -> Name -> TcS (Type -> Bool) is_tyConTy is_eq tc_name - = do { (mb_tc, _) <- wrapTcS $ TcM.tryTc $ TcM.tcLookupTyCon tc_name + = do { mb_tc <- wrapTcS $ do + mod <- tcg_mod <$> TcM.getGblEnv + if moduleUnit mod `elem` [primUnit, ghcInternalUnit] + then return Nothing + else Just <$> TcM.tcLookupTyCon tc_name ; case mb_tc of Just tc -> return $ \ ty -> not (typesAreApart ty (mkTyConTy tc)) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4d4269b65f3ab1291b8de42486738b41... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/4d4269b65f3ab1291b8de42486738b41... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Zubin (@wz1000)