-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fake does not find dotnet fsi for Fsi.exec targets. #2561
Comments
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 I'm also running into this issue. In my case FsiTool.Internal also doesn't work
Seems related to fsharp/fsharp-compiler-docs#807 and maybe dotnet/fsharp#11770 |
I hacked 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
The text was updated successfully, but these errors were encountered: