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
Console.Out needs to be redirected to get FsiEvaluationSession output in correct order (was FCS 0.0.59 shows help at the end) #201
Comments
I also found this today in the response from FAKE.Deploy. |
Could it be the problem because you upgrade to Visual F# Tools 3.1.2? I started seeing it in AppVeyor builds after they upgraded to Visual F# Tools 3.1.2 https://ci.appveyor.com/project/dungpa/visualfsharppowertools/build/1.5.0-a1408251942. |
This would be even worse.
|
@dungpa but your build script also use new version of |
You're right. My bad. I didn't notice that FAKE 3.3.0 has just been released today. |
Yes. It's probably the new FCS. Still weird issue
|
Now I think It's not FCS. It's probably fsprojects/FAKE@a364933#diff-ee58d9452be1f275ad4acc98277247a3R127 |
Ok... but without this line you do not get output in the case of success execution, don't it? |
mhm I see two solutions:
|
I did the first one - fsprojects/FAKE@d1b9226 Anybody up for the second? |
I recompiled FAKE using new FAKE and the message disappeared. |
Is this still an issue? |
Yes, FCS still prints this messages. |
@sergey-tihon Could you please add a repro for this that involves FCS alone (not FAKE)? |
printfn "Hello world"
2+2
#r "FSharp.Compiler.Service.dll"
open System
open System.IO
open Microsoft.FSharp.Compiler.Interactive.Shell
let main () =
let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration()
let commonOptions = [| "fsi.exe"; "--noninteractive" |]
let sbOut = Text.StringBuilder()
use outStream = new StringWriter(sbOut)
use stdin = new StreamReader(Stream.Null)
let session = FsiEvaluationSession.Create(fsiConfig, commonOptions, stdin, outStream, outStream)
session.EvalScript @"d:\Downloads\fsharp.compiler.service.0.0.62.nupkg\lib\net45\helloworld.fsx"
printfn "%s" (sbOut.ToString())
main() Result of execution:
|
This is not strictly speaking a bug. The sbOut stream captures all the diagnostics from the FsiEvaluationSession, including the banner text. The printfn in the script goes to Console.Out (which is not automatically redirected). I adjusted the script to also capture Console.Out and things seemed to work correctly:
|
Given this I think we can probably close this, though the behaviour is a bit strange. |
After updating FAKE to FCS 0.0.59 (see fsprojects/FAKE#519) it shows the FSI help at the end of a script.
Any ideas why?
@tpetricek @dsyme @sergey-tihon
The text was updated successfully, but these errors were encountered: