Repository navigation
chore(deps): put thrust-preview-provisioner in Cargo.lock where cargo sorts it - #284
Merged
Merged
Conversation
… sorts it #279 added the `thrust-preview-provisioner` entry after `thrust-profiling`; cargo sorts it before. `cargo metadata --locked`, which is what CI runs, accepts the file as committed, so nothing failed. But any cargo command without `--locked` rewrites it, so a clean checkout is dirty after its first plain cargo run (measured on main at 15bcfb0: 14 lines moved, nothing else). This commits what cargo writes. Shown: in the committed file exactly 2 of 491 packages are not where sorting puts them (the pair), and in this one none (a script that compares in cargo's order, versions as versions, so that 0.9.1 comes before 0.10.1). The two files have the same 5225 lines (a sorted comparison is identical): a move, with no dependency or version changed. A second plain cargo run leaves the new file byte-identical, and `cargo metadata --locked` accepts it. Not established: why the entry was put there. #279 is a single-parent squash commit, so it was not the resolution of a merge conflict; a hand-written entry is the likely cause, and `--locked` does not catch one. Refs: #279 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
aRustyDev
enabled auto-merge (squash)
November 17, 2026 21:13
aRustyDev
added a commit
that referenced
this pull request
Nov 17, 2026
…fails CI and not the next checkout (#288) `cargo metadata --locked`, which every other step runs, accepts a lockfile whose packages are in the wrong order, and a cargo command without `--locked` then rewrites the file. #279 added `thrust-preview-provisioner` one place late and #284 moved it; nothing had failed in between, and a clean checkout of `main` was dirty after its first cargo run. Nothing in CI could have said so. `scripts/check-cargo-lock.sh` runs `cargo metadata` without `--locked` and fails (exit 1, with the diff) when the lockfile is not what cargo wrote back, which also catches a lockfile that has not heard of a change to a manifest. It exits 2 when it cannot vouch (no Cargo.toml, no lockfile, cargo failing). It puts the lockfile back as it found it whatever the result, so it never leaves a checkout dirty. `--self-test` builds small workspaces with no dependencies and checks the accept and refuse cases against cargo's own output (no network). - `.github/workflows/lint.yml`: two steps of the `deps` job, the self-test and the check. - `.github/scripts/plan-ci.py`: the script is a guard of the `deps` job (`deps` and `ci-scripts`), and not "a script this planner does not know", which runs everything. `Cargo.lock` itself already runs everything. - `docs/src/testing/running.md`: the two commands and the `deps` row. Controls (AGENTS.md rule 8): the guard on the lockfile as it was before #284 (`git show 15bcfb0:Cargo.lock`) exits 1 and prints the 14-line move, and leaves that file as it found it; on the real lockfile it exits 0 (491 packages) and the tree stays clean. Four broken copies of the script each fail the self-test on the cases that guard the broken line: cargo run with `--locked` (the disorder is accepted, 2 cases fail), no restore after a rewrite (2), a cargo failure counted as success (1), a check that accepts any change (4). The self-test is 10 of 10 on macOS and under dash on Linux. Refs: #284 Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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.
Cargo.lockonmainhas thethrust-preview-provisionerentry one place too late, afterthrust-profilingwhere cargo sorts it before. This moves it where cargo puts it. No dependency or version changes.Why it matters
cargo metadata --locked, which CI runs, accepts the file as committed, so nothing has failed. But any cargo command without--lockedrewrites it, so a clean checkout is dirty after its first plain cargo run. I met it as a strayM Cargo.lockafter switching a worktree tomain; it is not part of anyone's change, and the next person's firstcargo buildmakes it theirs to notice and discard, or to commit by accident.Shown
mainat15bcfb0:cargo metadata --lockedexit 0, nothing changed;cargo metadatawithout it rewrites the file, 14 lines moved and nothing else.thrust-profilingandthrust-preview-provisioner); in the new file none (a throwaway script that compares in cargo's order, versions as versions, so that 0.9.1 comes before 0.10.1; my first version compared them as text and reported ten false positives, which is why the check is stated that way).cargo metadata --lockedstill accepts it.fmt, clippy for the workspace, forthrust-api-v1with its feature and for the Worker's and the edge's wasm32 targets,cargo metadata --locked) and all 22 steps of thedepsjob pass on this tree, and none of them changed the file.Not established
--lockeddoes not catch one, so this can happen again. A guard would be cheap (a plaincargo metadata, thengit diff --exit-code Cargo.lock), but it is not in this PR.Refs: #279
🤖 Generated with Claude Code