This repository was archived by the owner on Aug 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,6 @@ import Packages
76
76
import Panic (handleGhcException )
77
77
import Module
78
78
import FastString
79
- import qualified DynamicLoading
80
79
81
80
--------------------------------------------------------------------------------
82
81
-- * Exception handling
@@ -450,10 +449,7 @@ withGhc' libDir flags ghcActs = runGhc (Just libDir) $ do
450
449
-- that may need to be re-linked: Haddock doesn't do any
451
450
-- dynamic or static linking at all!
452
451
_ <- setSessionDynFlags dynflags''
453
- hscenv <- GHC. getSession
454
- dynflags''' <- liftIO (DynamicLoading. initializePlugins hscenv dynflags'')
455
- _ <- setSessionDynFlags dynflags'''
456
- ghcActs dynflags'''
452
+ ghcActs dynflags''
457
453
where
458
454
459
455
-- ignore sublists of flags that start with "+RTS" and end in "-RTS"
Original file line number Diff line number Diff line change @@ -64,6 +64,7 @@ import Name (nameIsFromExternalPackage, nameOccName)
64
64
import OccName (isTcOcc )
65
65
import RdrName (unQualOK , gre_name , globalRdrEnvElts )
66
66
import ErrUtils (withTiming )
67
+ import DynamicLoading (initializePlugins )
67
68
68
69
#if defined(mingw32_HOST_OS)
69
70
import System.IO
@@ -177,7 +178,13 @@ createIfaces verbosity flags instIfaceMap mods = do
177
178
processModule :: Verbosity -> ModSummary -> [Flag ] -> IfaceMap -> InstIfaceMap -> Ghc (Maybe (Interface , ModuleSet ))
178
179
processModule verbosity modsum flags modMap instIfaceMap = do
179
180
out verbosity verbose $ " Checking module " ++ moduleString (ms_mod modsum) ++ " ..."
180
- tm <- {-# SCC "parse/typecheck/load" #-} loadModule =<< typecheckModule =<< parseModule modsum
181
+
182
+ -- Since GHC 8.6, plugins are initialized on a per module basis
183
+ hsc_env' <- getSession
184
+ dynflags' <- liftIO (initializePlugins hsc_env' (GHC. ms_hspp_opts modsum))
185
+ let modsum' = modsum { ms_hspp_opts = dynflags' }
186
+
187
+ tm <- {-# SCC "parse/typecheck/load" #-} loadModule =<< typecheckModule =<< parseModule modsum'
181
188
182
189
if not $ isBootSummary modsum then do
183
190
out verbosity verbose " Creating interface..."
You can’t perform that action at this time.
0 commit comments