summaryrefslogtreecommitdiffstats
path: root/src/bootstrap/flags.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bootstrap/flags.rs')
-rw-r--r--src/bootstrap/flags.rs27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs
index 9d1504c34..b6f5f3103 100644
--- a/src/bootstrap/flags.rs
+++ b/src/bootstrap/flags.rs
@@ -67,8 +67,6 @@ pub struct Flags {
// true => deny, false => warn
pub deny_warnings: Option<bool>,
- pub llvm_skip_rebuild: Option<bool>,
-
pub rust_profile_use: Option<String>,
pub rust_profile_generate: Option<String>,
@@ -86,8 +84,7 @@ pub struct Flags {
pub free_args: Option<Vec<String>>,
}
-#[derive(Debug)]
-#[cfg_attr(test, derive(Clone))]
+#[derive(Debug, Clone)]
pub enum Subcommand {
Build {
paths: Vec<PathBuf>,
@@ -151,6 +148,9 @@ pub enum Subcommand {
Setup {
profile: Option<PathBuf>,
},
+ Suggest {
+ run: bool,
+ },
}
impl Default for Subcommand {
@@ -185,6 +185,7 @@ Subcommands:
install Install distribution artifacts
run, r Run tools contained in this repository
setup Create a config.toml (making it easier to use `x.py` itself)
+ suggest Suggest a subset of tests to run, based on modified files
To learn more about a subcommand, run `./x.py <subcommand> -h`",
);
@@ -251,14 +252,6 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
opts.optopt("", "color", "whether to use color in cargo and rustc output", "STYLE");
opts.optopt(
"",
- "llvm-skip-rebuild",
- "whether rebuilding llvm should be skipped \
- a VALUE of TRUE indicates that llvm will not be rebuilt \
- VALUE overrides the skip-rebuild option in config.toml.",
- "VALUE",
- );
- opts.optopt(
- "",
"rust-profile-generate",
"generate PGO profile with rustc build",
"PROFILE",
@@ -359,6 +352,9 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
Kind::Run => {
opts.optmulti("", "args", "arguments for the tool", "ARGS");
}
+ Kind::Suggest => {
+ opts.optflag("", "run", "run suggested tests");
+ }
_ => {}
};
@@ -575,7 +571,7 @@ Arguments:
Profile::all_for_help(" ").trim_end()
));
}
- Kind::Bench | Kind::Clean | Kind::Dist | Kind::Install => {}
+ Kind::Bench | Kind::Clean | Kind::Dist | Kind::Install | Kind::Suggest => {}
};
// Get any optional paths which occur after the subcommand
let mut paths = matches.free[1..].iter().map(|p| p.into()).collect::<Vec<PathBuf>>();
@@ -636,6 +632,7 @@ Arguments:
Kind::Format => Subcommand::Format { check: matches.opt_present("check"), paths },
Kind::Dist => Subcommand::Dist { paths },
Kind::Install => Subcommand::Install { paths },
+ Kind::Suggest => Subcommand::Suggest { run: matches.opt_present("run") },
Kind::Run => {
if paths.is_empty() {
println!("\nrun requires at least a path!\n");
@@ -714,9 +711,6 @@ Arguments:
.collect::<Vec<_>>(),
include_default_paths: matches.opt_present("include-default-paths"),
deny_warnings: parse_deny_warnings(&matches),
- llvm_skip_rebuild: matches.opt_str("llvm-skip-rebuild").map(|s| s.to_lowercase()).map(
- |s| s.parse::<bool>().expect("`llvm-skip-rebuild` should be either true or false"),
- ),
color: matches
.opt_get_default("color", Color::Auto)
.expect("`color` should be `always`, `never`, or `auto`"),
@@ -747,6 +741,7 @@ impl Subcommand {
Subcommand::Install { .. } => Kind::Install,
Subcommand::Run { .. } => Kind::Run,
Subcommand::Setup { .. } => Kind::Setup,
+ Subcommand::Suggest { .. } => Kind::Suggest,
}
}