Skip to content

fix: unbreak cargo publish and stop shipping testdata in the crate - #10

Merged
tamada merged 3 commits into
mainfrom
fix/publish-cargo-lock-sync
Jul 29, 2026
Merged

fix: unbreak cargo publish and stop shipping testdata in the crate#10
tamada merged 3 commits into
mainfrom
fix/publish-cargo-lock-sync

Conversation

@tamada

@tamada tamada commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the cargo publish failure in the release pipeline, and stops the crate
from shipping test fixtures.

Both problems are live on main right now: run
30353306124
failed at publish_to_crates_io with

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

The Cargo.lock failure

main had Cargo.toml at 0.0.3 while the committed Cargo.lock still
recorded fauxrest 0.0.4. cargo publish re-resolves dependencies, rewrites
the lock file to match Cargo.toml, and then refuses to continue because the
working directory became dirty.

The drift comes from .github/scripts/update_version.sh, which rewrites
Cargo.toml and README.md but never touches Cargo.lock. Running
cargo build right after it regenerates the lock, and the existing
git commit -a in the same step picks it up — so this stops recurring.

The packaging change

Cargo.toml had no include/exclude, so cargo publish packaged the entire
repository. Adding exclude keeps testdata/, docs/, .github/ and
.vscode/ out of the published crate.

Order matters. Fixing Cargo.lock alone would make the next publish
succeed and upload testdata/ to crates.io. Both changes need to land
together, which is why they are in one pull request.

Also included

Six .vscode/tasks.json entries invoked the binary against a testdata
directory that no longer exists. They are removed; the remaining tasks are
untouched.

Verification

  • cargo build and cargo test pass (66 tests + 13 doctests)
  • Cargo.toml and Cargo.lock both report 0.0.3 after this change
  • Merging this does not trigger publish.yaml — that workflow only runs for
    head branches matching releases/v*

🤖 Generated with Claude Code

tamada and others added 3 commits July 28, 2026 20:36
main had Cargo.toml at 0.0.3 while the committed Cargo.lock still recorded
fauxrest 0.0.4, so `cargo publish` rewrote the lock file during dependency
resolution and then aborted with "1 files in the working directory contain
changes that were not yet committed into git: Cargo.lock".

update_version.sh only rewrites Cargo.toml and README.md, so the lock file
drifted on every release. Running `cargo build` after it regenerates the lock,
and `git commit -a` in the same step now picks it up.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
fauxrest 0.0.2 on crates.io shipped the whole testdata/ tree because the
package had no include/exclude. Restrict the package to the crate itself so
test fixtures, docs and CI configuration are no longer published.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Six tasks invoked the binary against testdata/tamadalab, which no longer
exists. The remaining tasks are untouched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tamada
tamada merged commit bba895e into main Jul 29, 2026
2 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