fix(release): sync Cargo.lock on release and correct main's drift (PMS-642) #435
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/PMS-642-release-syncs-cargo-lock"
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?
Background
The
create-release <major|minor|hotfix>recipe (justfile) bumps the[package] versionline inCargo.tomland commits it, but never runscargo update. SoCargo.lock'smokosh-serverentry keeps the OLD version. After the v0.6.0 release merged,main'sCargo.lockstill says:while
Cargo.tomlsays0.6.0.Consequences: every
cargoinvocation re-dirtiesCargo.lock(auto-correcting the version line), a--lockedbuild fails on the mismatch, and every branch cut frommaininherits the drift (observed on the PMS-640 branch, where a containercargo checksilently rewrote the lock).bunyip's release recipe runs
cargo update --workspaceto keep its lock in sync (bunyipCLAUDE.md); mokosh'screate-releasedoes not.Goal
A release leaves
Cargo.lockin sync with the bumpedCargo.toml, andmain's current drift is corrected.Proposed approach
mainnow: sync the lock'smokosh-serverentry to0.6.0and commitCargo.lock.Cargo.tomlversion bump and before the release commit, runcargo update --workspace(workspace-members-only, so transitive dependencies are not churned) to sync the lock, thengit add Cargo.toml Cargo.lock. Dev boxes are toolchain-less, so run this one cargo step inside the devservercontainer (docker compose ... run --rm --no-deps server cargo update --workspace), mirroring the existingcreate-release-containersplit pattern in bunyip. Keep the host git/fj steps on the host.Alternatives considered
cargo updateon the host in the recipe: rejected. Dev boxes have no host Rust toolchain (that is why the pre-commit and check recipes run cargo in a container).--locked-build hazard and re-dirties the lock on every build, which masks genuine lock changes in diffs.cargo generate-lockfile/ fullcargo update: rejected. Both can churn transitive dependencies;--workspacerestricts the change to the workspace members' own versions.Acceptance criteria
main'sCargo.lockmokosh-serverentry matchesCargo.toml(0.6.0).create-releaserunscargo update --workspaceafter the version bump and stagesCargo.lock, so a fresh release leaves the lock in sync.