Skip to content

Commit

Permalink
Use the hie-bios function that doesn't perform a downsweep. Fixes #99 (
Browse files Browse the repository at this point in the history
  • Loading branch information
ndmitchell authored and cocreature committed Sep 20, 2019
1 parent 06bde2b commit 50e35f0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions exe/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Data.Maybe
import Data.List.Extra
import System.FilePath
import Control.Concurrent.Extra
import Control.Exception
import Control.Monad.Extra
import Data.Default
import System.Time.Extra
Expand Down Expand Up @@ -41,7 +42,6 @@ import GHC hiding (def)
import qualified GHC.Paths

import HIE.Bios
import HIE.Bios.Ghc.Api (initializeFlagsWithCradle)

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

newSession' :: Cradle -> IO HscEnvEq
newSession' cradle = getLibdir >>= \libdir -> do
newSession' cradle = do
opts <- either throwIO return =<< getCompilerOptions "" cradle
libdir <- getLibdir
env <- runGhc (Just libdir) $ do
initializeFlagsWithCradle "" cradle
_targets <- initSession opts
getSession
initDynLinker env
newHscEnvEq env
Expand Down

0 comments on commit 50e35f0

Please sign in to comment.