Skip to content

Local dev cargo builds bypass soldr/zccache — slow rebuilds #75

Closed

Description

@zackees

Symptom

Local Rust builds during dev (e.g. bash test, bash lint, agent-driven cargo build -p fastled-cli) are slow — first-time build of fastled-py regularly takes 8–10 min because dependencies (PyO3, reqwest, tokio, axum, clap, zip, tar, zstd, flate2) are recompiled from scratch on every clean build. CI builds use zccache via zackees/setup-soldr@v0 and complete much faster on cache hit.

Root cause

Two related gaps in local dev tooling:

  1. _cargo trampoline (./_cargo) ends with exec cargo "$@" — it sets PATH and CARGO_BUILD_TARGET but does NOT route through soldr cargo. So even when soldr and zccache are installed locally (/c/tools/python13/Scripts/soldr & .../zccache), they're never invoked.

  2. ci/env.py::_apply_sccache (line 168) sets RUSTC_WRAPPER=sccache when sccache is on PATH. But the project uses zccache (via soldr), not sccache. The name & lookup are out of date — this function never finds zccache, so even tools that respect RUSTC_WRAPPER (e.g. ad-hoc cargo invocations) miss the cache.

CI workflows (.github/workflows/_unit-test.yml, _lint.yml, _build.yml, _integration-test.yml) sidestep this by setting RUSTC_WRAPPER: sccache AND installing both mozilla-actions/sccache-action AND zackees/setup-soldr@v0 — but the setup mixes sccache and soldr/zccache, and local dev gets neither by default.

Impact

  • Agent-driven Rust subagents on this repo run out their token budgets on cargo build (e.g. PR Port the remaining Python app orchestration layer to Rust #72 Stream B agent: 600 s wall clock, mostly first-build of fastled-py).
  • Developers see 10-min cold builds locally that should be sub-minute on warm cache.
  • The user reported this directly: "why was it taking so slow? We should be using soldr for these builds."

Proposed fixes

  1. Wrap _cargo with soldr when available. Change the tail of ./_cargo to prefer soldr cargo "\$@" when command -v soldr succeeds, falling back to plain cargo. This makes every local bash lint / bash test / bash build invocation transparently use zccache.

  2. Rename/repurpose ci/env.py::_apply_sccache to _apply_zccache (or both) — set RUSTC_WRAPPER to whichever of zccache/sccache is found on PATH, with zccache taking precedence to match project convention.

  3. Decide CI strategy: the workflows currently install BOTH sccache-action and setup-soldr but only set RUSTC_WRAPPER=sccache. Either drop sccache-action (if soldr provides equivalent caching via zccache) or document why both are needed.

Verification

  • After fix 1: bash test on a clean workspace should populate ~/.zccache/artifacts/ and a follow-up clean build should be measurably faster.
  • After fix 2: python -c \"from ci.env import build_env; import os; e = build_env(); print(e.get('RUSTC_WRAPPER'))\" should print the zccache path.

Notes

This was found while implementing #72 (porting remaining Python orchestration to Rust). The work itself didn't require touching soldr/zccache, but the slow local dev loop made agent-driven implementation expensive.

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