Skip to content

perf(zccache) Phase 1: embedded backend prep behind FBUILD_ZCCACHE_EMBEDDED opt-in #790

Description

@zackees

Sub-issue of #789 (zccache embedded migration).

Scope

Land the opt-in scaffolding. Default behavior unchanged — wrapper path
stays the default, embedded mode reached only via FBUILD_ZCCACHE_EMBEDDED=1.

Deliverables

  • Optional embedded Cargo feature on fbuild-build pulling in the
    zccache library as a git-pinned dep (no submodule yet — see perf(zccache): migrate from managed wrapper binary to embedded ZccacheService in fbuild-daemon #789
    "vendoring" discussion).
  • CompileBackend::{Wrapped, Embedded} enum held on a daemon state struct
    in fbuild-daemon. Resolved once at daemon start from
    FBUILD_ZCCACHE_EMBEDDED.
  • New crates/fbuild-daemon/src/zccache_embedded.rs wrapping
    ZccacheService with fbuild's identity defaults + ~/.fbuild/<mode>/cache/
    root. Construct the service at daemon startup when embedded mode is on.
  • Bump MANAGED_ZCCACHE_VERSION to match whatever revision the embedded
    library dep pins, so wrapped + embedded share an artifact format.
  • fbuild-build continues to call into the wrapper today; no per-compile
    routing change yet (that's Phase 2).
  • docs/ note documenting the env var.

Out of scope (other phases)

  • Per-compile dispatch through the embedded service → Phase 2 (#TBD)
  • Embedded fingerprint API replacing zccache fp shellouts → Phase 3 (#TBD)
  • Deleting managed_zccache.rs / wrapper code path → Phase 4 (#TBD)

Acceptance

  • soldr cargo build --workspace clean (default features).
  • soldr cargo build --workspace --features fbuild-build/embedded clean.
  • soldr cargo clippy --workspace --all-targets -- -D warnings clean
    with and without the feature.
  • Default uv run test green — no behavior change without the flag.
  • Smoke test: starting the daemon with FBUILD_ZCCACHE_EMBEDDED=1
    constructs the embedded service without panicking, and the daemon
    logs which backend is active.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions