Build a Smaller sccache
Rebuild a concurrent command cache, not merely a HashMap<String, Vec<u8>>.
What are we preserving?
- a short-lived client and resident async server;
- deterministic keys over declared and discovered inputs;
- hit versus compile fallback;
- a separate child-process budget;
- captured output and exit status;
- publication after successful completion;
- runtime-selected storage;
- graceful connection drain.
Stages
- Cache one fake compiler whose key includes source bytes and arguments.
- Put the cache behind a local Tokio socket protocol.
- Execute a real child command and capture declared output files.
- Add a semaphore-like process permit independent of connections.
- Implement disk storage through a
Storagetrait and atomic publication. - Return output before awaiting a deliberately slow secondary cache write.
- Stop listener admission, drain connection tasks, then enforce a deadline.
- Add simultaneous same-key requests and decide whether to deduplicate them.
Compare the result with production sccache: compiler argument semantics, preprocessing, dependency normalization, archives, many storage systems, distributed toolchains, authentication, multi-level backfill, jobserver interop, platform process handling, statistics, and corruption recovery are the hardening layers still missing.