fix: drop path-patched crates from Cargo.lock, gate publish in CI - #3
Merged
Conversation
`cargo publish` for v0.5.0 failed: the committed `Cargo.lock` carried sixteen entries for unrelated sibling crates (analysir, dotscope, nimrod, …). They come from a `[patch.crates-io]` block in a parent `.cargo/config.toml` on the machine the lock was last written on, and cargo strips them in any other checkout — which leaves the working directory dirty and makes `cargo publish` refuse. The lock is regenerated outside that config. No dependency versions change; only the phantom entries go. Adds a `Package` CI job running `cargo publish --dry-run`, which performs the same git-cleanliness and packaging checks as a real publish. The existing jobs (test, clippy, fmt, doc) all passed on the release commit, so nothing caught this before the release workflow ran.
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.
The v0.5.0 publish workflow failed:
Cause
The committed
Cargo.lockcarried sixteen entries for unrelated sibling crates—
analysir,analyssa,autoit-rs,darwinscope,dotscope,innospect,mallabel,nimrod,nsis,pascalscript,securs-*,undelphi,visualbasic. They come from a[patch.crates-io]block in a parent.cargo/config.tomlon the machine the lock was last written on. Cargo stripsthem in any checkout without that config, which dirties
Cargo.lock, andcargo publishrefuses to run against a dirty tree.Reproduced in a clean clone of
main:cargo metadataalone deletes 64 linesfrom
Cargo.lock. The v0.4.1 lock had none of these entries, which is why thatrelease published fine — the pollution was in the working tree when the 0.5.0
branch was cut and went in with it.
Nothing reached crates.io: the publish aborted before upload, so
0.5.0isstill an available version.
Fix
Cargo.lockregenerated outside that config. No dependency versions change;only the phantom entries are removed.
cargo publish --dry-runnow packagesand verifies cleanly.
Adds a
PackageCI job runningcargo publish --dry-run, which performs thesame git-cleanliness and packaging checks as a real publish. Test, clippy, fmt
and doc all passed on the release commit, so nothing existing could have caught
this — the release workflow was the first thing to run publish.
After merge
The
v0.5.0tag and its GitHub release point at the broken commit and need tobe deleted and re-cut from the fixed
mainfor the publish workflow to fireagain.