Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

One Compilation, Fully Traced

The wrapper connects to the resident server and sends Request::Compile with the executable, arguments, environment, and working directory. Each connection is a Tokio task, while SccacheService shares statistics, compiler discovery, storage, distributed state, and command creation through clones.

The server resolves the real compiler and caches a boxed Compiler. Argument parsing returns a boxed CompilerHasher: the compiler family decides whether the invocation is cacheable and what inputs influence identity.

generate_hash_key preprocesses or inspects dependencies, normalizes relevant paths and environment, and produces a key plus a prepared compilation. Storage then yields hit, miss, or error. A hit restores outputs and returns captured stdout/stderr without running the compiler.

On a miss, sccache acquires a jobserver token before starting expensive work. It may package and dispatch remotely or spawn locally. The process exit status decides whether outputs are eligible for caching.

CompileResult::CacheMiss contains both the compiler output and a boxed cache write future. The client-facing result can proceed while the server finishes artifact publication and updates statistics. The response and durable reuse point are related obligations, not one blocking step.