gitlab-runner on Windows always outputs to stderr
gitlab-runner.exe always outputs the "Runtime platform" text to stderr, even though it is NOT an error:
gitlab-runner.exe : Runtime platform arch=amd64 os=windows pid=5760 revision=6946bae7 version=12.0.0
This is a problem in automation scripts that are invoked in GitLab Runner jobs on remote machines, because GitLab runner will capture this output to stderr and think an error occurred in the job (because obviously, output to stderr means an error happened!).
We are currently having to redirect stderr to a file each time we invoke gitlab-runner during our machine setup scripts in order to eat these errors so our GitLab job will not be marked as failed, which means we are likely missing out in situations when real errors occur. This affects us on install, register, and start commands specifically.
It is unclear exactly which scenarios are getting failed due to stderr output, but this tool should NOT be outputting to stderr unless there is an error.
Steps to reproduce
Execute any gitlab-runner command that will output this "runtime platform" text. One such command is
The text is output to stderr; you can witness this by doing:
gitlab-runner.exe verify 2>bad_text.txt
This will redirect the stderr output to a file. You'll notice that runtime platform text is NOT shown on the console, but instead goes to the target file, thus it is actually emitting on stderr.
The text is emitted to stdout, which does not cause any errors in PowerShell scripts.
Used GitLab Runner version
Everything since at least 11.8, likely earlier.