rustbuild: Compile all support tools in stage0
This commit changes all tools and such to get compiled in stage0, not in later stages. The purpose of this commit is to cut down dependencies on later stages for future modifications to the build system. Notably we're going to be adding builders that produce a full suite of cross-compiled artifacts for a particular host, and that shouldn't compile the `x86_64-unknown-linux-gnu` compiler more than once. Currently dependencies on, for example, the error index end up compiling the `x86_64-unknown-linux-gnu` compiler more than necessary. As a result here we move many dependencies on these tools to being produced by a stage0 compiler, not a stage1+ compiler. None of these tools actually need to be staged at all, so they'll exhibit consistent behavior across the stages.
This commit is contained in:
parent
7f2d2afa91
commit
254876ee73
10 changed files with 63 additions and 40 deletions
|
|
@ -62,9 +62,9 @@ impl fmt::Display for TestKind {
|
|||
///
|
||||
/// This tool in `src/tools` will verify the validity of all our links in the
|
||||
/// documentation to ensure we don't have a bunch of dead ones.
|
||||
pub fn linkcheck(build: &Build, stage: u32, host: &str) {
|
||||
println!("Linkcheck stage{} ({})", stage, host);
|
||||
let compiler = Compiler::new(stage, host);
|
||||
pub fn linkcheck(build: &Build, host: &str) {
|
||||
println!("Linkcheck ({})", host);
|
||||
let compiler = Compiler::new(0, host);
|
||||
|
||||
let _time = util::timeit();
|
||||
build.run(build.tool_cmd(&compiler, "linkchecker")
|
||||
|
|
@ -93,10 +93,11 @@ pub fn cargotest(build: &Build, stage: u32, host: &str) {
|
|||
t!(fs::create_dir_all(&out_dir));
|
||||
|
||||
let _time = util::timeit();
|
||||
build.run(build.tool_cmd(compiler, "cargotest")
|
||||
.env("PATH", newpath)
|
||||
.arg(&build.cargo)
|
||||
.arg(&out_dir));
|
||||
let mut cmd = Command::new(build.tool(&Compiler::new(0, host), "cargotest"));
|
||||
build.prepare_tool_cmd(compiler, &mut cmd);
|
||||
build.run(cmd.env("PATH", newpath)
|
||||
.arg(&build.cargo)
|
||||
.arg(&out_dir));
|
||||
}
|
||||
|
||||
/// Runs the `tidy` tool as compiled in `stage` by the `host` compiler.
|
||||
|
|
@ -104,9 +105,9 @@ pub fn cargotest(build: &Build, stage: u32, host: &str) {
|
|||
/// This tool in `src/tools` checks up on various bits and pieces of style and
|
||||
/// otherwise just implements a few lint-like checks that are specific to the
|
||||
/// compiler itself.
|
||||
pub fn tidy(build: &Build, stage: u32, host: &str) {
|
||||
println!("tidy check stage{} ({})", stage, host);
|
||||
let compiler = Compiler::new(stage, host);
|
||||
pub fn tidy(build: &Build, host: &str) {
|
||||
println!("tidy check ({})", host);
|
||||
let compiler = Compiler::new(0, host);
|
||||
build.run(build.tool_cmd(&compiler, "tidy")
|
||||
.arg(build.src.join("src")));
|
||||
}
|
||||
|
|
@ -127,7 +128,9 @@ pub fn compiletest(build: &Build,
|
|||
suite: &str) {
|
||||
println!("Check compiletest suite={} mode={} ({} -> {})",
|
||||
suite, mode, compiler.host, target);
|
||||
let mut cmd = build.tool_cmd(compiler, "compiletest");
|
||||
let mut cmd = Command::new(build.tool(&Compiler::new(0, compiler.host),
|
||||
"compiletest"));
|
||||
build.prepare_tool_cmd(compiler, &mut cmd);
|
||||
|
||||
// compiletest currently has... a lot of arguments, so let's just pass all
|
||||
// of them!
|
||||
|
|
@ -287,7 +290,8 @@ pub fn error_index(build: &Build, compiler: &Compiler) {
|
|||
let output = dir.join("error-index.md");
|
||||
|
||||
let _time = util::timeit();
|
||||
build.run(build.tool_cmd(compiler, "error_index_generator")
|
||||
build.run(build.tool_cmd(&Compiler::new(0, compiler.host),
|
||||
"error_index_generator")
|
||||
.arg("markdown")
|
||||
.arg(&output)
|
||||
.env("CFG_BUILD", &build.config.build));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue