on master help sign in
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.

commitbf7fea4f1de3d915877564f560654b2b723ac23e authorAndreas Herrmann <42969706+aherrmann-da@users.noreply.github.com> dateThu 15 Aug 2019, 15:27 (7 years ago) parentf898513
1 file changed+7−3
exe/Main.hs+7−3
exe/Main.hs+7−3
@@ -25,6 +25,7 @@ import Development.IDE.Types.Logger
2525import qualified Data.Text as T
2626import qualified Data.Text.IO as T
2727import Language.Haskell.LSP.Messages
28+import Linker
2829import Development.IDE.LSP.LanguageServer
2930import System.Directory.Extra as IO
3031import System.Environment
@@ -125,6 +126,9 @@ showEvent lock (EventFileDiagnostics (toNormalizedFilePath -> file) diags) =
125126showEvent lock e = withLock lock $ print e
126127
127128newSession' :: Cradle -> IO HscEnv
128−newSession' cradle = getLibdir >>= \libdir -> runGhc (Just libdir) $ do
129− initializeFlagsWithCradle "" cradle
130− getSession
129+newSession' cradle = getLibdir >>= \libdir -> do
130+ env <- runGhc (Just libdir) $ do
131+ initializeFlagsWithCradle "" cradle
132+ getSession
133+ initDynLinker env
134+ pure env