Consistently use --locked for cargo commands - #7040
Open
jieyouxu wants to merge 7 commits into
Open
Conversation
jieyouxu
marked this pull request as draft
August 21, 2026 10:01
Member
Author
|
Oh that's interesting, right, we don't check in lockfiles for the integration crates (since we just clone the repos) |
Contributor
|
We should also add Lines 580 to 589 in 3210089 |
Even when locally, to minimize supply-chain risk from very-new registry artifacts.
jieyouxu
force-pushed
the
jieyouxu/ci/lock
branch
from
August 24, 2026 09:15
1583369 to
8bc4bd7
Compare
jieyouxu
force-pushed
the
jieyouxu/ci/lock
branch
from
August 24, 2026 09:17
8bc4bd7 to
7425b21
Compare
jieyouxu
commented
Aug 24, 2026
Member
Author
There was a problem hiding this comment.
Discussion: I considered if we can use --locked for the ecosystem integration tests. My assessment is that we can't in the general case:
- Some of these, like
bitflags, are library crates that do not check in a lockfile. We can technically patch in a lockfile ourselves but that's a maintenance PITA. - We could consider using
--lockediff the repo has a lockfile, but cf. no-lockfile case above.
Member
Author
|
Changes since last review:
The ecosystem crate case feels a bit iffy to me, because that's a very large surface area versus rustfmt's own dependency graph. I think that will be helped once cargo stabilizes @rustbot review |
jieyouxu
marked this pull request as ready for review
August 24, 2026 09:41
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
Helps with #7037 but does not completely adddress it:
--locked.For cases modulo the ecosystem integration tests, use
--lockedconsistently -- in CI, bootstrap, docs, test harness, so that we use the exact dependencies checked in viaCargo.locklockfiles instead of floating resolution, where we risk being exposed to fresh supply-chain attacks1.Reminded me to double-check after yesterday's supply-chain attack.
Footnotes
Obviously this won't help with long-term supply-chain attacks that get into the lockfile, but defense-in-depth etc. ↩