-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Rework cargo-test-support
& testsuite
to use CARGO_BIN_EXE_*
for Cargo
#15692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+992
−957
Conversation
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
epage
reviewed
Jun 23, 2025
epage
reviewed
Jun 23, 2025
71f7c4a
to
843083d
Compare
843083d
to
b553378
Compare
epage
reviewed
Jun 24, 2025
epage
reviewed
Jun 24, 2025
epage
reviewed
Jun 24, 2025
epage
reviewed
Jun 24, 2025
b553378
to
1d064ab
Compare
1d064ab
to
02b56d4
Compare
Okay sorry, I cleaned up the commits. (Not quiet sure what happened) I split out the commits as you suggested in this comment and updated the testing documentation as well |
epage
approved these changes
Jun 26, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
bors
added a commit
to rust-lang/rust
that referenced
this pull request
Jun 29, 2025
Update cargo 7 commits in 409fed7dc1553d49cb9a8c0637d12d65571346ce..930b4f62cfcd1f0eabdb30a56d91bf6844b739bf 2025-06-23 15:55:04 +0000 to 2025-06-28 14:58:43 +0000 - Use a different lint for the `fix_only_once_for_duplicates` test (rust-lang/cargo#15713) - chore: bump to 0.91.0; update changelog (rust-lang/cargo#15710) - Add `http.proxy-cainfo` config for proxy certs (rust-lang/cargo#15374) - chore(deps): update msrv (3 versions) to v1.86 (rust-lang/cargo#15709) - chore(deps): update msrv (1 version) to v1.88 (rust-lang/cargo#15706) - Rework `cargo-test-support` & `testsuite` to use `CARGO_BIN_EXE_*` for Cargo (rust-lang/cargo#15692) - fix: Expand error messages around path dependency on `cargo package` and `cargo publish` (rust-lang/cargo#15705)
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Jun 29, 2025
Update cargo 7 commits in 409fed7dc1553d49cb9a8c0637d12d65571346ce..930b4f62cfcd1f0eabdb30a56d91bf6844b739bf 2025-06-23 15:55:04 +0000 to 2025-06-28 14:58:43 +0000 - Use a different lint for the `fix_only_once_for_duplicates` test (rust-lang/cargo#15713) - chore: bump to 0.91.0; update changelog (rust-lang/cargo#15710) - Add `http.proxy-cainfo` config for proxy certs (rust-lang/cargo#15374) - chore(deps): update msrv (3 versions) to v1.86 (rust-lang/cargo#15709) - chore(deps): update msrv (1 version) to v1.88 (rust-lang/cargo#15706) - Rework `cargo-test-support` & `testsuite` to use `CARGO_BIN_EXE_*` for Cargo (rust-lang/cargo#15692) - fix: Expand error messages around path dependency on `cargo package` and `cargo publish` (rust-lang/cargo#15705)
22 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-documenting-cargo-itself
Area: Cargo's documentation
A-testing-cargo-itself
Area: cargo's tests
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
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.
What does this PR try to resolve?
This PR reworks
cargo-test-support
andtestsuite
to use Snapbox'scargo_bin!()
instead ofcargo_bin()
which makes assumptions about the structure of Cargo's build directory.cargo_bin!()
usesCARGO_BIN_EXE_*
for locating thecargo
binary which should be more resilient to directory/layout changes.Linking a relevant Zulip discussion here#t-cargo > cargo_bin_exe and tests
As shown in that link, we could make these variables available at runtime and not need to do this. However,
cargo-test-support
, as an API, is a bit weird in that it is baking in support for one specific binary. This can be confusing for callers and makes it more annoying for callers provide their ownfn cargo
, e.g. see crate-ci/cargo-fixit#7Implementation Notes
cargo_bin!()
only works when being called from thetestsuite
as it's only set when executing integration tests andcargo-test-support
is a regular crate.To make this change, I introduced an extension trait
CargoProjectExt
intestsuite
for running.cargo()
and implemented it onProject
.In
cargo-test-support
other functionality relies on.cargo()
so these also needed to be moved totestsuite
src/tools.rs
src/cross_compile
disabled()
requires running Cargo to check if we should disable cross compile tests.cross_compile
are used incargo-test-support
so moving everything totestsuite
would have ended up requiring moving many things to test suite.How to test and review this PR?
I'd definitely recommend reviewing commit by commit.
There are a lot of diffs due to the nature of reorganizing things.
I did my best to split things things into smaller PRs but they still contain a lot of
use
statement diffs.r? @epage