File tree 1 file changed +7
-4
lines changed
ghcide/session-loader/Development/IDE
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -525,12 +525,15 @@ cradleToOptsAndLibDir cradle file = do
525
525
526
526
emptyHscEnv :: IORef NameCache -> FilePath -> IO HscEnv
527
527
emptyHscEnv nc libDir = do
528
+ #if MIN_VERSION_ghc(9,0,0)
529
+ -- Without the seemingly redundant `getSessionDynFlags >>= setSessionDynFlags`
530
+ -- the line `initDynLinker env` would crash with the errror:
531
+ -- `Couldn't find a target code interpreter. Try with -fexternal-interpreter`
532
+ env <- runGhc (Just libDir) $ getSessionDynFlags >>= setSessionDynFlags >> getSession
533
+ #else
528
534
env <- runGhc (Just libDir) getSession
529
- #if !MIN_VERSION_ghc(9,0,0)
530
- -- This causes ghc9 to crash with the error:
531
- -- Couldn't find a target code interpreter. Try with -fexternal-interpreter
532
- initDynLinker env
533
535
#endif
536
+ initDynLinker env
534
537
pure $ setNameCache nc env{ hsc_dflags = (hsc_dflags env){useUnicode = True } }
535
538
536
539
data TargetDetails = TargetDetails
You can’t perform that action at this time.
0 commit comments