diff --git a/Cargo.lock b/Cargo.lock index 6d823c5b5a596..57733147599a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5187,14 +5187,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "suggest-tests" -version = "0.1.0" -dependencies = [ - "build_helper", - "glob", -] - [[package]] name = "syn" version = "1.0.109" diff --git a/Cargo.toml b/Cargo.toml index 6d3425f4115a1..67c7a9d67edc8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,6 @@ members = [ "src/tools/rustdoc-gui-test", "src/tools/rustdoc-themes", "src/tools/rustfmt", - "src/tools/suggest-tests", "src/tools/test-float-parse", "src/tools/tidy", "src/tools/tier-check", diff --git a/src/bootstrap/src/core/build_steps/mod.rs b/src/bootstrap/src/core/build_steps/mod.rs index fcb6abea43472..c2ad9a4df5977 100644 --- a/src/bootstrap/src/core/build_steps/mod.rs +++ b/src/bootstrap/src/core/build_steps/mod.rs @@ -11,7 +11,6 @@ pub(crate) mod llvm; pub(crate) mod perf; pub(crate) mod run; pub(crate) mod setup; -pub(crate) mod suggest; pub(crate) mod synthetic_targets; pub(crate) mod test; pub(crate) mod tool; diff --git a/src/bootstrap/src/core/build_steps/suggest.rs b/src/bootstrap/src/core/build_steps/suggest.rs deleted file mode 100644 index fd4918961adba..0000000000000 --- a/src/bootstrap/src/core/build_steps/suggest.rs +++ /dev/null @@ -1,68 +0,0 @@ -//! Attempt to magically identify good tests to run - -use std::path::PathBuf; -use std::str::FromStr; - -use clap::Parser; - -use crate::core::build_steps::tool::Tool; -use crate::core::builder::Builder; - -/// Suggests a list of possible `x.py` commands to run based on modified files in branch. -pub fn suggest(builder: &Builder<'_>, run: bool) { - let git_config = builder.config.git_config(); - let suggestions = builder - .tool_cmd(Tool::SuggestTests) - .env("SUGGEST_TESTS_NIGHTLY_BRANCH", git_config.nightly_branch) - .env("SUGGEST_TESTS_MERGE_COMMIT_EMAIL", git_config.git_merge_commit_email) - .run_capture_stdout(builder) - .stdout(); - - let suggestions = suggestions - .lines() - .map(|line| { - let mut sections = line.split_ascii_whitespace(); - - // this code expects one suggestion per line in the following format: - // {some number of flags} [optional stage number] - let cmd = sections.next().unwrap(); - let stage = sections.next_back().and_then(|s| str::parse(s).ok()); - let paths: Vec = sections.map(|p| PathBuf::from_str(p).unwrap()).collect(); - - (cmd, stage, paths) - }) - .collect::>(); - - if !suggestions.is_empty() { - println!("==== SUGGESTIONS ===="); - for sug in &suggestions { - print!("x {} ", sug.0); - if let Some(stage) = sug.1 { - print!("--stage {stage} "); - } - - for path in &sug.2 { - print!("{} ", path.display()); - } - println!(); - } - println!("====================="); - } else { - println!("No suggestions found!"); - return; - } - - if run { - for sug in suggestions { - let mut build: crate::Build = builder.build.clone(); - build.config.paths = sug.2; - build.config.cmd = crate::core::config::flags::Flags::parse_from(["x.py", sug.0]).cmd; - if let Some(stage) = sug.1 { - build.config.stage = stage; - } - build.build(); - } - } else { - println!("HELP: consider using the `--run` flag to automatically run suggested tests"); - } -} diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index a5b7b22aba85f..bab83c5a5a55c 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -47,12 +47,11 @@ impl Step for CrateBootstrap { const DEFAULT: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { - // This step is responsible for several different tool paths. By default - // it will test all of them, but requesting specific tools on the - // command-line (e.g. `./x test suggest-tests`) will test only the - // specified tools. + // This step is responsible for several different tool paths. + // + // By default, it will test all of them, but requesting specific tools on the command-line + // (e.g. `./x test src/tools/coverage-dump`) will test only the specified tools. run.path("src/tools/jsondoclint") - .path("src/tools/suggest-tests") .path("src/tools/replace-version-placeholder") .path("src/tools/coverage-dump") // We want `./x test tidy` to _run_ the tidy tool, not its tests. diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs index b05b34b9b2280..e9daea8130669 100644 --- a/src/bootstrap/src/core/build_steps/tool.rs +++ b/src/bootstrap/src/core/build_steps/tool.rs @@ -516,7 +516,6 @@ bootstrap_tool!( ReplaceVersionPlaceholder, "src/tools/replace-version-placeholder", "replace-version-placeholder"; CollectLicenseMetadata, "src/tools/collect-license-metadata", "collect-license-metadata"; GenerateCopyright, "src/tools/generate-copyright", "generate-copyright"; - SuggestTests, "src/tools/suggest-tests", "suggest-tests"; GenerateWindowsSys, "src/tools/generate-windows-sys", "generate-windows-sys"; // rustdoc-gui-test has a crate dependency on compiletest, so it needs the same unstable features. RustdocGUITest, "src/tools/rustdoc-gui-test", "rustdoc-gui-test", is_unstable_tool = true, allow_features = COMPILETEST_ALLOW_FEATURES; diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs index deb7106f185c4..ffb73fba05689 100644 --- a/src/bootstrap/src/core/builder/cargo.rs +++ b/src/bootstrap/src/core/builder/cargo.rs @@ -113,7 +113,7 @@ impl Cargo { match cmd_kind { // No need to configure the target linker for these command types. - Kind::Clean | Kind::Check | Kind::Suggest | Kind::Format | Kind::Setup => {} + Kind::Clean | Kind::Check | Kind::Format | Kind::Setup => {} _ => { cargo.configure_linker(builder); } diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs index b96a988cde3ff..7c295bacb4ff2 100644 --- a/src/bootstrap/src/core/builder/mod.rs +++ b/src/bootstrap/src/core/builder/mod.rs @@ -838,7 +838,6 @@ pub enum Kind { #[value(alias = "r")] Run, Setup, - Suggest, Vendor, Perf, } @@ -862,7 +861,6 @@ impl Kind { Kind::Install => "install", Kind::Run => "run", Kind::Setup => "setup", - Kind::Suggest => "suggest", Kind::Vendor => "vendor", Kind::Perf => "perf", } @@ -874,7 +872,6 @@ impl Kind { Kind::Bench => "Benchmarking", Kind::Doc => "Documenting", Kind::Run => "Running", - Kind::Suggest => "Suggesting", Kind::Clippy => "Linting", Kind::Perf => "Profiling & benchmarking", _ => { @@ -1195,7 +1192,7 @@ impl<'a> Builder<'a> { Kind::Clean => describe!(clean::CleanAll, clean::Rustc, clean::Std), Kind::Vendor => describe!(vendor::Vendor), // special-cased in Build::build() - Kind::Format | Kind::Suggest | Kind::Perf => vec![], + Kind::Format | Kind::Perf => vec![], Kind::MiriTest | Kind::MiriSetup => unreachable!(), } } @@ -1263,7 +1260,6 @@ impl<'a> Builder<'a> { Subcommand::Run { .. } => (Kind::Run, &paths[..]), Subcommand::Clean { .. } => (Kind::Clean, &paths[..]), Subcommand::Format { .. } => (Kind::Format, &[][..]), - Subcommand::Suggest { .. } => (Kind::Suggest, &[][..]), Subcommand::Setup { profile: ref path } => ( Kind::Setup, path.as_ref().map_or([].as_slice(), |path| std::slice::from_ref(path)), diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 59693dc3e4cf6..fbf2115bbba71 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -1047,7 +1047,6 @@ impl Config { | Subcommand::Run { .. } | Subcommand::Setup { .. } | Subcommand::Format { .. } - | Subcommand::Suggest { .. } | Subcommand::Vendor { .. } => flags_stage.unwrap_or(0), }; @@ -1088,7 +1087,6 @@ impl Config { | Subcommand::Run { .. } | Subcommand::Setup { .. } | Subcommand::Format { .. } - | Subcommand::Suggest { .. } | Subcommand::Vendor { .. } | Subcommand::Perf { .. } => {} } diff --git a/src/bootstrap/src/core/config/flags.rs b/src/bootstrap/src/core/config/flags.rs index bfc06f90d4f26..f0a5a0e7625c1 100644 --- a/src/bootstrap/src/core/config/flags.rs +++ b/src/bootstrap/src/core/config/flags.rs @@ -475,13 +475,6 @@ Arguments: #[arg(value_name = "|hook|editor|link")] profile: Option, }, - /// Suggest a subset of tests to run, based on modified files - #[command(long_about = "\n")] - Suggest { - /// run suggested tests - #[arg(long)] - run: bool, - }, /// Vendor dependencies Vendor { /// Additional `Cargo.toml` to sync and vendor @@ -512,7 +505,6 @@ impl Subcommand { Subcommand::Install => Kind::Install, Subcommand::Run { .. } => Kind::Run, Subcommand::Setup { .. } => Kind::Setup, - Subcommand::Suggest { .. } => Kind::Suggest, Subcommand::Vendor { .. } => Kind::Vendor, Subcommand::Perf { .. } => Kind::Perf, } diff --git a/src/bootstrap/src/core/sanity.rs b/src/bootstrap/src/core/sanity.rs index f2119e84cce74..b39d464493e56 100644 --- a/src/bootstrap/src/core/sanity.rs +++ b/src/bootstrap/src/core/sanity.rs @@ -216,7 +216,6 @@ than building it. build.config.cmd, Subcommand::Clean { .. } | Subcommand::Check { .. } - | Subcommand::Suggest { .. } | Subcommand::Format { .. } | Subcommand::Setup { .. } ); diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index ef5c28272b8e1..2b4dc4a0921bc 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -651,11 +651,9 @@ impl Build { // Handle hard-coded subcommands. { #[cfg(feature = "tracing")] - let _hardcoded_span = span!( - tracing::Level::DEBUG, - "handling hardcoded subcommands (Format, Suggest, Perf)" - ) - .entered(); + let _hardcoded_span = + span!(tracing::Level::DEBUG, "handling hardcoded subcommands (Format, Perf)") + .entered(); match &self.config.cmd { Subcommand::Format { check, all } => { @@ -666,9 +664,6 @@ impl Build { &self.config.paths, ); } - Subcommand::Suggest { run } => { - return core::build_steps::suggest::suggest(&builder::Builder::new(self), *run); - } Subcommand::Perf(args) => { return core::build_steps::perf::perf(&builder::Builder::new(self), args); } diff --git a/src/bootstrap/src/utils/cc_detect.rs b/src/bootstrap/src/utils/cc_detect.rs index dcafeb80f90ca..778591189a3c9 100644 --- a/src/bootstrap/src/utils/cc_detect.rs +++ b/src/bootstrap/src/utils/cc_detect.rs @@ -67,7 +67,6 @@ pub fn fill_compilers(build: &mut Build) { // We don't need to check cross targets for these commands. crate::Subcommand::Clean { .. } | crate::Subcommand::Check { .. } - | crate::Subcommand::Suggest { .. } | crate::Subcommand::Format { .. } | crate::Subcommand::Setup { .. } => { build.hosts.iter().cloned().chain(iter::once(build.host_target)).collect() diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index 424f211c7d4bb..977f414e68f13 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -461,4 +461,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ severity: ChangeSeverity::Warning, summary: "`download-rustc` has been temporarily disabled for the library profile due to implementation bugs (see #142505).", }, + ChangeInfo { + change_id: 143630, + severity: ChangeSeverity::Warning, + summary: "The current `./x suggest` implementation has been removed due to it being quite broken and a lack of maintenance bandwidth, with no prejudice against re-implementing it in a more maintainable form.", + }, ]; diff --git a/src/bootstrap/src/utils/metrics.rs b/src/bootstrap/src/utils/metrics.rs index 862c444962415..38d173be8f815 100644 --- a/src/bootstrap/src/utils/metrics.rs +++ b/src/bootstrap/src/utils/metrics.rs @@ -43,7 +43,7 @@ pub(crate) struct BuildMetrics { state: RefCell, } -/// NOTE: this isn't really cloning anything, but `x suggest` doesn't need metrics so this is probably ok. +// NOTE: this isn't really cloning anything, but necessarily for `Build: Clone`. impl Clone for BuildMetrics { fn clone(&self) -> Self { Self::init() diff --git a/src/doc/rustc-dev-guide/src/SUMMARY.md b/src/doc/rustc-dev-guide/src/SUMMARY.md index 7f2f32c62ffba..651e2925ad504 100644 --- a/src/doc/rustc-dev-guide/src/SUMMARY.md +++ b/src/doc/rustc-dev-guide/src/SUMMARY.md @@ -35,7 +35,6 @@ - [Cranelift codegen backend](./tests/codegen-backend-tests/cg_clif.md) - [GCC codegen backend](./tests/codegen-backend-tests/cg_gcc.md) - [Performance testing](./tests/perf.md) - - [Suggest tests tool](./tests/suggest-tests.md) - [Misc info](./tests/misc.md) - [Debugging the compiler](./compiler-debugging.md) - [Using the tracing/logging instrumentation](./tracing.md) diff --git a/src/doc/rustc-dev-guide/src/building/quickstart.md b/src/doc/rustc-dev-guide/src/building/quickstart.md index 9a8ab353e029b..97314d8036953 100644 --- a/src/doc/rustc-dev-guide/src/building/quickstart.md +++ b/src/doc/rustc-dev-guide/src/building/quickstart.md @@ -61,9 +61,6 @@ and check the output. Use `--bless` if you've made a change and want to update the `.stderr` files with the new output. -> `./x suggest` can also be helpful for suggesting which tests to run after a -> change. - Congrats, you are now ready to make a change to the compiler! If you have more questions, [the full chapter](./how-to-build-and-run.md) might contain the answers, and if it doesn't, feel free to ask for help on diff --git a/src/doc/rustc-dev-guide/src/building/suggested.md b/src/doc/rustc-dev-guide/src/building/suggested.md index bfb2f4d1084ad..7f626314f7181 100644 --- a/src/doc/rustc-dev-guide/src/building/suggested.md +++ b/src/doc/rustc-dev-guide/src/building/suggested.md @@ -270,23 +270,6 @@ run the tests at some later time. You can then use `git bisect` to track down is that you are left with a fairly fine-grained set of commits at the end, all of which build and pass tests. This often helps reviewing. -## `x suggest` - -The `x suggest` subcommand suggests (and runs) a subset of the extensive -`rust-lang/rust` tests based on files you have changed. This is especially -useful for new contributors who have not mastered the arcane `x` flags yet and -more experienced contributors as a shorthand for reducing mental effort. In all -cases it is useful not to run the full tests (which can take on the order of -tens of minutes) and just run a subset which are relevant to your changes. For -example, running `tidy` and `linkchecker` is useful when editing Markdown files, -whereas UI tests are much less likely to be helpful. While `x suggest` is a -useful tool, it does not guarantee perfect coverage (just as PR CI isn't a -substitute for bors). See the [dedicated chapter](../tests/suggest-tests.md) for -more information and contribution instructions. - -Please note that `x suggest` is in a beta state currently and the tests that it -will suggest are limited. - ## Configuring `rustup` to use nightly Some parts of the bootstrap process uses pinned, nightly versions of tools like diff --git a/src/doc/rustc-dev-guide/src/tests/suggest-tests.md b/src/doc/rustc-dev-guide/src/tests/suggest-tests.md deleted file mode 100644 index 663e8a5af3b9e..0000000000000 --- a/src/doc/rustc-dev-guide/src/tests/suggest-tests.md +++ /dev/null @@ -1,59 +0,0 @@ -# Suggest tests tool - -This chapter is about the internals of and contribution instructions for the -`suggest-tests` tool. For a high-level overview of the tool, see [this -section](../building/suggested.md#x-suggest). This tool is currently in a beta -state and is tracked by [this](https://github.com/rust-lang/rust/issues/109933) -issue on Github. Currently the number of tests it will suggest are very limited -in scope, we are looking to expand this (contributions welcome!). - -## Internals - -The tool is defined in a separate crate -([`src/tools/suggest-tests`](https://github.com/rust-lang/rust/blob/master/src/tools/suggest-tests)) -which outputs suggestions which are parsed by a shim in bootstrap -([`src/bootstrap/src/core/build_steps/suggest.rs`](https://github.com/rust-lang/rust/blob/master/src/bootstrap/src/core/build_steps/suggest.rs)). -The only notable thing the bootstrap shim does is (when invoked with the `--run` -flag) use bootstrap's internal mechanisms to create a new `Builder` and uses it -to invoke the suggested commands. The `suggest-tests` crate is where the fun -happens, two kinds of suggestions are defined: "static" and "dynamic" -suggestions. - -### Static suggestions - -Defined -[here](https://github.com/rust-lang/rust/blob/master/src/tools/suggest-tests/src/static_suggestions.rs). -Static suggestions are simple: they are just -[globs](https://crates.io/crates/glob) which map to a `x` command. In -`suggest-tests`, this is implemented with a simple `macro_rules` macro. - -### Dynamic suggestions - -Defined -[here](https://github.com/rust-lang/rust/blob/master/src/tools/suggest-tests/src/dynamic_suggestions.rs). -These are more complicated than static suggestions and are implemented as -functions with the following signature: `fn(&Path) -> Vec`. In other -words, each suggestion takes a path to a modified file and (after running -arbitrary Rust code) can return any number of suggestions, or none. Dynamic -suggestions are useful for situations where fine-grained control over -suggestions is needed. For example, modifications to the `compiler/xyz/` path -should trigger the `x test compiler/xyz` suggestion. In the future, dynamic -suggestions might even read file contents to determine if (what) tests should -run. - -## Adding a suggestion - -The following steps should serve as a rough guide to add suggestions to -`suggest-tests` (very welcome!): - -1. Determine the rules for your suggestion. Is it simple and operates only on a - single path or does it match globs? Does it need fine-grained control over - the resulting command or does "one size fit all"? -2. Based on the previous step, decide if your suggestion should be implemented - as either static or dynamic. -3. Implement the suggestion. If it is dynamic then a test is highly recommended, - to verify that your logic is correct and to give an example of the - suggestion. See the - [tests.rs](https://github.com/rust-lang/rust/blob/master/src/tools/suggest-tests/src/tests.rs) - file. -4. Open a PR implementing your suggestion. **(TODO: add example PR)** diff --git a/src/etc/completions/x.fish b/src/etc/completions/x.fish index 69bd525a31221..c601bb870cf3c 100644 --- a/src/etc/completions/x.fish +++ b/src/etc/completions/x.fish @@ -72,7 +72,6 @@ complete -c x -n "__fish_x_needs_command" -a "dist" -d 'Build distribution artif complete -c x -n "__fish_x_needs_command" -a "install" -d 'Install distribution artifacts' complete -c x -n "__fish_x_needs_command" -a "run" -d 'Run tools contained in this repository' complete -c x -n "__fish_x_needs_command" -a "setup" -d 'Set up the environment for development' -complete -c x -n "__fish_x_needs_command" -a "suggest" -d 'Suggest a subset of tests to run, based on modified files' complete -c x -n "__fish_x_needs_command" -a "vendor" -d 'Vendor dependencies' complete -c x -n "__fish_x_needs_command" -a "perf" -d 'Perform profiling and benchmarking of the compiler using `rustc-perf`' complete -c x -n "__fish_x_using_subcommand build" -l config -d 'TOML configuration file for build' -r -F @@ -584,41 +583,6 @@ complete -c x -n "__fish_x_using_subcommand setup" -l enable-bolt-settings -d 'E complete -c x -n "__fish_x_using_subcommand setup" -l skip-stage0-validation -d 'Skip stage0 compiler validation' complete -c x -n "__fish_x_using_subcommand setup" -l skip-std-check-if-no-download-rustc -d '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' complete -c x -n "__fish_x_using_subcommand setup" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x -n "__fish_x_using_subcommand suggest" -l config -d 'TOML configuration file for build' -r -F -complete -c x -n "__fish_x_using_subcommand suggest" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x -n "__fish_x_using_subcommand suggest" -l build -d 'host target of the stage0 compiler' -r -f -complete -c x -n "__fish_x_using_subcommand suggest" -l host -d 'host targets to build' -r -f -complete -c x -n "__fish_x_using_subcommand suggest" -l target -d 'target targets to build' -r -f -complete -c x -n "__fish_x_using_subcommand suggest" -l exclude -d 'build paths to exclude' -r -F -complete -c x -n "__fish_x_using_subcommand suggest" -l skip -d 'build paths to skip' -r -F -complete -c x -n "__fish_x_using_subcommand suggest" -l rustc-error-format -d 'rustc error format' -r -f -complete -c x -n "__fish_x_using_subcommand suggest" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x -n "__fish_x_using_subcommand suggest" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x -n "__fish_x_using_subcommand suggest" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x -n "__fish_x_using_subcommand suggest" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x -n "__fish_x_using_subcommand suggest" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x -n "__fish_x_using_subcommand suggest" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x -n "__fish_x_using_subcommand suggest" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" -complete -c x -n "__fish_x_using_subcommand suggest" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" -complete -c x -n "__fish_x_using_subcommand suggest" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x -n "__fish_x_using_subcommand suggest" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x -n "__fish_x_using_subcommand suggest" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x -n "__fish_x_using_subcommand suggest" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x -n "__fish_x_using_subcommand suggest" -l set -d 'override options in bootstrap.toml' -r -f -complete -c x -n "__fish_x_using_subcommand suggest" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" -complete -c x -n "__fish_x_using_subcommand suggest" -l run -d 'run suggested tests' -complete -c x -n "__fish_x_using_subcommand suggest" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x -n "__fish_x_using_subcommand suggest" -s i -l incremental -d 'use incremental compilation' -complete -c x -n "__fish_x_using_subcommand suggest" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x -n "__fish_x_using_subcommand suggest" -l dry-run -d 'dry run; don\'t build anything' -complete -c x -n "__fish_x_using_subcommand suggest" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x -n "__fish_x_using_subcommand suggest" -l json-output -d 'use message-format=json' -complete -c x -n "__fish_x_using_subcommand suggest" -l bypass-bootstrap-lock -d '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)' -complete -c x -n "__fish_x_using_subcommand suggest" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x -n "__fish_x_using_subcommand suggest" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x -n "__fish_x_using_subcommand suggest" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x -n "__fish_x_using_subcommand suggest" -l skip-std-check-if-no-download-rustc -d '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' -complete -c x -n "__fish_x_using_subcommand suggest" -s h -l help -d 'Print help (see more with \'--help\')' complete -c x -n "__fish_x_using_subcommand vendor" -l sync -d 'Additional `Cargo.toml` to sync and vendor' -r -F complete -c x -n "__fish_x_using_subcommand vendor" -l config -d 'TOML configuration file for build' -r -F complete -c x -n "__fish_x_using_subcommand vendor" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)" diff --git a/src/etc/completions/x.ps1 b/src/etc/completions/x.ps1 index 7b142ba97ce51..1e9f0b932cd1e 100644 --- a/src/etc/completions/x.ps1 +++ b/src/etc/completions/x.ps1 @@ -73,7 +73,6 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('install', 'install', [CompletionResultType]::ParameterValue, 'Install distribution artifacts') [CompletionResult]::new('run', 'run', [CompletionResultType]::ParameterValue, 'Run tools contained in this repository') [CompletionResult]::new('setup', 'setup', [CompletionResultType]::ParameterValue, 'Set up the environment for development') - [CompletionResult]::new('suggest', 'suggest', [CompletionResultType]::ParameterValue, 'Suggest a subset of tests to run, based on modified files') [CompletionResult]::new('vendor', 'vendor', [CompletionResultType]::ParameterValue, 'Vendor dependencies') [CompletionResult]::new('perf', 'perf', [CompletionResultType]::ParameterValue, 'Perform profiling and benchmarking of the compiler using `rustc-perf`') break @@ -685,48 +684,6 @@ Register-ArgumentCompleter -Native -CommandName 'x' -ScriptBlock { [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } - 'x;suggest' { - [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`') - [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler') - [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in bootstrap.toml') - [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') - [CompletionResult]::new('--run', '--run', [CompletionResultType]::ParameterName, 'run suggested tests') - [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, '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)') - [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('--skip-std-check-if-no-download-rustc', '--skip-std-check-if-no-download-rustc', [CompletionResultType]::ParameterName, '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') - [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - break - } 'x;vendor' { [CompletionResult]::new('--sync', '--sync', [CompletionResultType]::ParameterName, 'Additional `Cargo.toml` to sync and vendor') [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') diff --git a/src/etc/completions/x.py.fish b/src/etc/completions/x.py.fish index e982cde634fc7..b4f8cc0b5dd82 100644 --- a/src/etc/completions/x.py.fish +++ b/src/etc/completions/x.py.fish @@ -72,7 +72,6 @@ complete -c x.py -n "__fish_x.py_needs_command" -a "dist" -d 'Build distribution complete -c x.py -n "__fish_x.py_needs_command" -a "install" -d 'Install distribution artifacts' complete -c x.py -n "__fish_x.py_needs_command" -a "run" -d 'Run tools contained in this repository' complete -c x.py -n "__fish_x.py_needs_command" -a "setup" -d 'Set up the environment for development' -complete -c x.py -n "__fish_x.py_needs_command" -a "suggest" -d 'Suggest a subset of tests to run, based on modified files' complete -c x.py -n "__fish_x.py_needs_command" -a "vendor" -d 'Vendor dependencies' complete -c x.py -n "__fish_x.py_needs_command" -a "perf" -d 'Perform profiling and benchmarking of the compiler using `rustc-perf`' complete -c x.py -n "__fish_x.py_using_subcommand build" -l config -d 'TOML configuration file for build' -r -F @@ -584,41 +583,6 @@ complete -c x.py -n "__fish_x.py_using_subcommand setup" -l enable-bolt-settings complete -c x.py -n "__fish_x.py_using_subcommand setup" -l skip-stage0-validation -d 'Skip stage0 compiler validation' complete -c x.py -n "__fish_x.py_using_subcommand setup" -l skip-std-check-if-no-download-rustc -d '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' complete -c x.py -n "__fish_x.py_using_subcommand setup" -s h -l help -d 'Print help (see more with \'--help\')' -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l config -d 'TOML configuration file for build' -r -F -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l build -d 'host target of the stage0 compiler' -r -f -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l host -d 'host targets to build' -r -f -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l target -d 'target targets to build' -r -f -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l exclude -d 'build paths to exclude' -r -F -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l skip -d 'build paths to skip' -r -F -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l rustc-error-format -d 'rustc error format' -r -f -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l on-fail -d 'command to run on failure' -r -f -a "(__fish_complete_command)" -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l stage -d 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)' -r -f -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l keep-stage -d 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l keep-stage-std -d 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)' -r -f -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l src -d 'path to the root of the rust checkout' -r -f -a "(__fish_complete_directories)" -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -s j -l jobs -d 'number of jobs to run in parallel' -r -f -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l warnings -d 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour' -r -f -a "{deny\t'',warn\t'',default\t''}" -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l color -d 'whether to use color in cargo and rustc output' -r -f -a "{always\t'',never\t'',auto\t''}" -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l rust-profile-generate -d 'generate PGO profile with rustc build' -r -F -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l rust-profile-use -d 'use PGO profile for rustc build' -r -F -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l llvm-profile-use -d 'use PGO profile for LLVM build' -r -F -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l reproducible-artifact -d 'Additional reproducible artifacts that should be added to the reproducible artifacts archive' -r -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l set -d 'override options in bootstrap.toml' -r -f -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l ci -d 'Make bootstrap to behave as it\'s running on the CI environment or not' -r -f -a "{true\t'',false\t''}" -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l run -d 'run suggested tests' -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -s v -l verbose -d 'use verbose output (-vv for very verbose)' -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -s i -l incremental -d 'use incremental compilation' -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l include-default-paths -d 'include default paths in addition to the provided ones' -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l dry-run -d 'dry run; don\'t build anything' -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l dump-bootstrap-shims -d 'Indicates whether to dump the work done from bootstrap shims' -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l json-output -d 'use message-format=json' -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l bypass-bootstrap-lock -d '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)' -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l llvm-profile-generate -d 'generate PGO profile with llvm built for rustc' -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l enable-bolt-settings -d 'Enable BOLT link flags' -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l skip-stage0-validation -d 'Skip stage0 compiler validation' -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -l skip-std-check-if-no-download-rustc -d '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' -complete -c x.py -n "__fish_x.py_using_subcommand suggest" -s h -l help -d 'Print help (see more with \'--help\')' complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l sync -d 'Additional `Cargo.toml` to sync and vendor' -r -F complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l config -d 'TOML configuration file for build' -r -F complete -c x.py -n "__fish_x.py_using_subcommand vendor" -l build-dir -d 'Build directory, overrides `build.build-dir` in `bootstrap.toml`' -r -f -a "(__fish_complete_directories)" diff --git a/src/etc/completions/x.py.ps1 b/src/etc/completions/x.py.ps1 index f4b26fac0bcf4..2f46f5dabe42d 100644 --- a/src/etc/completions/x.py.ps1 +++ b/src/etc/completions/x.py.ps1 @@ -73,7 +73,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('install', 'install', [CompletionResultType]::ParameterValue, 'Install distribution artifacts') [CompletionResult]::new('run', 'run', [CompletionResultType]::ParameterValue, 'Run tools contained in this repository') [CompletionResult]::new('setup', 'setup', [CompletionResultType]::ParameterValue, 'Set up the environment for development') - [CompletionResult]::new('suggest', 'suggest', [CompletionResultType]::ParameterValue, 'Suggest a subset of tests to run, based on modified files') [CompletionResult]::new('vendor', 'vendor', [CompletionResultType]::ParameterValue, 'Vendor dependencies') [CompletionResult]::new('perf', 'perf', [CompletionResultType]::ParameterValue, 'Perform profiling and benchmarking of the compiler using `rustc-perf`') break @@ -685,48 +684,6 @@ Register-ArgumentCompleter -Native -CommandName 'x.py' -ScriptBlock { [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') break } - 'x.py;suggest' { - [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') - [CompletionResult]::new('--build-dir', '--build-dir', [CompletionResultType]::ParameterName, 'Build directory, overrides `build.build-dir` in `bootstrap.toml`') - [CompletionResult]::new('--build', '--build', [CompletionResultType]::ParameterName, 'host target of the stage0 compiler') - [CompletionResult]::new('--host', '--host', [CompletionResultType]::ParameterName, 'host targets to build') - [CompletionResult]::new('--target', '--target', [CompletionResultType]::ParameterName, 'target targets to build') - [CompletionResult]::new('--exclude', '--exclude', [CompletionResultType]::ParameterName, 'build paths to exclude') - [CompletionResult]::new('--skip', '--skip', [CompletionResultType]::ParameterName, 'build paths to skip') - [CompletionResult]::new('--rustc-error-format', '--rustc-error-format', [CompletionResultType]::ParameterName, 'rustc error format') - [CompletionResult]::new('--on-fail', '--on-fail', [CompletionResultType]::ParameterName, 'command to run on failure') - [CompletionResult]::new('--stage', '--stage', [CompletionResultType]::ParameterName, 'stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)') - [CompletionResult]::new('--keep-stage', '--keep-stage', [CompletionResultType]::ParameterName, 'stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--keep-stage-std', '--keep-stage-std', [CompletionResultType]::ParameterName, 'stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)') - [CompletionResult]::new('--src', '--src', [CompletionResultType]::ParameterName, 'path to the root of the rust checkout') - [CompletionResult]::new('-j', '-j', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--jobs', '--jobs', [CompletionResultType]::ParameterName, 'number of jobs to run in parallel') - [CompletionResult]::new('--warnings', '--warnings', [CompletionResultType]::ParameterName, 'if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour') - [CompletionResult]::new('--color', '--color', [CompletionResultType]::ParameterName, 'whether to use color in cargo and rustc output') - [CompletionResult]::new('--rust-profile-generate', '--rust-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with rustc build') - [CompletionResult]::new('--rust-profile-use', '--rust-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for rustc build') - [CompletionResult]::new('--llvm-profile-use', '--llvm-profile-use', [CompletionResultType]::ParameterName, 'use PGO profile for LLVM build') - [CompletionResult]::new('--reproducible-artifact', '--reproducible-artifact', [CompletionResultType]::ParameterName, 'Additional reproducible artifacts that should be added to the reproducible artifacts archive') - [CompletionResult]::new('--set', '--set', [CompletionResultType]::ParameterName, 'override options in bootstrap.toml') - [CompletionResult]::new('--ci', '--ci', [CompletionResultType]::ParameterName, 'Make bootstrap to behave as it''s running on the CI environment or not') - [CompletionResult]::new('--run', '--run', [CompletionResultType]::ParameterName, 'run suggested tests') - [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'use verbose output (-vv for very verbose)') - [CompletionResult]::new('-i', '-i', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--incremental', '--incremental', [CompletionResultType]::ParameterName, 'use incremental compilation') - [CompletionResult]::new('--include-default-paths', '--include-default-paths', [CompletionResultType]::ParameterName, 'include default paths in addition to the provided ones') - [CompletionResult]::new('--dry-run', '--dry-run', [CompletionResultType]::ParameterName, 'dry run; don''t build anything') - [CompletionResult]::new('--dump-bootstrap-shims', '--dump-bootstrap-shims', [CompletionResultType]::ParameterName, 'Indicates whether to dump the work done from bootstrap shims') - [CompletionResult]::new('--json-output', '--json-output', [CompletionResultType]::ParameterName, 'use message-format=json') - [CompletionResult]::new('--bypass-bootstrap-lock', '--bypass-bootstrap-lock', [CompletionResultType]::ParameterName, '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)') - [CompletionResult]::new('--llvm-profile-generate', '--llvm-profile-generate', [CompletionResultType]::ParameterName, 'generate PGO profile with llvm built for rustc') - [CompletionResult]::new('--enable-bolt-settings', '--enable-bolt-settings', [CompletionResultType]::ParameterName, 'Enable BOLT link flags') - [CompletionResult]::new('--skip-stage0-validation', '--skip-stage0-validation', [CompletionResultType]::ParameterName, 'Skip stage0 compiler validation') - [CompletionResult]::new('--skip-std-check-if-no-download-rustc', '--skip-std-check-if-no-download-rustc', [CompletionResultType]::ParameterName, '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') - [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')') - break - } 'x.py;vendor' { [CompletionResult]::new('--sync', '--sync', [CompletionResultType]::ParameterName, 'Additional `Cargo.toml` to sync and vendor') [CompletionResult]::new('--config', '--config', [CompletionResultType]::ParameterName, 'TOML configuration file for build') diff --git a/src/etc/completions/x.py.sh b/src/etc/completions/x.py.sh index fe4ed5c915f01..70be2c8d1492b 100644 --- a/src/etc/completions/x.py.sh +++ b/src/etc/completions/x.py.sh @@ -54,9 +54,6 @@ _x.py() { x.py,setup) cmd="x.py__setup" ;; - x.py,suggest) - cmd="x.py__suggest" - ;; x.py,test) cmd="x.py__test" ;; @@ -85,7 +82,7 @@ _x.py() { case "${cmd}" in x.py) - opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]... build check clippy fix fmt doc test miri bench clean dist install run setup suggest vendor perf" + opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]... build check clippy fix fmt doc test miri bench clean dist install run setup vendor perf" if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -3877,192 +3874,6 @@ _x.py() { COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; - x.py__suggest) - opts="-v -i -j -h --run --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." - if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - --config) - local oldifs - if [ -n "${IFS+x}" ]; then - oldifs="$IFS" - fi - IFS=$'\n' - COMPREPLY=($(compgen -f "${cur}")) - if [ -n "${oldifs+x}" ]; then - IFS="$oldifs" - fi - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o filenames - fi - return 0 - ;; - --build-dir) - COMPREPLY=() - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o plusdirs - fi - return 0 - ;; - --build) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --host) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --target) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --exclude) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --skip) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --rustc-error-format) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --on-fail) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --stage) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --keep-stage) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --keep-stage-std) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --src) - COMPREPLY=() - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o plusdirs - fi - return 0 - ;; - --jobs) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - -j) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --warnings) - COMPREPLY=($(compgen -W "deny warn default" -- "${cur}")) - return 0 - ;; - --color) - COMPREPLY=($(compgen -W "always never auto" -- "${cur}")) - return 0 - ;; - --rust-profile-generate) - local oldifs - if [ -n "${IFS+x}" ]; then - oldifs="$IFS" - fi - IFS=$'\n' - COMPREPLY=($(compgen -f "${cur}")) - if [ -n "${oldifs+x}" ]; then - IFS="$oldifs" - fi - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o filenames - fi - return 0 - ;; - --rust-profile-use) - local oldifs - if [ -n "${IFS+x}" ]; then - oldifs="$IFS" - fi - IFS=$'\n' - COMPREPLY=($(compgen -f "${cur}")) - if [ -n "${oldifs+x}" ]; then - IFS="$oldifs" - fi - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o filenames - fi - return 0 - ;; - --llvm-profile-use) - local oldifs - if [ -n "${IFS+x}" ]; then - oldifs="$IFS" - fi - IFS=$'\n' - COMPREPLY=($(compgen -f "${cur}")) - if [ -n "${oldifs+x}" ]; then - IFS="$oldifs" - fi - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o filenames - fi - return 0 - ;; - --reproducible-artifact) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --set) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --ci) - COMPREPLY=($(compgen -W "true false" -- "${cur}")) - return 0 - ;; - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; x.py__test) opts="-v -i -j -h --no-fail-fast --test-args --compiletest-rustc-args --no-doc --doc --bless --extra-checks --force-rerun --only-modified --compare-mode --pass --run --rustfix-coverage --no-capture --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then diff --git a/src/etc/completions/x.py.zsh b/src/etc/completions/x.py.zsh index 8fc4f05225238..23663d357b125 100644 --- a/src/etc/completions/x.py.zsh +++ b/src/etc/completions/x.py.zsh @@ -700,50 +700,6 @@ _arguments "${_arguments_options[@]}" : \ '*::paths -- paths for the subcommand:_files' \ && ret=0 ;; -(suggest) -_arguments "${_arguments_options[@]}" : \ -'--config=[TOML configuration file for build]:FILE:_files' \ -'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \ -'--build=[host target of the stage0 compiler]:BUILD:' \ -'--host=[host targets to build]:HOST:' \ -'--target=[target targets to build]:TARGET:' \ -'*--exclude=[build paths to exclude]:PATH:_files' \ -'*--skip=[build paths to skip]:PATH:_files' \ -'--rustc-error-format=[rustc error format]:RUSTC_ERROR_FORMAT:' \ -'--on-fail=[command to run on failure]:CMD:_cmdstring' \ -'--stage=[stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)]:N:' \ -'*--keep-stage=[stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)]:N:' \ -'*--keep-stage-std=[stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)]:N:' \ -'--src=[path to the root of the rust checkout]:DIR:_files -/' \ -'-j+[number of jobs to run in parallel]:JOBS:' \ -'--jobs=[number of jobs to run in parallel]:JOBS:' \ -'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \ -'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \ -'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \ -'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \ -'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \ -'*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ -'*--set=[override options in bootstrap.toml]:section.option=value:' \ -'--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'--run[run suggested tests]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ -'-i[use incremental compilation]' \ -'--incremental[use incremental compilation]' \ -'--include-default-paths[include default paths in addition to the provided ones]' \ -'--dry-run[dry run; don'\''t build anything]' \ -'--dump-bootstrap-shims[Indicates whether to dump the work done from bootstrap shims]' \ -'--json-output[use message-format=json]' \ -'--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)]' \ -'--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]' \ -'--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[Print help (see more with '\''--help'\'')]' \ -'--help[Print help (see more with '\''--help'\'')]' \ -'*::paths -- paths for the subcommand:_files' \ -&& ret=0 -;; (vendor) _arguments "${_arguments_options[@]}" : \ '*--sync=[Additional \`Cargo.toml\` to sync and vendor]:SYNC:_files' \ @@ -1097,7 +1053,6 @@ _x.py_commands() { 'install:Install distribution artifacts' \ 'run:Run tools contained in this repository' \ 'setup:Set up the environment for development' \ -'suggest:Suggest a subset of tests to run, based on modified files' \ 'vendor:Vendor dependencies' \ 'perf:Perform profiling and benchmarking of the compiler using \`rustc-perf\`' \ ) @@ -1204,11 +1159,6 @@ _x.py__setup_commands() { local commands; commands=() _describe -t commands 'x.py setup commands' commands "$@" } -(( $+functions[_x.py__suggest_commands] )) || -_x.py__suggest_commands() { - local commands; commands=() - _describe -t commands 'x.py suggest commands' commands "$@" -} (( $+functions[_x.py__test_commands] )) || _x.py__test_commands() { local commands; commands=() diff --git a/src/etc/completions/x.sh b/src/etc/completions/x.sh index 105fc668e8e9d..9d9b1ed1deea7 100644 --- a/src/etc/completions/x.sh +++ b/src/etc/completions/x.sh @@ -54,9 +54,6 @@ _x() { x,setup) cmd="x__setup" ;; - x,suggest) - cmd="x__suggest" - ;; x,test) cmd="x__test" ;; @@ -85,7 +82,7 @@ _x() { case "${cmd}" in x) - opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]... build check clippy fix fmt doc test miri bench clean dist install run setup suggest vendor perf" + opts="-v -i -j -h --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]... build check clippy fix fmt doc test miri bench clean dist install run setup vendor perf" if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -3877,192 +3874,6 @@ _x() { COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; - x__suggest) - opts="-v -i -j -h --run --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." - if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - fi - case "${prev}" in - --config) - local oldifs - if [ -n "${IFS+x}" ]; then - oldifs="$IFS" - fi - IFS=$'\n' - COMPREPLY=($(compgen -f "${cur}")) - if [ -n "${oldifs+x}" ]; then - IFS="$oldifs" - fi - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o filenames - fi - return 0 - ;; - --build-dir) - COMPREPLY=() - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o plusdirs - fi - return 0 - ;; - --build) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --host) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --target) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --exclude) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --skip) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --rustc-error-format) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --on-fail) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --stage) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --keep-stage) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --keep-stage-std) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --src) - COMPREPLY=() - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o plusdirs - fi - return 0 - ;; - --jobs) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - -j) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --warnings) - COMPREPLY=($(compgen -W "deny warn default" -- "${cur}")) - return 0 - ;; - --color) - COMPREPLY=($(compgen -W "always never auto" -- "${cur}")) - return 0 - ;; - --rust-profile-generate) - local oldifs - if [ -n "${IFS+x}" ]; then - oldifs="$IFS" - fi - IFS=$'\n' - COMPREPLY=($(compgen -f "${cur}")) - if [ -n "${oldifs+x}" ]; then - IFS="$oldifs" - fi - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o filenames - fi - return 0 - ;; - --rust-profile-use) - local oldifs - if [ -n "${IFS+x}" ]; then - oldifs="$IFS" - fi - IFS=$'\n' - COMPREPLY=($(compgen -f "${cur}")) - if [ -n "${oldifs+x}" ]; then - IFS="$oldifs" - fi - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o filenames - fi - return 0 - ;; - --llvm-profile-use) - local oldifs - if [ -n "${IFS+x}" ]; then - oldifs="$IFS" - fi - IFS=$'\n' - COMPREPLY=($(compgen -f "${cur}")) - if [ -n "${oldifs+x}" ]; then - IFS="$oldifs" - fi - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o filenames - fi - return 0 - ;; - --reproducible-artifact) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - --set) - COMPREPLY=("${cur}") - if [[ "${BASH_VERSINFO[0]}" -ge 4 ]]; then - compopt -o nospace - fi - return 0 - ;; - --ci) - COMPREPLY=($(compgen -W "true false" -- "${cur}")) - return 0 - ;; - *) - COMPREPLY=() - ;; - esac - COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) - return 0 - ;; x__test) opts="-v -i -j -h --no-fail-fast --test-args --compiletest-rustc-args --no-doc --doc --bless --extra-checks --force-rerun --only-modified --compare-mode --pass --run --rustfix-coverage --no-capture --verbose --incremental --config --build-dir --build --host --target --exclude --skip --include-default-paths --rustc-error-format --on-fail --dry-run --dump-bootstrap-shims --stage --keep-stage --keep-stage-std --src --jobs --warnings --json-output --color --bypass-bootstrap-lock --rust-profile-generate --rust-profile-use --llvm-profile-use --llvm-profile-generate --enable-bolt-settings --skip-stage0-validation --reproducible-artifact --set --ci --skip-std-check-if-no-download-rustc --help [PATHS]... [ARGS]..." if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then diff --git a/src/etc/completions/x.zsh b/src/etc/completions/x.zsh index c495e8318ba46..fb07dc67a6e93 100644 --- a/src/etc/completions/x.zsh +++ b/src/etc/completions/x.zsh @@ -700,50 +700,6 @@ _arguments "${_arguments_options[@]}" : \ '*::paths -- paths for the subcommand:_files' \ && ret=0 ;; -(suggest) -_arguments "${_arguments_options[@]}" : \ -'--config=[TOML configuration file for build]:FILE:_files' \ -'--build-dir=[Build directory, overrides \`build.build-dir\` in \`bootstrap.toml\`]:DIR:_files -/' \ -'--build=[host target of the stage0 compiler]:BUILD:' \ -'--host=[host targets to build]:HOST:' \ -'--target=[target targets to build]:TARGET:' \ -'*--exclude=[build paths to exclude]:PATH:_files' \ -'*--skip=[build paths to skip]:PATH:_files' \ -'--rustc-error-format=[rustc error format]:RUSTC_ERROR_FORMAT:' \ -'--on-fail=[command to run on failure]:CMD:_cmdstring' \ -'--stage=[stage to build (indicates compiler to use/test, e.g., stage 0 uses the bootstrap compiler, stage 1 the stage 0 rustc artifacts, etc.)]:N:' \ -'*--keep-stage=[stage(s) to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)]:N:' \ -'*--keep-stage-std=[stage(s) of the standard library to keep without recompiling (pass multiple times to keep e.g., both stages 0 and 1)]:N:' \ -'--src=[path to the root of the rust checkout]:DIR:_files -/' \ -'-j+[number of jobs to run in parallel]:JOBS:' \ -'--jobs=[number of jobs to run in parallel]:JOBS:' \ -'--warnings=[if value is deny, will deny warnings if value is warn, will emit warnings otherwise, use the default configured behaviour]:deny|warn:(deny warn default)' \ -'--color=[whether to use color in cargo and rustc output]:STYLE:(always never auto)' \ -'--rust-profile-generate=[generate PGO profile with rustc build]:PROFILE:_files' \ -'--rust-profile-use=[use PGO profile for rustc build]:PROFILE:_files' \ -'--llvm-profile-use=[use PGO profile for LLVM build]:PROFILE:_files' \ -'*--reproducible-artifact=[Additional reproducible artifacts that should be added to the reproducible artifacts archive]:REPRODUCIBLE_ARTIFACT:_default' \ -'*--set=[override options in bootstrap.toml]:section.option=value:' \ -'--ci=[Make bootstrap to behave as it'\''s running on the CI environment or not]:bool:(true false)' \ -'--run[run suggested tests]' \ -'*-v[use verbose output (-vv for very verbose)]' \ -'*--verbose[use verbose output (-vv for very verbose)]' \ -'-i[use incremental compilation]' \ -'--incremental[use incremental compilation]' \ -'--include-default-paths[include default paths in addition to the provided ones]' \ -'--dry-run[dry run; don'\''t build anything]' \ -'--dump-bootstrap-shims[Indicates whether to dump the work done from bootstrap shims]' \ -'--json-output[use message-format=json]' \ -'--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)]' \ -'--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]' \ -'--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[Print help (see more with '\''--help'\'')]' \ -'--help[Print help (see more with '\''--help'\'')]' \ -'*::paths -- paths for the subcommand:_files' \ -&& ret=0 -;; (vendor) _arguments "${_arguments_options[@]}" : \ '*--sync=[Additional \`Cargo.toml\` to sync and vendor]:SYNC:_files' \ @@ -1097,7 +1053,6 @@ _x_commands() { 'install:Install distribution artifacts' \ 'run:Run tools contained in this repository' \ 'setup:Set up the environment for development' \ -'suggest:Suggest a subset of tests to run, based on modified files' \ 'vendor:Vendor dependencies' \ 'perf:Perform profiling and benchmarking of the compiler using \`rustc-perf\`' \ ) @@ -1204,11 +1159,6 @@ _x__setup_commands() { local commands; commands=() _describe -t commands 'x setup commands' commands "$@" } -(( $+functions[_x__suggest_commands] )) || -_x__suggest_commands() { - local commands; commands=() - _describe -t commands 'x suggest commands' commands "$@" -} (( $+functions[_x__test_commands] )) || _x__test_commands() { local commands; commands=() diff --git a/src/tools/suggest-tests/Cargo.toml b/src/tools/suggest-tests/Cargo.toml deleted file mode 100644 index d6f86078d7eff..0000000000000 --- a/src/tools/suggest-tests/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "suggest-tests" -version = "0.1.0" -edition = "2021" - -[dependencies] -glob = "0.3.0" -build_helper = { version = "0.1.0", path = "../../build_helper" } diff --git a/src/tools/suggest-tests/src/dynamic_suggestions.rs b/src/tools/suggest-tests/src/dynamic_suggestions.rs deleted file mode 100644 index f09720f1c91fa..0000000000000 --- a/src/tools/suggest-tests/src/dynamic_suggestions.rs +++ /dev/null @@ -1,32 +0,0 @@ -use std::path::Path; - -use crate::Suggestion; - -type DynamicSuggestion = fn(&Path) -> Vec; - -pub(crate) const DYNAMIC_SUGGESTIONS: &[DynamicSuggestion] = &[ - |path: &Path| -> Vec { - if path.starts_with("compiler/") || path.starts_with("library/") { - let path = path.components().take(2).collect::>(); - - vec![Suggestion::with_single_path( - "test", - None, - &format!( - "{}/{}", - path[0].as_os_str().to_str().unwrap(), - path[1].as_os_str().to_str().unwrap() - ), - )] - } else { - Vec::new() - } - }, - |path: &Path| -> Vec { - if path.starts_with("compiler/rustc_pattern_analysis") { - vec![Suggestion::new("test", None, &["tests/ui", "--test-args", "pattern"])] - } else { - Vec::new() - } - }, -]; diff --git a/src/tools/suggest-tests/src/lib.rs b/src/tools/suggest-tests/src/lib.rs deleted file mode 100644 index cc1288c6b72ee..0000000000000 --- a/src/tools/suggest-tests/src/lib.rs +++ /dev/null @@ -1,96 +0,0 @@ -use std::fmt::{self, Display}; -use std::path::Path; - -use dynamic_suggestions::DYNAMIC_SUGGESTIONS; -use glob::Pattern; -use static_suggestions::static_suggestions; - -mod dynamic_suggestions; -mod static_suggestions; - -#[cfg(test)] -mod tests; - -macro_rules! sug { - ($cmd:expr) => { - Suggestion::new($cmd, None, &[]) - }; - - ($cmd:expr, $paths:expr) => { - Suggestion::new($cmd, None, $paths.as_slice()) - }; - - ($cmd:expr, $stage:expr, $paths:expr) => { - Suggestion::new($cmd, Some($stage), $paths.as_slice()) - }; -} - -pub(crate) use sug; - -pub fn get_suggestions>(modified_files: &[T]) -> Vec { - let mut suggestions = Vec::new(); - - // static suggestions - for (globs, sugs) in static_suggestions().iter() { - let globs = globs - .iter() - .map(|glob| Pattern::new(glob).expect("Found invalid glob pattern!")) - .collect::>(); - let matches_some_glob = |file: &str| globs.iter().any(|glob| glob.matches(file)); - - if modified_files.iter().map(AsRef::as_ref).any(matches_some_glob) { - suggestions.extend_from_slice(sugs); - } - } - - // dynamic suggestions - for sug in DYNAMIC_SUGGESTIONS { - for file in modified_files { - let sugs = sug(Path::new(file.as_ref())); - - suggestions.extend_from_slice(&sugs); - } - } - - suggestions.sort(); - suggestions.dedup(); - - suggestions -} - -#[derive(Clone, PartialOrd, Ord, PartialEq, Eq, Debug)] -pub struct Suggestion { - pub cmd: String, - pub stage: Option, - pub paths: Vec, -} - -impl Suggestion { - pub fn new(cmd: &str, stage: Option, paths: &[&str]) -> Self { - Self { cmd: cmd.to_owned(), stage, paths: paths.iter().map(|p| p.to_string()).collect() } - } - - pub fn with_single_path(cmd: &str, stage: Option, path: &str) -> Self { - Self::new(cmd, stage, &[path]) - } -} - -impl Display for Suggestion { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { - write!(f, "{} ", self.cmd)?; - - for path in &self.paths { - write!(f, "{} ", path)?; - } - - if let Some(stage) = self.stage { - write!(f, "{}", stage)?; - } else { - // write a sentinel value here (in place of a stage) to be consumed - // by the shim in bootstrap, it will be read and ignored. - write!(f, "N/A")?; - } - - Ok(()) - } -} diff --git a/src/tools/suggest-tests/src/main.rs b/src/tools/suggest-tests/src/main.rs deleted file mode 100644 index d84f8e9fa1bab..0000000000000 --- a/src/tools/suggest-tests/src/main.rs +++ /dev/null @@ -1,40 +0,0 @@ -use std::process::ExitCode; - -use build_helper::git::{GitConfig, get_git_modified_files}; -use suggest_tests::get_suggestions; - -fn main() -> ExitCode { - let modified_files = get_git_modified_files( - &GitConfig { - nightly_branch: &env("SUGGEST_TESTS_NIGHTLY_BRANCH"), - git_merge_commit_email: &env("SUGGEST_TESTS_MERGE_COMMIT_EMAIL"), - }, - None, - &Vec::new(), - ); - let modified_files = match modified_files { - Ok(files) => files, - Err(err) => { - eprintln!("Could not get modified files from git: \"{err}\""); - return ExitCode::FAILURE; - } - }; - - let suggestions = get_suggestions(&modified_files); - - for sug in &suggestions { - println!("{sug}"); - } - - ExitCode::SUCCESS -} - -fn env(key: &str) -> String { - match std::env::var(key) { - Ok(var) => var, - Err(err) => { - eprintln!("suggest-tests: failed to read environment variable {key}: {err}"); - std::process::exit(1); - } - } -} diff --git a/src/tools/suggest-tests/src/static_suggestions.rs b/src/tools/suggest-tests/src/static_suggestions.rs deleted file mode 100644 index d363d583b546f..0000000000000 --- a/src/tools/suggest-tests/src/static_suggestions.rs +++ /dev/null @@ -1,40 +0,0 @@ -use std::sync::OnceLock; - -use crate::{Suggestion, sug}; - -// FIXME: perhaps this could use `std::lazy` when it is stabilized -macro_rules! static_suggestions { - ($( [ $( $glob:expr ),* $(,)? ] => [ $( $suggestion:expr ),* $(,)? ] ),* $(,)? ) => { - pub(crate) fn static_suggestions() -> &'static [(Vec<&'static str>, Vec)] - { - static S: OnceLock, Vec)>> = OnceLock::new(); - S.get_or_init(|| vec![ $( (vec![ $($glob),* ], vec![ $($suggestion),* ]) ),*]) - } - } -} - -static_suggestions! { - ["*.md"] => [ - sug!("test", 0, ["linkchecker"]), - ], - - ["compiler/*"] => [ - sug!("check"), - sug!("test", 1, ["tests/ui", "tests/run-make"]), - ], - - ["compiler/rustc_mir_transform/*"] => [ - sug!("test", 1, ["mir-opt"]), - ], - - [ - "compiler/rustc_mir_transform/src/coverage/*", - "compiler/rustc_codegen_llvm/src/coverageinfo/*", - ] => [ - sug!("test", 1, ["coverage"]), - ], - - ["src/librustdoc/*"] => [ - sug!("test", 1, ["rustdoc"]), - ], -} diff --git a/src/tools/suggest-tests/src/tests.rs b/src/tools/suggest-tests/src/tests.rs deleted file mode 100644 index b4149136fa309..0000000000000 --- a/src/tools/suggest-tests/src/tests.rs +++ /dev/null @@ -1,21 +0,0 @@ -macro_rules! sugg_test { - ( $( $name:ident: $paths:expr => $suggestions:expr ),* ) => { - $( - #[test] - fn $name() { - let suggestions = crate::get_suggestions(&$paths).into_iter().map(|s| s.to_string()).collect::>(); - assert_eq!(suggestions, $suggestions); - } - )* - }; -} - -sugg_test! { - test_error_code_docs: ["compiler/rustc_error_codes/src/error_codes/E0000.md"] => - ["check N/A", "test compiler/rustc_error_codes N/A", "test linkchecker 0", "test tests/ui tests/run-make 1"], - - test_rustdoc: ["src/librustdoc/src/lib.rs"] => ["test rustdoc 1"], - - test_rustdoc_and_libstd: ["src/librustdoc/src/lib.rs", "library/std/src/lib.rs"] => - ["test library/std N/A", "test rustdoc 1"] -} diff --git a/triagebot.toml b/triagebot.toml index 4e3dff219f1d6..97ede16ed3f0f 100644 --- a/triagebot.toml +++ b/triagebot.toml @@ -499,7 +499,6 @@ trigger_files = [ "src/tools/remote-test-server", "src/tools/remote-test-client", "src/tools/rustdoc-gui-test", - "src/tools/suggest-tests", ] [autolabel."A-tidy"]