Skip to content

Upgrade zccache to latest (with zccache#1710), flush the embedded backend on daemon exit, and wait on a daemon that is still starting #1480

Closed

Description

@zackees

Fixes the root cause of #1462: the client reports daemon did not become healthy after 3 spawn attempts while the embedded zccache backend takes 12–47 s to start. This issue also covers the fbuild-side persistence gap and the client-side wait that #1462 asks for.

Background

Tasks

1. Upgrade zccache to the latest version

  • Repin zccache in every crate that uses it (fbuild-build, fbuild-build-engine, fbuild-build-arm, fbuild-build-esp, fbuild-build-mcu) to the latest zccache that contains ci: full / windows / Check hits its 45-min timeout-minutes on routine runs #1710.
  • Move the running-process git rev in the root Cargo.toml to the exact rev pinned in zccache's workspace Cargo.toml. If the revs differ, rust-lld fails with duplicate rp_*_public symbols. See the comment above the dependency.
  • Fix any API changes between 1.13.1 and the new version in crates/fbuild-build-engine/src/zccache_embedded.rs / compile_backend.rs.
  • Check the cache-root version directory (~/.fbuild/<mode>/zccache/v<version>/). A version bump starts a new, empty cache root, so the first build after the upgrade is cold. Mention this in the release notes.

2. Flush the embedded backend before the daemon exits

  • Call flush() (or shutdown) on the global compile backend before every clean exit(0) in the daemon, including the idle self-eviction path, so metadata.bin, the depgraph and the index are saved on every exit.
  • Test: start the daemon, compile, and let it exit cleanly. Assert that metadata.bin exists and that the next start logs a non-empty metadata restore.

3. Client waits on a daemon that is still starting (#1462 ask 1)

  • Serve a starting health state as soon as the port is bound, before the USB overlay fetch (main.rs:149), the root-ownership lock wait (main.rs:159, up to 10 s) and backend start.
  • When the client finds a daemon that owns the port and reports starting, it polls with a longer deadline that tracks startup progress, instead of respawning and counting down 3 × 10 s.

Acceptance

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions