Skip to content
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

SCCACHE_ERROR_LOG + trace logs == doesn't work on windows #80

Closed
alexcrichton opened this issue Mar 13, 2017 · 5 comments
Closed

SCCACHE_ERROR_LOG + trace logs == doesn't work on windows #80

alexcrichton opened this issue Mar 13, 2017 · 5 comments

Comments

@alexcrichton
Copy link
Contributor

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.

@luser
Copy link
Contributor

luser commented Mar 14, 2017

Bummer! We could just make run_server_process redirect the server's stderr instead. I don't recall why I didn't write it that way in the first place. Maybe because on unix we're daemonizing, so the redirect would probably get lost?

@alexcrichton
Copy link
Contributor Author

I have a PR (rust-lang/rust#40516) to fix this in std, so we may be able to just wait until that lands.

@alexcrichton
Copy link
Contributor Author

Fixed upstream, no longer relevant.

@luser
Copy link
Contributor

luser commented May 1, 2017

Do you know what release that fix will ship in? (Thanks!)

@alexcrichton
Copy link
Contributor Author

I believe that's on beta, which will be 1.18 released (6 weeks from now)

crystalin pushed a commit to PureStake/sccache that referenced this issue Jul 2, 2021
Fix aarch64-unknown-linux-musl CI build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants