summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
Diffstat (limited to 'ghc')
-rw-r--r--ghc/GHCi/UI.hs2
-rw-r--r--ghc/Main.hs13
2 files changed, 8 insertions, 7 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs
index 362fe0b40a..58bbf4f6fe 100644
--- a/ghc/GHCi/UI.hs
+++ b/ghc/GHCi/UI.hs
@@ -2041,7 +2041,7 @@ addModule files = do
let dflags = hsc_dflags hsc_env
let fopts = initFinderOpts dflags
result <- liftIO $
- Finder.findImportedModule fc fopts units home_unit m (ThisPkg (homeUnitId home_unit))
+ Finder.findImportedModule fc fopts units (Just home_unit) m (ThisPkg (homeUnitId home_unit))
case result of
Found _ _ -> return True
_ -> (liftIO $ putStrLn $
diff --git a/ghc/Main.hs b/ghc/Main.hs
index 5e6042173f..d00ae72990 100644
--- a/ghc/Main.hs
+++ b/ghc/Main.hs
@@ -43,6 +43,7 @@ import GHCi.UI ( interactiveUI, ghciWelcomeMsg, defaultGhciSettings
import GHC.Runtime.Loader ( loadFrontendPlugin )
+import GHC.Unit.Env
import GHC.Unit.Module ( ModuleName, mkModuleName )
import GHC.Unit.Module.ModIface
import GHC.Unit.State ( pprUnits, pprUnitsSimple )
@@ -872,17 +873,17 @@ abiHash :: [String] -- ^ List of module names
-> Ghc ()
abiHash strs = do
hsc_env <- getSession
- let fc = hsc_FC hsc_env
- let home_unit = hsc_home_unit hsc_env
- let units = hsc_units hsc_env
- let dflags = hsc_dflags hsc_env
- let fopts = initFinderOpts dflags
+ let fc = hsc_FC hsc_env
+ let mhome_unit = ue_home_unit (hsc_unit_env hsc_env)
+ let units = hsc_units hsc_env
+ let dflags = hsc_dflags hsc_env
+ let fopts = initFinderOpts dflags
liftIO $ do
let find_it str = do
let modname = mkModuleName str
- r <- findImportedModule fc fopts units home_unit modname NoPkgQual
+ r <- findImportedModule fc fopts units mhome_unit modname NoPkgQual
case r of
Found _ m -> return m
_error -> throwGhcException $ CmdLineError $ showSDoc dflags $