on master help sign in
Use the hie-bios function that doesn't perform a downsweep. Fixes #99 (#102)
commit50e35f0e98241b9cbe0f716ee16c5c5871599ae1 authorNeil Mitchell <ndmitchell@gmail.com> dateFri 20 Sep 2019, 16:33 (7 years ago) parent06bde2b
1 file changed+5−3
exe/Main.hs+5−3
exe/Main.hs+5−3
@@ -9,6 +9,7 @@ import Data.Maybe
99import Data.List.Extra
1010import System.FilePath
1111import Control.Concurrent.Extra
12+import Control.Exception
1213import Control.Monad.Extra
1314import Data.Default
1415import System.Time.Extra
@@ -41,7 +42,6 @@ import GHC hiding (def)
4142import qualified GHC.Paths
4243
4344import HIE.Bios
44−import HIE.Bios.Ghc.Api (initializeFlagsWithCradle)
4545
4646-- Set the GHC libdir to the nix libdir if it's present.
4747getLibdir :: IO FilePath
@@ -130,9 +130,11 @@ showEvent lock (EventFileDiagnostics (toNormalizedFilePath -> file) diags) =
130130showEvent lock e = withLock lock $ print e
131131
132132newSession' :: 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