Skip to content

fix: drop path-patched crates from Cargo.lock, gate publish in CI - #3

Merged
BinFlip merged 1 commit into
mainfrom
fix/cargo-lock-publish
Sep 3, 2026
Merged

fix: drop path-patched crates from Cargo.lock, gate publish in CI#3
BinFlip merged 1 commit into
mainfrom
fix/cargo-lock-publish

Conversation

@BinFlip

@BinFlip BinFlip commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

The v0.5.0 publish workflow failed:

error: 1 files in the working directory contain changes that were not yet
committed into git:

    Cargo.lock

Cause

The committed Cargo.lock carried 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.toml on the machine the lock was last written on. Cargo strips
them in any checkout without that config, which dirties Cargo.lock, and
cargo publish refuses to run against a dirty tree.

Reproduced in a clean clone of main: cargo metadata alone deletes 64 lines
from Cargo.lock. The v0.4.1 lock had none of these entries, which is why that
release 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.0 is
still an available version.

Fix

Cargo.lock regenerated outside that config. No dependency versions change;
only the phantom entries are removed. cargo publish --dry-run now packages
and verifies cleanly.

Adds a Package CI job running cargo publish --dry-run, which performs the
same 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.0 tag and its GitHub release point at the broken commit and need to
be deleted and re-cut from the fixed main for the publish workflow to fire
again.

`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.
@BinFlip
BinFlip merged commit 3cd00a7 into main Sep 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant