builder.ensure(tool::CleanTools {
compiler: target_compiler,
target,
- mode: Mode::Std,
+ cause: Mode::Std,
});
}
}
builder.ensure(tool::CleanTools {
compiler: target_compiler,
target,
- mode: Mode::Test,
+ cause: Mode::Test,
});
}
}
builder.ensure(tool::CleanTools {
compiler: target_compiler,
target,
- mode: Mode::Rustc,
+ cause: Mode::Rustc,
});
}
}
/// Build libtest, placing output in the "stageN-test" directory.
Test,
- /// Build librustc, codegen and compiler libraries, placing output
- /// in the "stageN-rustc" directory.
+ /// Build librustc, and compiler libraries, placing output in the "stageN-rustc" directory.
Rustc,
+
+ /// Build codegen libraries, placing output in the "stageN-codegen" directory
Codegen,
/// Build some tools, placing output in the "stageN-tools" directory.
fn stage_out(&self, compiler: Compiler, mode: Mode) -> PathBuf {
let suffix = match mode {
Mode::Std => "-std",
- Mode::ToolStd => "-tools",
Mode::Test => "-test",
- Mode::ToolTest => "-tools",
Mode::Codegen => "-rustc",
Mode::Rustc => "-rustc",
- Mode::ToolRustc => "-tools",
+ Mode::ToolStd | Mode::ToolTest | Mode::ToolRustc => "-tools",
};
self.out.join(&*compiler.host)
.join(format!("stage{}{}", compiler.stage, suffix))
pub struct CleanTools {
pub compiler: Compiler,
pub target: Interned<String>,
- pub mode: Mode,
+ pub cause: Mode,
}
impl Step for CleanTools {
fn run(self, builder: &Builder) {
let compiler = self.compiler;
let target = self.target;
- let mode = self.mode;
+ let cause = self.cause;
// This is for the original compiler, but if we're forced to use stage 1, then
// std/test/rustc stamps won't exist in stage 2, so we need to get those from stage 1, since
compiler
};
- for &cur_mode in &[Mode::ToolStd, Mode::ToolTest, Mode::ToolRustc] {
+ for &cur_mode in &[Mode::Std, Mode::Test, Mode::Rustc] {
let stamp = match cur_mode {
- Mode::ToolStd => libstd_stamp(builder, compiler, target),
- Mode::ToolTest => libtest_stamp(builder, compiler, target),
- Mode::ToolRustc => librustc_stamp(builder, compiler, target),
+ Mode::Std => libstd_stamp(builder, compiler, target),
+ Mode::Test => libtest_stamp(builder, compiler, target),
+ Mode::Rustc => librustc_stamp(builder, compiler, target),
_ => panic!(),
};
// If we are a rustc tool, and std changed, we also need to clear ourselves out -- our
// dependencies depend on std. Therefore, we iterate up until our own mode.
- if mode == cur_mode {
+ if cause == cur_mode {
break;
}
}