I4221 — CI's Rust cache carries the shared build directory, where cargo actually compiles
The setup-rust action's cache (Swatinem/rust-cache) also saves and restores ~/.cargo/build-shared, the build-dir .cargo/config.toml names, so a job whose cache key matches does not recompile its dependencies.
PŘIPRAVENO vlna 0 · p1 · profil implementation · bezpečné paralelně
Připraveno. Všechny závislosti jsou hotové, takže majordomus plan start I4221 bude přijato.
Cíl
The setup-rust action's cache (Swatinem/rust-cache) also saves and restores ~/.cargo/build-shared, the build-dir .cargo/config.toml names, so a job whose cache key matches does not recompile its dependencies.
Proč
Train 6's coverage job (run 40070749630) logged 'Restored from cache key v0-rust-coverage-Linux-x64-ade52a28-aaa1f5f1 full match: true', 'Cache Size: ~50 MB', 179 Compiling/Checking lines, and then 'Finished test profile in 10m 23s'. Its Cache Paths were ~/.cargo/{bin,registry,git,.crates*} and apps/majordomus-cli/target, while every unit ran from the runner's ~/.cargo/build-shared/majordomus/llvm-cov-target. ADR 0139 moved cargo's intermediates to {cargo-cache-home}/build-shared and left only finished artifacts in target/, but the CI cache still saved target/ alone. So 'rust cache hit=true' in every job summary meant nothing compiled was reused. The owner's audit 2 (10-24) raised it as cache-hit=true with a ~38 min coverage job.
Aktuální stav
Swatinem/rust-cache caches the registry, git checkouts and apps/majordomus-cli/target (about 50 MB). build-shared, where every dependency is compiled, is rebuilt from nothing in each job.
Cílový stav
The cache also carries ~/.cargo/build-shared. On an exact key match, the job compiles only the crate's own units. Finished artifacts stay per tree; .cargo/config.toml and the worktree isolation it protects are unchanged.
Rozsah
- .github/actions/setup-rust/action.yml
- .ai/repo/project/issues/I4221.yaml
Mimo rozsah
- Sharing CARGO_TARGET_DIR between trees, which .cargo/config.toml forbids for a recorded reason
- Changing build-dir locally or the cache keys
Závislosti
Žádné. Tento úkol je kořenem grafu.
Kritéria přijetí
- A job's Cache Paths list includes the runner's ~/.cargo/build-shared
- A second run of a job at the same cache key compiles markedly fewer units than the first, measured by the count of Compiling lines in two runs' logs, quoted in this record
- Every job that reported a cache hit still passes
Validace
- Read the coverage job log of two consecutive runs at one key: Cache Paths, Cache Size and the Compiling count
Požadované důkazy
- ci
Důkazy
Nic nezaznamenáno. Za každým tokenem výše musí stát příkaz nebo artefakt, než lze tento úkol dokončit; vyprávění se odmítá.
Riziko
The cache grows from ~50 MB to the size of a job's build intermediates (several GB) per key, against GitHub's per-repository cache budget. If eviction then outruns reuse, narrow cache-directories to the jobs that gain, rather than revert.
Časová osa
- zahájeno
- —
- ověřeno
- —
- dokončeno
- —
Tato tři pole, důkazy výše a stav závislostí jsou vše, z čeho se stav skládá. Neexistuje žádné pole stavu, které by s nimi mohlo být v rozporu.
Canonical record: .ai/repo/project/issues/I4221.yaml. Read it back with majordomus plan show I4221.