mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-12 02:24:13 +03:00
hie-core exe: initDynLinker (#2555)
The hie-core tests are flaky in stack. They can fail with the following error message ``` hie-core: panic! (the 'impossible' happened)\n (GHC version 8.6.5 for x86_64-unknown-linux): Dynamic linker not initialised Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug ``` Explicitly initializing the dynamic linker at session startup should avoid this issue.
This commit is contained in:
parent
f8985134db
commit
bf7fea4f1d
10
exe/Main.hs
10
exe/Main.hs
@ -25,6 +25,7 @@ import Development.IDE.Types.Logger
|
||||
import qualified Data.Text as T
|
||||
import qualified Data.Text.IO as T
|
||||
import Language.Haskell.LSP.Messages
|
||||
import Linker
|
||||
import Development.IDE.LSP.LanguageServer
|
||||
import System.Directory.Extra as IO
|
||||
import System.Environment
|
||||
@ -125,6 +126,9 @@ showEvent lock (EventFileDiagnostics (toNormalizedFilePath -> file) diags) =
|
||||
showEvent lock e = withLock lock $ print e
|
||||
|
||||
newSession' :: Cradle -> IO HscEnv
|
||||
newSession' cradle = getLibdir >>= \libdir -> runGhc (Just libdir) $ do
|
||||
initializeFlagsWithCradle "" cradle
|
||||
getSession
|
||||
newSession' cradle = getLibdir >>= \libdir -> do
|
||||
env <- runGhc (Just libdir) $ do
|
||||
initializeFlagsWithCradle "" cradle
|
||||
getSession
|
||||
initDynLinker env
|
||||
pure env
|
||||
|
Loading…
Reference in New Issue
Block a user