Skip to content

ci: Add xtask infra + reverse dependency testing#435

Merged
cgwalters merged 1 commit intoalexcrichton:mainfrom
cgwalters:revdep-testing
Mar 3, 2026
Merged

ci: Add xtask infra + reverse dependency testing#435
cgwalters merged 1 commit intoalexcrichton:mainfrom
cgwalters:revdep-testing

Conversation

@cgwalters
Copy link
Copy Markdown
Collaborator

Previously we added semver checks which is
great, but this will (hopefully) catch non-API breakages that we may have missed in unit tests.


The xtask pattern is a good way to capture ad-hoc workflows that one might otherwise write in a poor language like bash.

Add the infra for that, and then add a revdep-test verb which also gets wired up to CI.

This clones a few (ad-hoc selected) projects which use this crate. Then we patch their Cargo.toml to use our local checkout and run their test suite.

The goal is just more testing; prep for more work on this crate.

Assisted-by: OpenCode (Claude Opus)

@cgwalters cgwalters marked this pull request as draft March 2, 2026 23:04
@cgwalters cgwalters marked this pull request as ready for review March 2, 2026 23:38
@cgwalters cgwalters requested a review from xzfc March 2, 2026 23:38
Comment thread xtask/src/main.rs
Comment on lines +16 to +18
- uses: Swatinem/rust-cache@v2
with:
workspaces: xtask
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: it seems that the cache works for xtask itself, but not for cloned revdeps.

I've retriggered CI to check this:

Perhaps a shared CARGO_TARGET_DIR/--target-dir/build.target-dir can make it work.

Tho maybe saving 6 minutes on CI don't worth it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried this, but it broke the cargo-vendor-filterer tests for obscure reasons (it expects target/ in a different place).

I don't think we'll have a volume of PRs where the caching matters.

(Of course this topic of CI efficiency does relate to the fact that right now CI here just uses the $0 GHA budget allocated to alex's personal projects...)

The [xtask pattern](https://github.com/matklad/cargo-xtask) is
a good way to capture ad-hoc workflows that one might otherwise write
in a poor language like bash.

Add the infra for that, and then add a `revdep-test` verb which
also gets wired up to CI.

This clones a few (ad-hoc selected) projects which use this crate.
Then we patch their Cargo.toml to use our local checkout and run their test suite.
Revdeps are pinned to release tags where possible (cargo 0.94.0,
cargo-vendor-filterer v0.5.18) for easy auditing; crates.io retains a
commit hash since it has no tags.

The cargo test filter `package::` is a substring match so we skip
unrelated cargo snapshot tests (cargo_add, cargo_info, etc.) that would
otherwise fail due to Rust version differences.

The goal is just more testing; prep for more work on this crate.

Assisted-by: OpenCode (Claude Opus)
Signed-off-by: Colin Walters <walters@verbum.org>
@cgwalters cgwalters merged commit 638c495 into alexcrichton:main Mar 3, 2026
10 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.

2 participants