diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2022-09-27 16:56:37 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-12-09 20:15:45 -0500 |
commit | 5949d927a47d14b694a61f68608b68553b5e0c5c (patch) | |
tree | 3bd8015accb3cb88b4cc708d7aba01d199ff6cef | |
parent | 8acb5b7be6244d1f0a91ebba4405bae935d8560c (diff) | |
download | haskell-5949d927a47d14b694a61f68608b68553b5e0c5c.tar.gz |
driver: Set correct UnitId when rehydrating modules
We were not setting the UnitId before rehydrating modules which just led
to us attempting to find things in the wrong HPT. The test for this is
the hadrian-multi command (which is now added as a CI job).
Fixes #22222
-rw-r--r-- | compiler/GHC/Driver/Make.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/GHC/Driver/Make.hs b/compiler/GHC/Driver/Make.hs index 53d8040c9c..25e2bdad9e 100644 --- a/compiler/GHC/Driver/Make.hs +++ b/compiler/GHC/Driver/Make.hs @@ -1161,9 +1161,10 @@ interpretBuildPlan hug mhmi_cache old_hpt plan = do hug_var <- gets hug_var !build_map <- getBuildMap res_var <- liftIO newEmptyMVar - let + let loop_unit :: UnitId + !loop_unit = nodeKeyUnitId (gwib_mod (head deps)) !build_deps = getDependencies (map gwib_mod deps) build_map - let loop_action = do + let loop_action = withCurrentUnit loop_unit $ do (hug, tdeps) <- wait_deps_hug hug_var build_deps hsc_env <- asks hsc_env let new_hsc = setHUG hug hsc_env |