Skip to content

Commit 50e35f0

Browse files
ndmitchellcocreature
authored andcommitted
Use the hie-bios function that doesn't perform a downsweep. Fixes #99 (#102)
1 parent 06bde2b commit 50e35f0

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

exe/Main.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import Data.Maybe
99
import Data.List.Extra
1010
import System.FilePath
1111
import Control.Concurrent.Extra
12+
import Control.Exception
1213
import Control.Monad.Extra
1314
import Data.Default
1415
import System.Time.Extra
@@ -41,7 +42,6 @@ import GHC hiding (def)
4142
import qualified GHC.Paths
4243

4344
import HIE.Bios
44-
import HIE.Bios.Ghc.Api (initializeFlagsWithCradle)
4545

4646
-- Set the GHC libdir to the nix libdir if it's present.
4747
getLibdir :: IO FilePath
@@ -130,9 +130,11 @@ showEvent lock (EventFileDiagnostics (toNormalizedFilePath -> file) diags) =
130130
showEvent lock e = withLock lock $ print e
131131

132132
newSession' :: Cradle -> IO HscEnvEq
133-
newSession' cradle = getLibdir >>= \libdir -> do
133+
newSession' cradle = do
134+
opts <- either throwIO return =<< getCompilerOptions "" cradle
135+
libdir <- getLibdir
134136
env <- runGhc (Just libdir) $ do
135-
initializeFlagsWithCradle "" cradle
137+
_targets <- initSession opts
136138
getSession
137139
initDynLinker env
138140
newHscEnvEq env

0 commit comments

Comments
 (0)