mozilla / sccache

Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various cloud storage options, or alternatively, in local storage.
Apache License 2.0
5.85k stars 552 forks source link

Sccache fails on network connection failure (macOS only) #1051

Open carewolf opened 3 years ago

carewolf commented 3 years ago

Reported in Qt under https://bugreports.qt.io/browse/QTBUG-97270

An sporadic failure to build qtwebengine (effectively chromium), on macOS only. First a network error is reported, and sccache claims to then build locally, but still ends up reporting an error to ninja that halts the build.

alcroito commented 2 years ago

Somewhat similar to https://github.com/mozilla/sccache/issues/1098

alcroito commented 2 years ago

I think this can be closed now that https://github.com/mozilla/sccache/pull/1090 has landed

carewolf commented 2 years ago

Though in this case it already switched to local mode, but it didn't work?

alcroito commented 2 years ago

Where do you mean? Qt's CI still uses an older version where falling back to local compilation is not enabled.

carewolf commented 2 years ago

Okay, I was referring to "sccache: warning: The server looks like it shut down unexpectedly, compiling locally instead". I assume that is a different fallback for later compile jobs, and not a fallback for the first failing compile job?

alcroito commented 2 years ago

I don't know which job was first exactly. If you look at the code

https://github.com/mozilla/sccache/pull/1090/files#diff-b86d43fce6a9c57160aa925719550d40a6ed3f5e5a0117679905f76e68acc520R477

There are 2 match clauses, one that checks if there was an IO EOF error, which already printed "The server looks like it shut down unexpectedly, compiling locally instead" and fell back to compiling locally, and an "all other kinds of errors" clause, which can now be configured not to error out.

But looking at the Qt failure log, there's no 'error reading compile response from server' in the error message, which likely means that another code path failed. So I guess not all error code paths fail gracefully.