]> git.lizzy.rs Git - rust.git/commitdiff
Remove ONLY_BUILD.
authorMark Simulacrum <mark.simulacrum@gmail.com>
Sun, 11 Feb 2018 22:41:06 +0000 (15:41 -0700)
committerMark Simulacrum <mark.simulacrum@gmail.com>
Fri, 9 Mar 2018 03:30:00 +0000 (20:30 -0700)
All uses are replaced with not accessing run.target/run.host, and
instead directly using run.builder.build.build.

src/bootstrap/builder.rs
src/bootstrap/install.rs
src/bootstrap/test.rs

index 1e15d5393829f15662b3453d021777c3a9a3a36c..7da88bffa4b4a2a1696fdbc4b55c28be4c5d3ffd 100644 (file)
@@ -60,9 +60,6 @@ pub trait Step: 'static + Clone + Debug + PartialEq + Eq + Hash {
     /// Run this rule for all hosts without cross compiling.
     const ONLY_HOSTS: bool = false;
 
-    /// Only run this step with the build triple as host and target.
-    const ONLY_BUILD: bool = false;
-
     /// Primary function to execute this rule. Can call `builder.ensure(...)`
     /// with other steps to run those.
     fn run(self, builder: &Builder) -> Self::Output;
@@ -98,7 +95,6 @@ pub struct RunConfig<'a> {
 struct StepDescription {
     default: bool,
     only_hosts: bool,
-    only_build: bool,
     should_run: fn(ShouldRun) -> ShouldRun,
     make_run: fn(RunConfig),
     name: &'static str,
@@ -134,7 +130,6 @@ fn from<S: Step>() -> StepDescription {
         StepDescription {
             default: S::DEFAULT,
             only_hosts: S::ONLY_HOSTS,
-            only_build: S::ONLY_BUILD,
             should_run: S::should_run,
             make_run: S::make_run,
             name: unsafe { ::std::intrinsics::type_name::<S>() },
@@ -150,18 +145,12 @@ fn maybe_run(&self, builder: &Builder, pathset: &PathSet) {
                 self.name, builder.config.exclude);
         }
         let build = builder.build;
-        let hosts = if self.only_build {
-            build.build_triple()
-        } else {
-            &build.hosts
-        };
+        let hosts = &build.hosts;
 
         // Determine the targets participating in this rule.
         let targets = if self.only_hosts {
             if build.config.run_host_only {
                 &[]
-            } else if self.only_build {
-                build.build_triple()
             } else {
                 &build.hosts
             }
index fa48902d55893b73921058e53fc507dd416e9f96..17900fc35e0950be6990bc99ff6442e2a267696f 100644 (file)
@@ -225,10 +225,6 @@ fn run($sel, $builder: &Builder) {
         });
         install_analysis(builder, self.stage, self.target);
     };
-    Src, "src", Self::should_build(_config) , only_hosts: true, {
-        builder.ensure(dist::Src);
-        install_src(builder, self.stage);
-    }, ONLY_BUILD;
     Rustc, "src/librustc", true, only_hosts: true, {
         builder.ensure(dist::Rustc {
             compiler: builder.compiler(self.stage, self.target),
@@ -236,3 +232,32 @@ fn run($sel, $builder: &Builder) {
         install_rustc(builder, self.stage, self.target);
     };
 );
+
+#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct Src {
+    pub stage: u32,
+}
+
+impl Step for Src {
+    type Output = ();
+    const DEFAULT: bool = true;
+    const ONLY_HOSTS: bool = true;
+
+    fn should_run(run: ShouldRun) -> ShouldRun {
+        let config = &run.builder.config;
+        let cond = config.extended &&
+            config.tools.as_ref().map_or(true, |t| t.contains("src"));
+        run.path("src").default_condition(cond)
+    }
+
+    fn make_run(run: RunConfig) {
+        run.builder.ensure(Src {
+            stage: run.builder.top_stage,
+        });
+    }
+
+    fn run(self, builder: &Builder) {
+        builder.ensure(dist::Src);
+        install_src(builder, self.stage);
+    }
+}
index 48490493525f971708c1781b4a2fb1a984a1c0ba..7054c8005060c0967a64170a202dd9374704ac2f 100644 (file)
@@ -505,27 +505,23 @@ fn run(self, builder: &Builder) {
 }
 
 #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
-pub struct Tidy {
-    host: Interned<String>,
-}
+pub struct Tidy;
 
 impl Step for Tidy {
     type Output = ();
     const DEFAULT: bool = true;
     const ONLY_HOSTS: bool = true;
-    const ONLY_BUILD: bool = true;
 
-    /// Runs the `tidy` tool as compiled in `stage` by the `host` compiler.
+    /// Runs the `tidy` tool.
     ///
     /// This tool in `src/tools` checks up on various bits and pieces of style and
     /// otherwise just implements a few lint-like checks that are specific to the
     /// compiler itself.
     fn run(self, builder: &Builder) {
         let build = builder.build;
-        let host = self.host;
 
         let _folder = build.fold_output(|| "tidy");
-        println!("tidy check ({})", host);
+        println!("tidy check");
         let mut cmd = builder.tool_cmd(Tool::Tidy);
         cmd.arg(build.src.join("src"));
         cmd.arg(&build.initial_cargo);
@@ -543,9 +539,7 @@ fn should_run(run: ShouldRun) -> ShouldRun {
     }
 
     fn make_run(run: RunConfig) {
-        run.builder.ensure(Tidy {
-            host: run.builder.build.build,
-        });
+        run.builder.ensure(Tidy);
     }
 }
 
@@ -1607,7 +1601,6 @@ fn run(self, builder: &Builder) {
 
 impl Step for Distcheck {
     type Output = ();
-    const ONLY_BUILD: bool = true;
 
     fn should_run(run: ShouldRun) -> ShouldRun {
         run.path("distcheck")
@@ -1673,7 +1666,6 @@ impl Step for Bootstrap {
     type Output = ();
     const DEFAULT: bool = true;
     const ONLY_HOSTS: bool = true;
-    const ONLY_BUILD: bool = true;
 
     /// Test the build system itself
     fn run(self, builder: &Builder) {