From 73c2d2a7419844f763b1ac72b89236bd3183bfaf Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 14 Apr 2016 14:27:51 -0700 Subject: 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. --- src/bootstrap/build/check.rs | 13 +++++++++++-- src/bootstrap/build/step.rs | 5 +++-- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src/bootstrap') 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)], -- cgit 1.4.1-3-g733a5