-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Save x.py's help text for saving output time #146692
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
|
||
Usage: x.py <subcommand> [options] [<paths>...] | ||
|
||
Commands: | ||
build Compile either the compiler or libraries | ||
check Compile either the compiler or libraries, using cargo check | ||
clippy Run Clippy (uses rustup/cargo-installed clippy binary) | ||
fix Run cargo fix | ||
fmt Run rustfmt | ||
doc Build documentation | ||
test Build and run some test suites | ||
miri Build and run some test suites *in Miri* | ||
bench Build and run some benchmarks | ||
clean Clean out build directories | ||
dist Build distribution artifacts | ||
install Install distribution artifacts | ||
run Run tools contained in this repository | ||
setup Set up the environment for development | ||
vendor Vendor dependencies | ||
perf Perform profiling and benchmarking of the compiler using `rustc-perf` | ||
|
||
Arguments: | ||
[PATHS]... paths for the subcommand | ||
[ARGS]... arguments passed to subcommands | ||
|
||
Options: | ||
-v, --verbose... | ||
use verbose output (-vv for very verbose) | ||
-i, --incremental | ||
use incremental compilation | ||
--config <FILE> | ||
TOML configuration file for build | ||
--build-dir <DIR> | ||
Build directory, overrides `build.build-dir` in `bootstrap.toml` | ||
--build <BUILD> | ||
host target of the stage0 compiler | ||
--host <HOST> | ||
host targets to build | ||
--target <TARGET> | ||
target targets to build | ||
--exclude <PATH> | ||
build paths to exclude | ||
--skip <PATH> | ||
build paths to skip | ||
--include-default-paths | ||
include default paths in addition to the provided ones | ||
--rustc-error-format <RUSTC_ERROR_FORMAT> | ||
rustc error format | ||
--on-fail <CMD> | ||
command to run on failure | ||
--dry-run | ||
dry run; don't build anything | ||
--dump-bootstrap-shims | ||
Indicates whether to dump the work done from bootstrap shims | ||
--stage <N> | ||
stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.) | ||
--keep-stage <N> | ||
stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1) | ||
--keep-stage-std <N> | ||
stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1) | ||
--src <DIR> | ||
path to the root of the rust checkout | ||
-j, --jobs <JOBS> | ||
number of jobs to run in parallel | ||
--warnings <deny|warn> | ||
if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour [default: default] [possible values: deny, warn, default] | ||
--json-output | ||
use message-format=json | ||
--compile-time-deps | ||
only build proc-macros and build scripts (for rust-analyzer) | ||
--color <STYLE> | ||
whether to use color in cargo and rustc output [default: auto] [possible values: always, never, auto] | ||
--bypass-bootstrap-lock | ||
Bootstrap uses this value to decide whether it should bypass locking the build process. This is rarely needed (e.g., compiling the std library for different targets in parallel) | ||
--rust-profile-generate <PROFILE> | ||
generate PGO profile with rustc build | ||
--rust-profile-use <PROFILE> | ||
use PGO profile for rustc build | ||
--llvm-profile-use <PROFILE> | ||
use PGO profile for LLVM build | ||
--llvm-profile-generate | ||
generate PGO profile with llvm built for rustc | ||
--enable-bolt-settings | ||
Enable BOLT link flags | ||
--skip-stage0-validation | ||
Skip stage0 compiler validation | ||
--reproducible-artifact <REPRODUCIBLE_ARTIFACT> | ||
Additional reproducible artifacts that should be added to the reproducible artifacts archive | ||
--set <section.option=value> | ||
override options in bootstrap.toml | ||
--ci <bool> | ||
Make bootstrap to behave as it's running on the CI environment or not [possible values: true, false] | ||
--skip-std-check-if-no-download-rustc | ||
Skip checking the standard library if `rust.download-rustc` isn't available. This is mostly for RA as building the stage1 compiler to check the library tree on each code change might be too much for some computers | ||
-h, --help | ||
Print help (see more with '--help') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably not relevant to this PR, but I wonder if we should really be showing all of this in help... e.g., the PGO options don't feel relevant to 99% of x.py users, and there's enough options here that we end up scrolling off screen for the actually-useful collection of subcommands test/doc/check/etc. It might mean that we want a verbose and non-verbose help for the top level? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It makes sense to me for both > not relevant to this PR and > want a verbose and non-verbose help for the top level Although I don't know if Clap supports such detailed/brief help, can I make an issue ticket for it (Check Clap's features, then modify the top-level help if we can) |
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.
The second part of this seems like it's not quite right, it needs
(sys.argv[1] in ["-h", "--help"] and len(sys.argv) == 2)
, right? Otherwisex.py --help check
wouldn't do the right thing?Uh oh!
There was an error while loading. Please reload this page.
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.
Currently
x.py --help check
prints the top level help, notcheck
's help. So I think we don't needlen(sys.argv) == 2
for it.Or, do you think
x.py --help check
should be identical withx.py check --help
?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.
I guess if we dispatch
x.py --help check
to bootstrap binary. Clap returns the top level help for it unless we modify the behaviour.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.
Yeah, that's what I'd expect. Printing the top-level output for
x.py --help check
seems quite odd to me.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.
But if clap has this behavior, then I'm OK sticking with that decision (would be interesting to see if that's intentional). It's probably a rare case either way.
Uh oh!
There was an error while loading. Please reload this page.
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.
Yes, I checked that:
So
x.py --help check
prints the top level help, and argumentcheck
is just ignored.