fix(release): warm cargo cache before the offline lock sync (VA-144) #154
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/VA-144-warm-cargo-cache"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes the cold-cache failure in
just create-release(#VA-144).just create-release minordied during the lock sync with "no matching package namedanyhowfound / location searched: crates.io index". The dependency was never missing:anyhow = "1"is declared incrates/vervain-agent/Cargo.tomlandanyhow 1.0.102is inCargo.lock. The version bump forces the resolver to run, and inside the dev container cargo resolves against thedev-vervain-agent-cargo-registryvolume (compose.yml:13-15), which is created empty on a fresh clone, a new machine, or after a volume prune.--offlinethen forbids reaching the index, so the first crate needed fails;anyhowwas just alphabetically early.The fix adds
cargo fetch --lockedin the container immediately before the offline update. It fetches exactly whatCargo.lockpins and fails rather than rewriting it, so the release commit's contents are unaffected, and it costs nothing once the volume is warm.--offlinedeliberately stays on thecargo updatestep. It keeps unrelated dependency movement out of the release commit. Worth recording why the bug existed at all: this recipe inherited that flag from the host-side recipe incommon.just, which runs via nushell's^operator against a~/.cargoregistry that is warm by construction.vervain-agentvendors nocommonsubmodule and has no host Rust toolchain, so it runs the same command in a container and never inherited that guarantee.Verification status, stated plainly:
just pre-commitwas NOT run, becausedockeris not available in the environment this change was authored in.just --dry-run create-release minorconfirms the recipe parses and renders both steps in the right order, the diff touchesjustfileonly, andcargo fmt --all --checkis clean on the host. The cold-volume acceptance criterion (run with the cargo volumes removed, e.g. afterdocker compose --file compose.yml down --volumes) still needs a run on a machine with Docker before merge.Superseded by #155 (merged as
e300f90) and closed per VA-144 acceptance criterion 10.This PR's ordering is broken: it inserts
cargo fetch --lockedAFTER thestr replacethat bumps[workspace.package] version, soCargo.tomlandCargo.lockdisagree at that point and--lockedrefuses by design (error: cannot update the lock file /workspace/Cargo.lock because --locked was passed to prevent this). The release still aborts, one step earlier than before. The fetch has to run while the lock is still authoritative, i.e. before the version rewrite, which is what #155 does.#155 also fixes a second defect this PR does not touch: nothing between the branch creation and the commit was guarded, so any failure in that window left the version bump uncommitted in the working tree on an empty
release/<tag>branch.#VA-144
Pull request closed