chore(cua-driver-rs)(nix): cargoLock.lockFile + sync Cargo.lock on bump (kill version drift) - #1934
Conversation
…n bump (kill version drift) The release bump edits only Cargo.toml's `[workspace.package] version`, leaving Cargo.lock's 9 workspace-member versions stale. Nix pinned a manual `cargoHash` that hashes the vendored lockfile, so the committed lock + hash stayed mutually consistent (and green) only by never touching the lock — a frozen-inconsistent state that detonated the instant anyone ran `cargo build`, which re-locked the members and invalidated the hash, turning every nix job red (hit on PR #1933). The drift had silently accumulated across 0.5.3 -> 0.5.6. Three changes so this can't recur: 1. package.nix uses `cargoLock.lockFile` instead of `cargoHash`. importCargoLock derives each dep's hash from the lockfile itself, so there is NO hash to hand-maintain — Cargo.lock can change freely and the build keeps working. Verified the old "apple crates unreachable from crates.io" rationale is false: apple-cf/apple-metal/objc2 are all registry crates and there are zero git deps, so no `outputHashes` are needed. 2. package.nix reads `version` from Cargo.toml's `[workspace.package]` instead of a hardcoded literal (which had drifted to 0.5.3). 3. Re-locked Cargo.lock to 0.5.6, and the bump workflow now runs `cargo update --workspace` after bump2version and folds the synced lockfile into the bump commit (moving the tag), so the manifest and lockfile ship in sync every release. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR adds a release-bump workflow step for ChangesCargo.lock Synchronization for cua-driver-rs
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Linux visual regression artifactsMatrix jobs now run independently. Download visual artifacts from this workflow run.
|
The drift, and why it kept biting
The release bump (
bump2version) edits onlyCargo.toml's[workspace.package] version. It leavesCargo.lock's 9 workspace-member versions stale, and the Nix package pinned a manualcargoHashthat hashes the vendored lockfile. So the committed lock + hash stayed consistent (and green) only by never touching the lock — a frozen-inconsistent state that detonates the moment anyone runscargo build: it re-locks the members, diverges from the committed lock, and invalidates the hash → every Nix job goes red. That's what hit #1933. The drift had silently accumulated across 0.5.3 → 0.5.6 (Cargo.toml said 0.5.6; Cargo.lock +package.nixstill said 0.5.3).Fix — three changes so it can't recur
package.nixusescargoLock.lockFileinstead ofcargoHash.importCargoLockderives each dependency's fixed-output hash from the lockfile itself, so there is no hash to hand-maintain —Cargo.lockcan change freely (version bump, dep update) and the build keeps working. I verified the old "apple crates may be unreachable from crates.io" rationale is false:apple-cf/apple-metal/objc2are allregistry+crates.iowith checksums, and there are zero git deps (376 registry / 0 git), so nooutputHashesoverrides are needed.package.nixreadsversionfromCargo.toml([workspace.package]) instead of a hardcoded literal (which had drifted to 0.5.3).Cargo.lockto 0.5.6, and the bump workflow now runscargo update --workspaceafterbump2versionand folds the synced lockfile into the bump commit (moving the tag), so the manifest and lockfile ship in sync every release.Verification
cargoLock.lockFile(the load-bearing change — confirms importCargoLock vendors the full dep set with no hash). I can't run Nix on the dev box, so CI is the gate.Cargo.lockdiff is only the 9 workspace-member version bumps (0.5.3→0.5.6); no registry deps changed.Cargo.lockchanged; only forcua-driver-rs) andcargois preinstalled on the runner.🤖 Generated with Claude Code
Summary by CodeRabbit