Skip to content

ci: re-enable setup-soldr cook/cargo-chef prebuild for faster builds #266

Closed

Description

@zackees

Context

In PR #253 (chore(deps): adopt upstream soldr/zccache/setup-soldr updates) we added prebuild-deps: none to every zackees/setup-soldr@v0 invocation across 11 workflow blocks. setup-soldr's default since their PR #140 is prebuild-deps: cargo-chef — it runs soldr cook to pre-warm target/deps/ with all transitive dependency artifacts on the cache-keyed Cargo.lock hash. When the cache hits, the user's first cargo build starts hot.

For fbuild we had to disable it because the cook step pre-populates target/ and the subsequent soldr cargo build -p fbuild-cli -p fbuild-daemon fails:

##[warning]setup-soldr detected a pre-populated shared target directory;
  a subsequent `soldr cargo build` using the same `--target-dir` may fail
  with a missing .rmeta error - see README 'Known limitations'.
...
error: could not compile `fbuild-cli` (bin "fbuild")

Documented upstream as a known shared-target-dir limitation when you cook → cargo build -p <subset>.

Why this matters

fbuild's CI is heavy. Every PR runs the full board matrix (80+ jobs), and each one compiles fbuild's entire dependency tree from cold (zccache helps but only for downstream compilations, not for the dep tree itself). The cook layer's cache-key (cook-${os}-${arch}-${libc}-rustc${release}-f${flagsHash}-l${lockHash}-soldr${ver}) is content-addressable on Cargo.lock — it would hit across branches automatically and turn "cold first build" into "warm-start build" for every CI run.

Per setup-soldr's design doc (PR #140), the win is measured in tens of seconds per job on cache hit. Across 80+ jobs that's potentially 30+ minutes of CI savings per PR.

Options to enable

  1. Separate target dir for the cook step. Cook writes to target-chef/; the user's build still uses target/. Loses the warm-start benefit but plays nice with -p <subset> builds. Probably not what we want.

  2. Build the full workspace instead of -p fbuild-cli -p fbuild-daemon. Cook prebuilds the whole transitive dep graph; if we then build the whole workspace, every .rmeta cook created is what cargo expects to see. Trade-off: workspace builds compile more code than the subset we need for distribution.

  3. Tune prebuild-deps-flags to constrain chef's prebuild to the same -p subset (prebuild-deps-flags: \"-p fbuild-cli -p fbuild-daemon\"). Aligns cook's output with the actual build. Smallest change, but requires verifying chef respects -p for the prebuild phase.

  4. Wait for upstream setup-soldr fix. Likely lowest-effort if it lands.

Option 3 is probably the right first try.

Acceptance criteria

  • Pick a per-workflow strategy (likely Fix ESP32-S3 PSRAM board configuration in board JSON database #3, with cdc on boot warning #2 as fallback for template_native_build.yml which already builds -p fbuild-cli -p fbuild-daemon).
  • Remove prebuild-deps: none from one workflow as a probe (suggest check-ubuntu.yml); verify clean run.
  • Measure the time saved on a cache hit vs current cold-deps baseline. Threshold to roll out: ≥ 30s wall-clock per job on a hit.
  • If clean, drop prebuild-deps: none workflow-by-workflow.
  • If the upstream issue gets fixed first, ride that fix instead of working around it locally.

Reference

🤖 Generated with Claude Code

Activity

  1. zackees commented on May 24, 2026

    @zackees
    MemberAuthor

    Research update — what's still blocking re-enabling cook

    Current state in fbuild

    Upstream status — the underlying bug is still open in code, "closed" only in tracking

    Two relevant upstream issues, both closed without a code fix:

    No PR in either repo between PR #140 (2026-05-22) and soldr@d3ba5f72 / setup-soldr@99463f86 (2026-05-23/24) addresses the rust-plan restore code path that produced fbuild's failure. So option #4 (wait for upstream) is currently blocked.

    Tool versions (as of 2026-05-24)

    Tool Latest release fbuild floor
    setup-soldr v0.9.2 (2026-05-20) @v0 (floating)
    soldr v0.7.31 (2026-05-24) bundled by setup-soldr (default 0.7.30+)
    zccache 1.9.1 (2026-05-24) >=1.8.2 in pyproject.toml; zccache-artifact 1.8 in Cargo.toml
    cargo-chef v0.1.77 (2026-03-03) n/a — invoked transitively via soldr cook

    soldr cook requires soldr ≥ 0.7.x (soldr PR #409, merged 2026-05-21). The setup-soldr default already satisfies this. No minimum is tied to fbuild's 1.94.1 toolchain or the dylint nightly-2026-03-26 pin.

    cargo-chef capability

    cargo chef cook --package <name> is supported — Recipe records pub package: Option<Vec<String>> and forwards --package <name> to the inner cargo call. So option #3 (prebuild-deps-flags: "-p fbuild-cli -p fbuild-daemon") is plausibly correct at the chef layer. But the failure in PR #253 was not at the chef layer — it was at the soldr rust-plan restore step that runs after chef and before the user's cargo invocation. That code path is still the soldr #228 bug.

    Concrete blockers

    To flip even one workflow from prebuild-deps: none to default cook:

    1. Either a code fix lands in soldr's rust-plan restore (no candidate PR exists as of 2026-05-24), or
    2. A workflow uses option cdc on boot warning #2 (build the full workspace, no -p filter on either side) — sidesteps the bug because cook's output and the user's build target the same package set. This is the lowest-risk first probe and matches cargo-chef's "same cwd, same args" guidance, or
    3. A workflow uses option Esp32-s3 PSRAM use #1 (separate --target-dir for the user build) — the workaround soldr feat(bench): #205 AC#5 enforce <= 50 ms warm threshold in bench-fastled-examples #228 itself recommends. Already proven to work in template_native_build.yml for the python wheel. Costs the warm-start benefit on target/ but keeps cook's value for other workflows.

    Option #3 from the issue (prebuild-deps-flags: "-p ...") is unverified — chef supports it, but the failure mode is downstream of chef.

    Suggested first probe

    Pick check-ubuntu.yml (lowest-blast-radius — single Ubuntu job, no board matrix). Drop prebuild-deps: none, leave the existing soldr cargo check --workspace --all-targets (workspace-wide, no -p). If that reproduces the rust-plan restore error, fall back to option #1 with a dedicated --target-dir. Measure wall-clock against the current cold baseline; threshold from the issue is ≥ 30s/job.

    Also worth doing: pin every zackees/setup-soldr@v0 to the v0.9.2 SHA before the probe so a future upstream regression can't silently turn off the experiment.

    🤖 Generated with Claude Code

  2. zackees commented on May 24, 2026

    @zackees
    MemberAuthor

    Upstream trackers filed

    For end-to-end visibility into when this is unblocked:

    Either issue closing-with-fix unblocks the option #4 path in this issue (wait for upstream). Until then, options #1 (separate --target-dir, already proven in template_native_build.yml) and #2 (build full workspace, no -p filter) remain the only working enablement paths.

    🤖 Generated with Claude Code

  3. zackees commented on May 30, 2026

    @zackees
    MemberAuthor

    Closing — all five acceptance criteria are now met via the recent cascade work:

    Closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions