-
Notifications
You must be signed in to change notification settings - Fork 588
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 writes its version string to stderr when -v is given #2066
Comments
Have you tried adding TeamCity as a BuildServer? As in BuildServer.install [
TeamCity.Installer
] I am using FAKE with teamcity and it is working just fine for me. |
here is a little update to the script fake boostrap : function Invoke-FakeBuild([string]$TargetName) {
$fakeBuildArgs = "./$($fakeCli)"
$runArgs = " run $($BuildScript) --no-cache --parallel 8 --target $($TargetName)"
if ($FakeVerbose) {
# THIS IS THE ORIGIN OF THE ERROR
$fakeBuildArgs += " -v"
# THIS IS THE ORIGIN OF THE ERROR
}
$fakeBuildArgs += $runArgs
Write-Host "Execution expression : '$($fakeBuildArgs)'"
Invoke-Expression "$($fakeBuildArgs) 2>error.log"
}
Invoke-FakeBuild -TargetName $TargetName |
@kblohm at the begining of the script i guess ? |
@kblohm |
@kblohm, i just rollbacked this
as it completly destroy the Teamcity logs in the UI, tons of line ending does not render, it was way worse ;) using teamcity 10.0.x |
I updated the description. I'm not exactly sure if this is actually a bug or by design. I guess I'll have to think about it and compare to other tools. But I think other tools do the same. In fact: We might even decide to write a lot more into On the other hand we don't really have deterministic output anyway. If you want that you would use |
One other thing we write to stderr (which would make your build red) is warnings (https://github.com/fsharp/FAKE/blob/release/next/src/app/Fake.netcore/Program.fs#L160). But that might be exactly what you want? |
Ok I'm fine with changing this particular behavior... |
thx for the title, that's a good idea I'm also fine removing the I feel like i'm going to remove the side note, if you'd like deterministic build output you can also format stdout kinda like logs framwork does when outputing to the console |
Yes please remove In fact, because |
ok, thx for the answer i'll keep my powershell switch but defaulted to false so that the CI won't use I let you decide what to do with this issue, depending if you still need to keep it open for the stdout/err feature, or just close it. Now i understand a bit more the behavior ;) Thx for all the details |
Yes, I think I'll not consider this a bug but improve the behavior by changing the message we print to stderr a bit. For example:
This has the "advantage" that you can "test" what your CI is doing when something is written to standard error. This seems reasonable for verbose mode. |
thx for all the precision |
Description
It feels like the ouput of Fake build (probably the line with the version) is detected as a Build error
At the very begining of the the build (even before the restore step) the build goes from Green to red
Expected behavior
The build should not detect "Some" lines as error when it feels like it is just "Verbosity"
Actual behavior
As it is delicate for me to output code from the company here is what the build log looks like
Known workarounds
Manually open the log for each TeamCity build ...
Related information
fake-cli
as adotnet-tool
the script is ran using a Powershell PS1 :
As you can see i do not read the exit code of the Fake Build in order to let the powershell return the good exit good.
So far it ALWAYS return 0 (so in this scenario it should not affect the build result)
Finding the cullprit
Redirect StdErr to another stream :
not sure this is this line, because i still don't find where it is being printed out
https://github.com/fsharp/FAKE/blob/staging_5_4/src/app/Fake.Runtime/Environment.fs#L12
The text was updated successfully, but these errors were encountered: