about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-04-29 03:56:09 +0000
committerbors <bors@rust-lang.org>2017-04-29 03:56:09 +0000
commit95467d33cb98c8a9be12da15be559e60628180f5 (patch)
tree7f26940956ae3d491e87b1333bfd7ce60347cd77 /src/bootstrap
parent810ed98d08158574e98b504c0955fce6c6a72ad9 (diff)
parenta8c6ba9c6eff834721e0c775de975b8741431fd0 (diff)
downloadrust-95467d33cb98c8a9be12da15be559e60628180f5.tar.gz
rust-95467d33cb98c8a9be12da15be559e60628180f5.zip
Auto merge of #41577 - Keruspe:master, r=alexcrichton
rustbuild improvements

Properly hook up cargo and rls in the build phase, and install them, when extended build is enabled.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/install.rs24
-rw-r--r--src/bootstrap/lib.rs5
-rw-r--r--src/bootstrap/step.rs3
3 files changed, 24 insertions, 8 deletions
diff --git a/src/bootstrap/install.rs b/src/bootstrap/install.rs
index d508616e4b1..c805522fbf5 100644
--- a/src/bootstrap/install.rs
+++ b/src/bootstrap/install.rs
@@ -46,24 +46,32 @@ pub fn install(build: &Build, stage: u32, host: &str) {
     let empty_dir = build.out.join("tmp/empty_dir");
     t!(fs::create_dir_all(&empty_dir));
     if build.config.docs {
-        install_sh(&build, "docs", "rust-docs", stage, host, &prefix,
-                   &docdir, &libdir, &mandir, &empty_dir);
+        install_sh(&build, "docs", "rust-docs", &build.rust_package_vers(),
+                   stage, host, &prefix, &docdir, &libdir, &mandir, &empty_dir);
     }
 
     for target in build.config.target.iter() {
-        install_sh(&build, "std", "rust-std", stage, target, &prefix,
-                   &docdir, &libdir, &mandir, &empty_dir);
+        install_sh(&build, "std", "rust-std", &build.rust_package_vers(),
+                   stage, target, &prefix, &docdir, &libdir, &mandir, &empty_dir);
     }
 
-    install_sh(&build, "rustc", "rustc", stage, host, &prefix,
-               &docdir, &libdir, &mandir, &empty_dir);
+    if build.config.extended {
+        install_sh(&build, "cargo", "cargo", &build.cargo_package_vers(),
+                   stage, host, &prefix, &docdir, &libdir, &mandir, &empty_dir);
+        install_sh(&build, "rls", "rls", &build.rls_package_vers(),
+                   stage, host, &prefix, &docdir, &libdir, &mandir, &empty_dir);
+    }
+
+    install_sh(&build, "rustc", "rustc", &build.rust_package_vers(),
+               stage, host, &prefix, &docdir, &libdir, &mandir, &empty_dir);
+
     t!(fs::remove_dir_all(&empty_dir));
 }
 
-fn install_sh(build: &Build, package: &str, name: &str, stage: u32, host: &str,
+fn install_sh(build: &Build, package: &str, name: &str, version: &str, stage: u32, host: &str,
               prefix: &Path, docdir: &Path, libdir: &Path, mandir: &Path, empty_dir: &Path) {
     println!("Install {} stage{} ({})", package, stage, host);
-    let package_name = format!("{}-{}-{}", name, build.rust_package_vers(), host);
+    let package_name = format!("{}-{}-{}", name, version, host);
 
     let mut cmd = Command::new("sh");
     cmd.current_dir(empty_dir)
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 74c58844741..2852421ad28 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -1054,6 +1054,11 @@ impl Build {
         self.package_vers(&self.release_num("cargo"))
     }
 
+    /// Returns the value of `package_vers` above for rls
+    fn rls_package_vers(&self) -> String {
+        self.package_vers(&self.release_num("rls"))
+    }
+
     /// Returns the `version` string associated with this compiler for Rust
     /// itself.
     ///
diff --git a/src/bootstrap/step.rs b/src/bootstrap/step.rs
index a4d6f91fbef..c15e889394f 100644
--- a/src/bootstrap/step.rs
+++ b/src/bootstrap/step.rs
@@ -575,6 +575,8 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
          .dep(|s| s.name("libstd-tool"))
          .run(move |s| compile::tool(build, s.stage, s.target, "remote-test-client"));
     rules.build("tool-cargo", "cargo")
+         .host(true)
+         .default(build.config.extended)
          .dep(|s| s.name("maybe-clean-tools"))
          .dep(|s| s.name("libstd-tool"))
          .dep(|s| s.stage(0).host(s.target).name("openssl"))
@@ -588,6 +590,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
          .run(move |s| compile::tool(build, s.stage, s.target, "cargo"));
     rules.build("tool-rls", "rls")
          .host(true)
+         .default(build.config.extended)
          .dep(|s| s.name("librustc-tool"))
          .dep(|s| s.stage(0).host(s.target).name("openssl"))
          .dep(move |s| {