about summary refs log tree commit diff
path: root/src/bootstrap/flags.rs
diff options
context:
space:
mode:
authorDylan MacKenzie <ecstaticmorse@gmail.com>2020-09-23 14:25:23 -0700
committerDylan MacKenzie <ecstaticmorse@gmail.com>2020-09-23 14:25:23 -0700
commitbcbd2ccc8d4591705fd5b63a5d5f5fc320cd89be (patch)
treea9969e5fa340e6fc4fefc3236ae593e29e0b46a2 /src/bootstrap/flags.rs
parenta6008fac97f81a3fc51668b0c7fa0e2e6f2a599b (diff)
downloadrust-bcbd2ccc8d4591705fd5b63a5d5f5fc320cd89be.tar.gz
rust-bcbd2ccc8d4591705fd5b63a5d5f5fc320cd89be.zip
Add `keep-stage-std` to `x.py`
This keeps only the `std` artifacts compiled by the given stage, not the
compiler. This is useful when working on the latter stages of the
compiler in tandem with the standard library, since you don't have to
rebuild the *entire* compiler when the standard library changes.
Diffstat (limited to 'src/bootstrap/flags.rs')
-rw-r--r--src/bootstrap/flags.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs
index 842c84a3e5c..dad31fc77be 100644
--- a/src/bootstrap/flags.rs
+++ b/src/bootstrap/flags.rs
@@ -19,6 +19,7 @@ pub struct Flags {
     pub on_fail: Option<String>,
     pub stage: Option<u32>,
     pub keep_stage: Vec<u32>,
+    pub keep_stage_std: Vec<u32>,
 
     pub host: Option<Vec<TargetSelection>>,
     pub target: Option<Vec<TargetSelection>>,
@@ -144,6 +145,13 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
             (pass multiple times to keep e.g., both stages 0 and 1)",
             "N",
         );
+        opts.optmulti(
+            "",
+            "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",
+        );
         opts.optopt("", "src", "path to the root of the rust checkout", "DIR");
         let j_msg = format!(
             "number of jobs to run in parallel; \
@@ -510,7 +518,9 @@ Arguments:
                 println!("--stage not supported for x.py check, always treated as stage 0");
                 process::exit(1);
             }
-            if matches.opt_str("keep-stage").is_some() {
+            if matches.opt_str("keep-stage").is_some()
+                || matches.opt_str("keep-stage-std").is_some()
+            {
                 println!("--keep-stage not supported for x.py check, only one stage available");
                 process::exit(1);
             }
@@ -528,6 +538,11 @@ Arguments:
                 .into_iter()
                 .map(|j| j.parse().expect("`keep-stage` should be a number"))
                 .collect(),
+            keep_stage_std: matches
+                .opt_strs("keep-stage-std")
+                .into_iter()
+                .map(|j| j.parse().expect("`keep-stage-std` should be a number"))
+                .collect(),
             host: if matches.opt_present("host") {
                 Some(
                     split(&matches.opt_strs("host"))