fix(ci): sync Cargo.lock after version bump so --locked steps pass #5

Merged
whitlocktech merged 1 commits from fix/release-locked-lockfile into main 2026-07-14 16:58:11 +00:00
Member

Problem

With the YAML now valid (#4), the release run got to cargo test and failed:

cargo test --locked
error: cannot update the lock file .../sidecar/Cargo.lock because --locked was passed to prevent this

The "Set the crate version to match the release" step seds Cargo.toml's version (0.1.0 → next). That changes this crate's own entry in Cargo.lock, so the subsequent --locked test/build steps refuse to reconcile it. (cargo fmt --check, which runs before the bump, passed — confirming the bump is the trigger.)

Fix

After the version bump, sync just the workspace member into the lock:

cargo update --manifest-path "${WORKDIR}/Cargo.toml" --workspace

--workspace updates only local workspace packages' versions in Cargo.lock; every dependency pin is left untouched, so --locked still guarantees reproducible dependencies. The commit step already git adds Cargo.lock, so the synced lock ships with the bump.

Verification (reproduced locally)

# bump version to 0.2.0, then:
cargo build --locked
  → error: cannot update the lock file ... --locked was passed   ← same CI failure

cargo update --workspace
  → Updating uo-link-sidecar v0.1.0 -> v0.2.0
  → (6 unchanged dependencies)                                    ← deps untouched
cargo build --locked
  → Finished                                                      ← passes

🤖 Generated with Claude Code

## Problem With the YAML now valid (#4), the release run got to `cargo test` and failed: ``` cargo test --locked error: cannot update the lock file .../sidecar/Cargo.lock because --locked was passed to prevent this ``` The "Set the crate version to match the release" step `sed`s `Cargo.toml`'s version (`0.1.0` → next). That changes **this crate's own entry** in `Cargo.lock`, so the subsequent `--locked` test/build steps refuse to reconcile it. (`cargo fmt --check`, which runs *before* the bump, passed — confirming the bump is the trigger.) ## Fix After the version bump, sync just the workspace member into the lock: ```bash cargo update --manifest-path "${WORKDIR}/Cargo.toml" --workspace ``` `--workspace` updates only local workspace packages' versions in `Cargo.lock`; every dependency pin is left untouched, so `--locked` still guarantees reproducible dependencies. The commit step already `git add`s `Cargo.lock`, so the synced lock ships with the bump. ## Verification (reproduced locally) ``` # bump version to 0.2.0, then: cargo build --locked → error: cannot update the lock file ... --locked was passed ← same CI failure cargo update --workspace → Updating uo-link-sidecar v0.1.0 -> v0.2.0 → (6 unchanged dependencies) ← deps untouched cargo build --locked → Finished ← passes ``` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
wtclaude added 1 commit 2026-07-14 16:57:29 +00:00
The release step rewrites the crate version in Cargo.toml (0.1.0 -> next),
which desyncs this crate's own entry in Cargo.lock. The following
`cargo test/build --locked` steps then abort:

    error: cannot update the lock file ... because --locked was passed

Run `cargo update --manifest-path sidecar/Cargo.toml --workspace` right
after the bump: it updates only the workspace member's version in the lock
and leaves every dependency pin untouched, so --locked still guarantees
reproducible deps. Verified locally — reproduced the exact failure, then
confirmed the sync makes `cargo build --locked` succeed with 6 dependencies
unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0114TpmrNW4wNXsHq5CR72jQ
whitlocktech merged commit 09c59b256e into main 2026-07-14 16:58:11 +00:00
whitlocktech deleted branch fix/release-locked-lockfile 2026-07-14 16:58:12 +00:00
Sign in to join this conversation.
No description provided.