ci(rust): reject stale Cargo lockfiles - #3227
Merged
Merged
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
pimlock
marked this pull request as ready for review
September 8, 2026 22:44
pimlock
requested review from
a team,
derekwaynecarr,
mrunalp and
sjenning
as code owners
September 8, 2026 22:44
pimlock
force-pushed
the
ci-check-cargo-lockfiles/pm
branch
from
September 8, 2026 22:49
0ec142b to
57b6555
Compare
elezar
reviewed
Sep 10, 2026
elezar
previously approved these changes
Sep 10, 2026
elezar
left a comment
Member
There was a problem hiding this comment.
I think this looks good. Should this also be a precommit step or is that too heavyweight?
elezar
reviewed
Sep 10, 2026
Collaborator
Author
The rust lint (which is now |
krishicks
previously approved these changes
Sep 10, 2026
pimlock
enabled auto-merge
September 10, 2026 23:19
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
elezar
force-pushed
the
ci-check-cargo-lockfiles/pm
branch
from
September 11, 2026 08:32
c99b8c2 to
8b216fc
Compare
elezar
approved these changes
Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reject stale or silently rewritten Cargo lockfiles during Rust validation. Each Rust CI job finishes by validating every tracked workspace lockfile and checking that none differs from the checked-out commit. A successful build that refreshed a lockfile therefore still fails CI.
Local Rust lint, check, and test tasks validate lockfiles before running, including through pre-commit and local CI. Ordinary Cargo commands retain their normal behavior;
--lockedis confined to the metadata guard.Related Issue
No issue required: localized CI hardening prompted by #3226, where a standalone example lockfile had drifted outside the root Cargo workspace. The branch includes the correction merged in #3226.
Changes
Cargo.lockand validate it against its adjacent manifest using fullcargo metadata --locked, preserving Cargo diagnostics.git diff --exit-code HEAD -- ':(glob)**/Cargo.lock', including after earlier failures.Testing
mise run pre-commitpasses, including all four lockfile validations and strict Clippy for the workspace, E2E crate, and both examples. The log confirms the guard finishes before Clippy starts.git diff --check.Checklist