]> git.lizzy.rs Git - rust.git/blobdiff - src/bootstrap/install.rs
Add an optional condition to constrain defaults.
[rust.git] / src / bootstrap / install.rs
index fac69f89dc1d16967ebbd1b7b2c04a9ca58b4033..d2870832086e8d6ee9c47919c88b8d1301a505f4 100644 (file)
@@ -150,7 +150,8 @@ impl Step for $name {
             $(const $c: bool = true;)*
 
             fn should_run(run: ShouldRun) -> ShouldRun {
-                run.path($path)
+                let $builder = run.builder;
+                run.path($path).default_condition($default_cond)
             }
 
             fn make_run(
@@ -159,9 +160,6 @@ fn make_run(
                 host: Interned<String>,
                 target: Interned<String>,
             ) {
-                if path.is_none() && !($default_cond) {
-                    return;
-                }
                 $builder.ensure($name {
                     stage: $builder.top_stage,
                     target,
@@ -177,20 +175,10 @@ fn run($sel, $builder: &Builder) {
 }
 
 install!((self, builder),
-    // rules.install("install-docs", "src/doc")
-    //      .default(build.config.docs)
-    //      .only_host_build(true)
-    //      .dep(|s| s.name("dist-docs"))
-    //      .run(move |s| install::Installer::new(build).install_docs(s.stage, s.target));
     Docs, "src/doc", builder.build.config.docs, only_hosts: false, {
         builder.ensure(dist::Docs { stage: self.stage, target: self.target });
         install_docs(builder, self.stage, self.target);
     };
-    // rules.install("install-std", "src/libstd")
-    //      .default(true)
-    //      .only_host_build(true)
-    //      .dep(|s| s.name("dist-std"))
-    //      .run(move |s| install::Installer::new(build).install_std(s.stage));
     Std, "src/libstd", true, only_hosts: true, {
         builder.ensure(dist::Std {
             compiler: builder.compiler(self.stage, self.host),
@@ -198,31 +186,14 @@ fn run($sel, $builder: &Builder) {
         });
         install_std(builder, self.stage);
     };
-    // rules.install("install-cargo", "cargo")
-    //      .default(build.config.extended)
-    //      .host(true)
-    //      .only_host_build(true)
-    //      .dep(|s| s.name("dist-cargo"))
-    //      .run(move |s| install::Installer::new(build).install_cargo(s.stage, s.target));
     Cargo, "cargo", builder.build.config.extended, only_hosts: true, {
         builder.ensure(dist::Cargo { stage: self.stage, target: self.target });
         install_cargo(builder, self.stage, self.target);
     };
-    // rules.install("install-rls", "rls")
-    //      .default(build.config.extended)
-    //      .host(true)
-    //      .only_host_build(true)
-    //      .dep(|s| s.name("dist-rls"))
-    //      .run(move |s| install::Installer::new(build).install_rls(s.stage, s.target));
     Rls, "rls", builder.build.config.extended, only_hosts: true, {
         builder.ensure(dist::Rls { stage: self.stage, target: self.target });
         install_rls(builder, self.stage, self.target);
     };
-    // rules.install("install-analysis", "analysis")
-    //      .default(build.config.extended)
-    //      .only_host_build(true)
-    //      .dep(|s| s.name("dist-analysis"))
-    //      .run(move |s| install::Installer::new(build).install_analysis(s.stage, s.target));
     Analysis, "analysis", builder.build.config.extended, only_hosts: false, {
         builder.ensure(dist::Analysis {
             compiler: builder.compiler(self.stage, self.host),
@@ -230,23 +201,10 @@ fn run($sel, $builder: &Builder) {
         });
         install_analysis(builder, self.stage, self.target);
     };
-    // rules.install("install-src", "src")
-    //      .default(build.config.extended)
-    //      .host(true)
-    //      .only_build(true)
-    //      .only_host_build(true)
-    //      .dep(|s| s.name("dist-src"))
-    //      .run(move |s| install::Installer::new(build).install_src(s.stage));
     Src, "src", builder.build.config.extended, only_hosts: true, {
         builder.ensure(dist::Src);
         install_src(builder, self.stage);
     }, ONLY_BUILD;
-    // rules.install("install-rustc", "src/librustc")
-    //      .default(true)
-    //      .host(true)
-    //      .only_host_build(true)
-    //      .dep(|s| s.name("dist-rustc"))
-    //      .run(move |s| install::Installer::new(build).install_rustc(s.stage, s.target));
     Rustc, "src/librustc", builder.build.config.extended, only_hosts: true, {
         builder.ensure(dist::Rustc { stage: self.stage, target: self.target });
         install_rustc(builder, self.stage, self.target);