Skip to content

Commit b725852

Browse files
committed
check if the old default is usable.
1 parent 619d21c commit b725852

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/fsharp/fsi/fsi.fs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2360,7 +2360,13 @@ type FsiEvaluationSession (fsiConfig: FsiEvaluationSessionHostConfig, argv:strin
23602360
#endif
23612361
// When used as part of FCS we cannot assume the current process is fsi.exe
23622362
// So we try to fallback to the default compiler dir.
2363-
let defaultFSharpBinariesDir = Internal.Utilities.FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(None).Value
2363+
let defaultFSharpBinariesDir =
2364+
let containsRequiredFiles =
2365+
[ "FSharp.Core.dll"; "FSharp.Core.sigdata"; "FSharp.Core.optdata" ]
2366+
|> Seq.map (fun file -> Path.Combine(defaultFSharpBinariesDir, file))
2367+
|> Seq.forall Internal.Utilities.FSharpEnvironment.safeExists
2368+
if containsRequiredFiles then defaultFSharpBinariesDir
2369+
else Internal.Utilities.FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(None).Value
23642370

23652371
let tcConfigB = Build.TcConfigBuilder.CreateNew(defaultFSharpBinariesDir,
23662372
true, // long running: optimizeForMemory

0 commit comments

Comments
 (0)