about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-04-14 14:27:51 -0700
committerAlex Crichton <alex@alexcrichton.com>2016-04-15 09:23:12 -0700
commit73c2d2a7419844f763b1ac72b89236bd3183bfaf (patch)
tree1059aab83d7e3505e5d86aa7f7b17b32fe356aaf /src/bootstrap
parent073a09fd63c9b4ec3bb4709986a2517ca4c3cdf1 (diff)
cargotest: Put output in build directory
Right now cargotest uses `TempDir` to place output into the system temp
directory, but unfortunately this means that if the process is interrupted then
it'll leak the directory and that'll never get cleaned up. One of our bots
filled up its disk space and there were 20 cargotest directories lying around so
seems prudent to clean them up!

By putting the output in the build directory it should ensure that we don't leak
too many extra builds.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/build/check.rs13
-rw-r--r--src/bootstrap/build/step.rs5
2 files changed, 14 insertions, 4 deletions
diff --git a/src/bootstrap/build/check.rs b/src/bootstrap/build/check.rs
index d4e344fc482..6aad49bc988 100644
--- a/src/bootstrap/build/check.rs
+++ b/src/bootstrap/build/check.rs
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+use std::fs;
+
 use build::{Build, Compiler};
 
 pub fn linkcheck(build: &Build, stage: u32, host: &str) {
@@ -29,9 +31,16 @@ pub fn cargotest(build: &Build, stage: u32, host: &str) {
     let sep = if cfg!(windows) { ";" } else {":" };
     let ref newpath = format!("{}{}{}", path.display(), sep, old_path);
 
+    // Note that this is a short, cryptic, and not scoped directory name. This
+    // is currently to minimize the length of path on Windows where we otherwise
+    // quickly run into path name limit constraints.
+    let out_dir = build.out.join("ct");
+    t!(fs::create_dir_all(&out_dir));
+
     build.run(build.tool_cmd(compiler, "cargotest")
-              .env("PATH", newpath)
-              .arg(&build.cargo));
+                   .env("PATH", newpath)
+                   .arg(&build.cargo)
+                   .arg(&out_dir));
 }
 
 pub fn tidy(build: &Build, stage: u32, host: &str) {
diff --git a/src/bootstrap/build/step.rs b/src/bootstrap/build/step.rs
index 2312f96348c..07cfb96c30d 100644
--- a/src/bootstrap/build/step.rs
+++ b/src/bootstrap/build/step.rs
@@ -318,7 +318,8 @@ impl<'a> Step<'a> {
                 vec![self.tool_linkchecker(stage), self.doc(stage)]
             }
             Source::CheckCargoTest { stage } => {
-                vec![self.tool_cargotest(stage)]
+                vec![self.tool_cargotest(stage),
+                     self.librustc(self.compiler(stage))]
             }
             Source::CheckTidy { stage } => {
                 vec![self.tool_tidy(stage)]
@@ -333,7 +334,7 @@ impl<'a> Step<'a> {
                 vec![self.librustc(self.compiler(stage))]
             }
             Source::ToolCargoTest { stage } => {
-                vec![self.librustc(self.compiler(stage))]
+                vec![self.libstd(self.compiler(stage))]
             }
 
             Source::DistDocs { stage } => vec![self.doc(stage)],