-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Fix x setup -h -v
should work
#96584
Conversation
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 for tackling this! It looks like basically the right approach, I just have a few comments on the implementation.
I also noticed that the should_run
step is never actually hit, because setup
is still special-cased in Flags::parse
. Is it possible to remove that special-casing? You should double check that x setup
without arguments still works (you probably will need to add DEFAULT = true
in the Step impl) and that x setup invalid
properly goes through the "no paths matched" path instead of "called unwrap on None".
One super cool thing to do is to still keep the description of each path, like it has currently:
Arguments:
This subcommand accepts a 'profile' to use for builds. For example:
./x.py setup library
The profile is optional and you will be prompted interactively if it is not given.
The following profiles are available:
library: Contribute to the standard library
compiler: Contribute to the compiler itself
codegen: Contribute to the compiler, and also modify LLVM or codegen
tools: Contribute to tools which depend on the compiler, but do not modify it directly (e.g. rustdoc, clippy, miri)
user: Install Rust from source
That will probably require modifying ShouldRun
to allow passing in a description for the alias, though - no need to tackle it just now if it's tricky.
r? @Mark-Simulacrum just so this has someone assigned, but happy to be in charge of the review.
Hi @jyn514, quick question here I am working on changing If I do
If i do
I am abit stuck here, what is the best way to approach this? Thanks a bunch! |
@bentongxyz I think it will work if you remove the call to clone: |
@jyn514 still no good, if I do
|
174a5c6
to
18c337e
Compare
Thank you for your review!
If this is ok, maybe this could be the goal for my next PR? I am looking for further work to do for the project too :) |
@bentongxyz try this: Subcommand::Setup { ref path } => (Kind::Setup, if let Some(p) = path { std::slice::from_ref(p) } else { &[] }), (this assumes
Sounds great! thanks for working on this :) @rustbot label +A-rustbuild +S-waiting-on-author +C-cleanup |
Error: The "Ready" shortcut only works on pull requests. Please let |
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #96846) made this pull request unmergeable. Please resolve the merge conflicts. |
435a6ee
to
27af695
Compare
Hi @jyn514, in the meantime, please let me know if there is anything that I can work on :) |
Hi @bentongxyz - #86890 is a good issue to try out (it's a little harder to test than this one, but not too bad), or you could go with the first approach I mentioned in #96584 (comment) so you don't have to wait for my PR to land. @rustbot label -S-waiting-on-review +S-blocked |
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 great! Thanks for the PR :)
@jyn514 Thank you! I will take a look at #86890. Meanwhile, I made changes to See if it is okay for merge without needing #96501 to land first. I can also help refactor it after #96501 is done! |
Thanks. We don't accept merge commits on this repo so kindly unmerge it and rebase it instead. |
some changes were reverted following this comment #96584 (comment) , I have changed back to single path, please see the new commit :) |
@rustbot ready |
@bors r+ rollup Sorry for the long delay! This looks good :) |
🌲 The tree is currently closed for pull requests below priority 1. This pull request will be tested once the tree is reopened. |
… r=jyn514 Fix `x setup -h -v` should work r? `@jyn514` I have to convert profile to path and back in order to remove special-casing in bootstrap. I also check for `dry_run` so that `config.toml` and/ or `.git/hooks/pre-push` will not be created if `--dry-run` is specified. Please help me see if this is ok, thanks alot!
@bentongxyz you need to rebase one last time, |
☔ The latest upstream changes (presumably #105328) made this pull request unmergeable. Please resolve the merge conflicts. |
- Remove setup special-casing in Flags::parse
b2bc65b
to
fca8290
Compare
@@ -351,7 +351,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`", | |||
|
|||
// fn usage() | |||
let usage = |exit_code: i32, opts: &Options, verbose: bool, subcommand_help: &str| -> ! { | |||
let config = Config::parse(&["build".to_string()]); | |||
let config = Config::parse(&["setup".to_string()]); |
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.
this change is so x setup one two
doesn't update submodules before showing the usage error
@bors r+ |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#96584 (Fix `x setup -h -v` should work) - rust-lang#105420 (Remove dead code after destination propagation) - rust-lang#105844 (Make the x tool use the x and x.ps1 scripts) - rust-lang#105854 (remove redundant clone) - rust-lang#105858 (Another `as_chunks` example) - rust-lang#105870 (avoid .into() conversion to identical types) - rust-lang#105875 (don't destuct references just to reborrow) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
r? @jyn514
I have to convert profile to path and back in order to remove special-casing in bootstrap. I also check for
dry_run
so thatconfig.toml
and/ or.git/hooks/pre-push
will not be created if--dry-run
is specified.Please help me see if this is ok, thanks alot!