Description
Unfortuantely with SCCACHE_ERROR_LOG
and a trace log level nothing's actually emitted on Windows.
In libstd we fetch and cache stderr in a global. This means that when the process starts with a missing handle (via the spawning of the server process in sccache) if stderr()
is used then libstd will cache a missing handle and forever not print anything to stderr.
That means that later when SetStdHandle
is called this doesn't actually propagate back into the standard library and logs still don't show up.
Conveniently debug logs don't attempt to print anything until after SetStdHandle
is called, but trace logs cause attempts to print (and caching a stale value) ahead of time and cache an empty handle.
I'd consider this also a bug in libtsd, but figured I'd open here as well if anyone's running into the issue.