Zubin pushed to branch wip/no-try-lookup at Glasgow Haskell Compiler / GHC Commits: efe1efed by Zubin Duggal at 2025-07-29T17:00:40+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. (cherry picked from commit 7492d00749488b628139d5c3bd5fa4b33cc2e4ad) - - - - - 1 changed file: - compiler/GHC/Tc/Solver/Monad.hs Changes: ===================================== compiler/GHC/Tc/Solver/Monad.hs ===================================== @@ -557,7 +557,11 @@ updSolvedDicts what dict_ct@(DictCt { di_cls = cls, di_tys = tys, di_ev = ev }) -- See Note [Using isCallStackTy in mightMentionIP]. 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, bignumUnit] + 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/efe1efedca6633a09e6999e25231716f... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/efe1efedca6633a09e6999e25231716f... You're receiving this email because of your account on gitlab.haskell.org.