-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Support multiple --target
flags on the CLI
#8167
Conversation
r? @ehuss (rust_highfive has picked a reviewer for you, use r? to override) |
Hm, so if I'm interpreting this right, we would expect that e.g. rustbuild would (eventually) start using this to parallelize the std-building on our dist-various builders, right? That would (I imagine) see some pretty good improvement in CI times, especially on the many-core builders we're getting with GHA. I haven't actually read the PR to determine if that's true, though. |
@Mark-Simulacrum I'd be pretty surprised if rustbuild could take advantage of this tbh, although it's perhaps not completely out of the question. It would likely take a large-ish refactoring because there'd no longer be a |
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.
Looks like there are a couple nightly-only tests that need to be fixed.
I noticed that it does not handle multiple --target
flags with the same value very well (Cargo hangs acquiring the file lock). Perhaps BuildConfig::requested_kinds
should be a set? Or maybe there should be some deduplication in from_requested_targets
?
Oops I remember thinking I should write a test and handle that and then I must have gotten distracted before implementing a fix for that... |
8709171
to
25c25ec
Compare
Updated! Thanks for the keen eye |
☔ The latest upstream changes (presumably #8177) made this pull request unmergeable. Please resolve the merge conflicts. |
This commit refactors the internals of Cargo to no longer have a singular `--target` flag (and singular `requested_target` kind throught) but to instead have a list. The semantics of multiple `--target` flags is to build the selected targets for each of the input `--target` flag inputs. For now this is gated behind `-Zmultitarget` as an unstable features, since I'm not entirely sure this is the interface we want. In general it'd be great if we had a way to simply specify `Unit` structures of what to build on the CLI, but we're in general very far away from that, so I figured that this is probably sufficient at least for testing for now. cc rust-lang#8156
25c25ec
to
3fd2814
Compare
👍 |
📌 Commit 3fd2814 has been approved by |
☀️ Test successful - checks-azure |
Woah this is unexpectedly efficient. |
Fix doctests not running with --target=HOST. There was a regression in #8167 where `cargo test --target=$HOST` stopped running doctests. This caused doctests to silently stop running in rust-lang/rust (rust-lang/rust#73286). This PR restores the original behavior where `--target=$HOST` behaves as-if it is a normal host test. There was a discussion about this at #8167 (review), but I think I let it slip through the cracks.
This commit refactors the internals of Cargo to no longer have a
singular
--target
flag (and singularrequested_target
kind throught)but to instead have a list. The semantics of multiple
--target
flagsis to build the selected targets for each of the input
--target
flaginputs.
For now this is gated behind
-Zmultitarget
as an unstable features,since I'm not entirely sure this is the interface we want. In general
it'd be great if we had a way to simply specify
Unit
structures ofwhat to build on the CLI, but we're in general very far away from that,
so I figured that this is probably sufficient at least for testing for
now.
cc #8156