Skip to content

CI: Verify Cargo.lock sync with Cargo.toml without updating dependencies #1470

@coderabbitai

Description

@coderabbitai

Context

Problem

  • The current "Validate lock files" step in clp-rust-checks may perform an update or otherwise mutate the lockfile, which undermines deterministic behaviour and creates noisy diffs.

Goals

  • Determine a reliable, non-mutating way to fail CI when Cargo.lock is out-of-sync with Cargo.toml.
  • Keep the step fast and side-effect free.

Ideas to evaluate

  • Use "cargo metadata --locked" (fast, no build; fails if the lockfile needs updates).
  • Use "cargo check --locked" (compiles; also fails if the lockfile needs updates).
  • Use "cargo fetch --locked" (network-only; fails if the lockfile is missing/out-of-date).
  • Ensure all workspace members are covered.

Acceptance criteria

  • A documented command/script that exits non-zero when Cargo.lock is not in sync with Cargo.toml and never modifies files.
  • CI updated to run this command as part of clp-rust-checks.
  • Taskfile target (e.g., deps:lock:check-rust) updated accordingly.
  • Works for both PRs and direct pushes.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions