Problem
fbuild has a sophisticated local disk cache (~/.fbuild/{dev,prod}/cache/, disk_cache:: module with LRU index, leases, GC budget) but there is no documented design for using it in CI — i.e., how to persist the cache across GH Actions / GitLab CI / Buildkite runs so a cold runner is effectively warm on the second build.
This is blocking the FastLED repo's CI from realising fbuild's cache advantages. It is also the hidden premise behind issue #91 (warm-pass 30 s stall) — until we nail down what a "warm CI run" even means, perf targets are fuzzy.
Acceptance criteria
- A new
docs/CI_CACHING.md (and matching docs/INDEX.md entry) that answers the questions below.
- A drop-in snippet for
actions/cache@v4 that FastLED's CI can adopt unchanged.
- Cache-key strategy that avoids the three failure modes: stale cache hit (silent wrong output), cache miss on trivial edit (wasted time), and cache explosion (budget breach).
Questions to answer in the doc
1. What to cache
2. Cache key strategy
3. Hermeticity
4. Invalidation
5. Daemon interaction
6. Worked examples
7. Related tooling audit
Non-goals
- Implementing new cache features in this issue — that's downstream.
- Redesigning the local disk cache — this doc describes what exists and how to use it in CI.
Related
Problem
fbuild has a sophisticated local disk cache (
~/.fbuild/{dev,prod}/cache/,disk_cache::module with LRU index, leases, GC budget) but there is no documented design for using it in CI — i.e., how to persist the cache across GH Actions / GitLab CI / Buildkite runs so a cold runner is effectively warm on the second build.This is blocking the FastLED repo's CI from realising fbuild's cache advantages. It is also the hidden premise behind issue #91 (warm-pass 30 s stall) — until we nail down what a "warm CI run" even means, perf targets are fuzzy.
Acceptance criteria
docs/CI_CACHING.md(and matchingdocs/INDEX.mdentry) that answers the questions below.actions/cache@v4that FastLED's CI can adopt unchanged.Questions to answer in the doc
1. What to cache
~/.fbuild/, just~/.fbuild/cache/, or selective subdirs (toolchains vs packages vs build artifacts vs daemon state)?daemon/daemon.port,daemon/fbuild_daemon.pid,daemon/daemon.log*, any lock files, any leases)actions/cache10 GB limit.%USERPROFILE%\.fbuild\...) vs Unix.2. Cache key strategy
fbuildversion,platformio.inihash, board-JSON set hash, toolchain version, OS/arch, source tree hash.disk_cache::reconcile_on_openhandle a stale cache gracefully, or do we bust on fbuild version?3. Hermeticity
reproducible-buildsapply? If partial, document which parts are reproducible (object files? archives? final ELF?).4. Invalidation
disk_cache::budget::autoscales_to_disk— how does this behave on a runner with 14 GB free?reconcile_on_opendo a full rescan (slow, bad for warm pass)?fbuild cache pin <toolchain>so shared toolchains never LRU-evict. Confirm pin API exists or file a follow-up.5. Daemon interaction
--foreground --oneshotmode that skips socket setup, or do CI runs needfbuild --no-daemon?6. Worked examples
7. Related tooling audit
fbuilditself expose afbuild cache export <tarball>/fbuild cache import <tarball>helper that CI could use instead of rawactions/cache? Document current state and file a follow-up if missing.disk_cache::leaseinteract with two concurrent CI shards sharing a cache? Is locking safe?Non-goals
Related
crates/fbuild-packages/src/disk_cache/— existing LRU/GC implementation.docs/architecture/overview.md— mentions the cache path but not CI usage.docs/DEVELOPMENT.md— only mentions "clear cache" troubleshooting.