Closed nhirschey closed 3 years ago
Welcome to the FAKE community! Thank you so much for creating your first issue and therefore improving the project!
There has not been any activity in this issue for the last 3 months so it will be closed in 14 days if there is no activity.
still an issue
Update: Actually it seems like the below issue was just because I was using the wrong TargetProfile
I'm also running into this issue. In my case FsiTool.Internal also doesn't work
Starting task 'Fsi ': internal fsi with args ["C:\fsi.exe"; "--load:snap_dataset.fsx"; "--debug:pdbonly";
"--targetprofile:mscorlib"; "--exec"; "--"]
Unhandled exception. Fake.Core.BuildFailedException: Target 'CheckSnapDataset' failed.
---> System.AggregateException: One or more errors occurred. (Error creating evaluation session: StopProcessingExn)
---> System.Exception: Error creating evaluation session: StopProcessingExn
at Microsoft.FSharp.Core.PrintfModule.PrintFormatToStringThenFail@1448.Invoke(String message)
at FSharp.Compiler.Interactive.Shell.FsiEvaluationSession..ctor(FsiEvaluationSessionHostConfig fsi, String[] argv, TextReader inReader, TextWriter outWriter, TextWriter errorWriter, Boolean fsiCollectible, FSharpOption`1 legacyReferenceResolver) in D:\a\_work\1\s\src\fsharp\fsi\fsi.fs:line 3262
at Fake.DotNet.Fsi.InternalFsi.doExec(String script, FSharpList`1 allArgs) in D:\a\FAKE\FAKE\src\app\Fake.DotNet.Fsi\Fsi.fs:line 394
at Fake.DotNet.Fsi.InternalFsi.exec(String script, FSharpList`1 allArgs) in D:\a\FAKE\FAKE\src\app\Fake.DotNet.Fsi\Fsi.fs:line 408
at Fake.DotNet.Fsi.execRaw(FSharpFunc`2 fsiParams, String script, FSharpList`1 scriptArgs) in D:\a\FAKE\FAKE\src\app\Fake.DotNet.Fsi\Fsi.fs:line 429
at Fake.DotNet.Fsi.exec(FSharpFunc`2 fsiParams, String script, FSharpList`1 scriptArgs) in D:\a\FAKE\FAKE\src\app\Fake.DotNet.Fsi\Fsi.fs:line 460
Seems related to https://github.com/fsharp/fsharp-compiler-docs/issues/807 and maybe https://github.com/dotnet/fsharp/issues/11770
Internal
doesn't seem to respect WorkingDirectory
I hacked External
like this for now
diff --git a/Build/Fsi.fs b/Build/Fsi.fs
--- a/Build/Fsi.fs (revision eb8500c3ee49ba79594a49077974bd2f9e0f935c)
+++ b/Build/Fsi.fs (date 1711662199284)
@@ -49,6 +48,7 @@
[<RequireQualifiedAccess>]
type FsiTool =
+ /// Use an empty string to use `dotnet fsi`
| External of string
| Internal
| Default
@@ -357,7 +357,7 @@
let messageF msg = results.Add msg
- let processResult =
+ let mutable proc =
CreateProcess.fromRawCommandLine fsiExe args
|> CreateProcess.withEnvironment (
defaultEnvironmentVars |> List.append (parameters.Environment |> Map.toList)
@@ -366,7 +366,11 @@
|> CreateProcess.withTimeout TimeSpan.MaxValue
|> CreateProcess.redirectOutput
|> CreateProcess.withOutputEventsNotNull messageF errorF
- |> Proc.run
+
+ if String.IsNullOrWhiteSpace fsiExe then
+ proc <- proc |> DotNet.prefixProcess id [ "fsi" ]
+
+ let processResult = proc |> Proc.run
if processResult.ExitCode <> 0 then
List.iter Trace.traceError (errors |> List.ofSeq)
Description
Fake does not find new versions of fsi on windows. FsiTool.Internal works, but FsiTool.Default and FsiTool.External "dotnet fsi" fail.
Repro steps
[ProgramFilesX86]/Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\FSharp
[ProgramFiles]dotnet\sdk\5.0.100\FSharp
.Fsi.exec id "testscript.fsx" []
orFsi.exec (fun p -> {p with FsiTool.External "dotnet fsi"}) "testscript.fsx" []
in a fakebuild.fsx
script.Expected behavior
I expect fake to run
testscript.fsx
Actual behavior
The target fails with the error
(Start of process 'fsi.exe' failed.)
or(Start of process 'dotnet fsi' failed.)
.The problem is the fsi path searching here: https://github.com/fsharp/FAKE/blob/release/next/src/app/Fake.DotNet.Fsi/Fsi.fs#L249
To find the latest
dotnet fsi
, it will probably be necessary to update ProcessUtils.findFilesInternal so that it searchesC:\Program Files\dotnet\sdk
for the latest sdk.Known workarounds
Fsi.exec (fun p -> {p with FsiTool.Internal}) "testscript.fsx" []
works.Related information