Repository navigation
ci(vet): pin cargo-vet to 0.10.2, the version that parses publisher trust - #2357
Merged
Merged
Conversation
…rust `Update Exemptions` has failed on every Cargo.lock PR since #2323: ERROR × Failed to parse toml file ╰─▶ missing field `user-id` for key `trusted.mach2` My first diagnosis was that no released cargo-vet understands the `trusted-publisher` key those entries use, and that they should be rewritten as `user-id` entries. Both halves were wrong, and testing locally is what showed it. cargo-vet 0.10.2 parses the store and vets it: "Vetting Succeeded (320 fully audited, 3 partially audited, 228 exempted)". It also suggests `cargo vet trust <crate> github:owner/repo` on its own. So the entries are valid. They are also the only form that works here. Every version we depend on -- mach2 0.6.0, pin-project-lite 0.2.17, portable-atomic 1.15.0 -- was published through trusted publishing, with NO publishing user; earlier versions of all three came from a user. A `user-id` entry would therefore match nothing and silently grant none of the trust it appears to, which is the failure #2321 was about. Rewriting them, as I had started to do, would have quietly turned three trusted crates into exemptions. The defect is the version CI installs. `taiki-e/install-action` with an unversioned `tool: cargo-vet` takes the newest GitHub RELEASE -- v0.10.0, from 2024-10-03 -- which predates the feature. Its manifest offers no 0.10.2 (checked: it lists 0.10 and 0.10.0), and there is no 0.10.2 GitHub release for its binstall fallback either, so the pin has to go through crates.io: cargo install cargo-vet --version 0.10.2 --locked Pinned in supply-chain.yml as well. That job was resolving its own version from crates.io, so the two could disagree about whether this store parses; now they cannot. Verified locally, with the exact commands CI runs: the install succeeds and yields 0.10.2, `cargo vet regenerate exemptions` exits 0, and `cargo vet --locked` succeeds. Two things found while verifying: `cargo vet check` -- what a contributor runs, without `--locked` -- fails on main for a missing `audit-as-crates-io` entry on rustledger-budget, rustledger-ops and rustledger-returns, three first-party crates absent from a list of fourteen. CI's invocation does not reach that check, which is why it went unnoticed. Added, and `check` now succeeds. `regenerate exemptions` prunes one stale exemption (rustls-webpki 0.103.15). That is the fixed automation's own output, so it ships here rather than waiting for the next dependency PR. The job is path-gated on Cargo.lock, so it will not run on this PR; the evidence is the local runs above, and re-running it on #2354 after this merges. Closes #2355
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
✅ Compatibility Test Results
What's tested
Full results available in workflow artifacts |
…s.lock
My own change broke the `Cargo Vet` job on this PR:
Vetting Failed!
rustls-webpki:0.103.15 missing ["safe-to-deploy"]
I had kept half of one output. `cargo vet regenerate exemptions` pruned that
exemption AND updated imports.lock, which is what made it prunable: the audit
covering the crate came from a freshly fetched import. I reverted imports.lock
to keep this PR focused on the version pin and kept the pruning, so the store
claimed an exemption was unnecessary while the audit that replaced it was no
longer there.
It passed locally because my tree still held the fetched imports at that moment.
CI runs `cargo vet --locked`, which forbids fetching them, so the crate came out
unvetted. Verified the fix with `--locked` this time, the flag CI actually uses,
rather than the bare command.
The exemption is back, so this PR now touches only the version pin and the three
missing `audit-as-crates-io` entries; exemptions are byte-identical to main. The
automation can prune it on the next dependency PR, when it updates imports.lock
in the same commit -- which is the point of that job, and it works again once
this merges.
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.
Closes #2355.
The failure
Update Exemptionshas failed on everyCargo.lockPR since #2323:My first diagnosis was wrong, both halves
I filed #2355 saying no released
cargo-vetunderstands thetrusted-publisherkey those entries use, and that they should be rewritten as
user-identries.Testing locally showed otherwise:
cargo-vet 0.10.2 parses the store and vets it — "Vetting Succeeded (320
fully audited, 3 partially audited, 228 exempted)" — and suggests
cargo vet trust <crate> github:owner/repoon its own.user-idis the wrong form here. Every version we depend on was publishedthrough trusted publishing, with no publishing user:
mach2pin-project-liteportable-atomicA
user-identry would match nothing and silently grant none of the trust itappears to — the failure mode chore(deps): Rust 1.98.1, flake refresh, and all dependency updates #2321 exists to prevent. Rewriting them, which I
had started, would have quietly turned three trusted crates into exemptions.
#2355 now carries that correction at the top.
The actual defect: the version CI installs
taiki-e/install-actionwith an unversionedtool: cargo-vettakes the newestGitHub release, v0.10.0 (2024-10-03), which predates the feature. Its
manifest offers no 0.10.2 (it lists
0.10and0.10.0), and there is no 0.10.2GitHub release for its binstall fallback either — so the pin goes through
crates.io:
Pinned in
supply-chain.ymltoo: that job resolved its own version fromcrates.io, so the two could disagree about whether this store parses.
Verified with the exact commands CI runs
cargo install cargo-vet --version 0.10.2 --lockedcargo-vet 0.10.2, exit 0cargo vet regenerate exemptions(the failing job)cargo vet --locked(Cargo Vetjob)cargo vet check(bare, what a contributor runs)mainThis PR cannot prove the fix through its own CI: the job is path-gated on
Cargo.lock, which this PR does not touch, andpull_request_targetworkflowsrun from the base branch. The evidence is the local runs above; after this
merges, re-running the job on #2354 exercises it for real.
Two things found while verifying
cargo vet checkfails onmainfor a missingaudit-as-crates-ioentryon
rustledger-budget,rustledger-opsandrustledger-returns— threefirst-party crates absent from a list of fourteen. CI's
--lockedinvocationnever reaches that check, which is why it went unnoticed. Added.
rustls-webpki 0.103.15) — the fixedautomation's own output, shipped here rather than waiting for the next
dependency PR.
🤖 Generated with Claude Code
https://claude.ai/code/session_012nNGPA44Dt32NyxWem26xr