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.
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
bootstrap: consolidate subcommand parsing and matching #96003
bootstrap: consolidate subcommand parsing and matching #96003
Changes from all commits
870cb8e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Why did this change?
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 was part of the logic for printing the hint to run with
-h -v
to see available paths if and only if there are paths that we could list for that subcommand.For example, in Rust now if you run
./x.py clippy -h
it will suggestRun './x.py clippy -h -v' to see a list of available paths.
, but when you run./x.py clippy -v -v
it doesn't actually list any paths.My assumption was that all of these commands could have useful paths to pass to them but I might be mistaken about that. It seems like check and clippy would take paths just like build does, but it kinda seems like clippy runs for "everything" in the build graph anyway and passing paths doesn't do much.
Is this specific list of commands which could print a list of paths for help text intentional and the others (clippy, check, fix) are supposed to be excluded?
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 is not currently true. There are several related issues:
x clippy
, as you noticed, runs on the whole tree.x clean
does the same.x clippy src/bootstrap
is exactly the same as an unconditionalx clippy
.StepDescription
. For examplex fmt src/bootstrap
is perfectly valid and limits the changes to bootstrap itself, but there is noimpl Step for Format
description, becauseStep
has no way to say "all paths".Fixing those issues should wait for follow up PRs, I think. In the meantime, can you do the following:
clippy
andfix
from thecheck
arm and down to thevec![]
arm.clippy
is certainly not supported with paths, andfix
has been broken for ages.usage
that callsget_help
to panic if-h -v
is called for a subcommand that does not support paths. We should give the user an idea that something is broken rather than silently ignoring the flag.