Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit 72d82e5

Browse files
mpickeringalexbiehl
authored andcommitted
Load plugins when starting a GHC session (#905)
Fixes #900
1 parent c9d918d commit 72d82e5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

haddock-api/src/Haddock.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ import Packages
7575
import Panic (handleGhcException)
7676
import Module
7777
import FastString
78+
import qualified DynamicLoading
7879

7980
--------------------------------------------------------------------------------
8081
-- * Exception handling
@@ -448,7 +449,10 @@ withGhc' libDir flags ghcActs = runGhc (Just libDir) $ do
448449
-- that may need to be re-linked: Haddock doesn't do any
449450
-- dynamic or static linking at all!
450451
_ <- setSessionDynFlags dynflags''
451-
ghcActs dynflags''
452+
hscenv <- GHC.getSession
453+
dynflags''' <- liftIO (DynamicLoading.initializePlugins hscenv dynflags'')
454+
_ <- setSessionDynFlags dynflags'''
455+
ghcActs dynflags'''
452456
where
453457

454458
-- ignore sublists of flags that start with "+RTS" and end in "-RTS"

0 commit comments

Comments
 (0)