-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Add an alias from cargo x to cargo run -- #95980
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
5fc2c0b
to
f8bc0d5
Compare
I think this will interact poorly with vendoring: rust/src/bootstrap/bootstrap.py Lines 1187 to 1206 in 52ca603
maybe we can change that check to see if .cargo/config differs from the default? and remove the rmtree(.cargo) call?
|
I am not sure this is really worth it -- do we think that the long-term expectation for user interface is cargo x build? I think it might be worth holding off on a change like this PR until we have a clearer story around For example, for cargo test, I think there may be a pretty clear path to that running the bootstrap process and passing off any arguments as today's arguments to x.py test. cargo fmt seems like it should be largely in a similar place of 'works out of the box' with some work (perhaps upstream to it as a tool). For doc, build, and check, the story is more complicated -- honestly, mostly because all three lack a clear integration point for non-Cargo tools to step in. It's not clear to me yet what our goal here should be (e.g., we could push for rustbuild-specific features in Cargo, but I think no one is a fan of that trajectory). Maybe there's a general integration point -- similar to https://github.com/matklad/cargo-xtask/, but without .cargo/config.toml modifications which feel to me like somewhat of an anti-pattern (it's sort of a user, not upstream file, it seems to me). It might be that we push for ability to declare aliased commands from Cargo.toml, pointing to subcrates in the workspace explicitly, as an unstable feature. That could mean a natural path for xbuild/xdoc/xcheck and so on to work out of the box, for example, if you already have a local rustc sysroot. Features like that have stalled out historically, but I think given a strong use case and interested hands, it's not impossible we could add something quite limited and unstable, though likely hard. |
To elaborate a little on the .cargo/config.toml concern -- I think I recall hearing that some consumers of rustc tarballs and git trees generating or using that file to add their own settings (alongside the config.toml file from x.py), so I am hesitant to start expanding the amount of things we ourselves put in it as default. It's not insurmountable as a concern, but I think we're not at the point of knowing it's the right trajectory from my perspective. |
Close it for now. |
Replied here: #95858 (comment) (but I do agree it makes sense to hold off until it's more clear where we want to end up with the entrypoint) |
close #95858