Change tools to take a compiler instead of a stage.
This commit is contained in:
parent
f4240a4b20
commit
fe0eca0d3f
3 changed files with 40 additions and 37 deletions
|
@ -194,7 +194,7 @@ impl Step for Cargo {
|
||||||
let build = builder.build;
|
let build = builder.build;
|
||||||
let compiler = builder.compiler(self.stage, self.host);
|
let compiler = builder.compiler(self.stage, self.host);
|
||||||
|
|
||||||
builder.ensure(tool::Cargo { stage: self.stage, target: self.host });
|
builder.ensure(tool::Cargo { compiler, target: self.host });
|
||||||
let mut cargo = builder.cargo(compiler, Mode::Tool, self.host, "test");
|
let mut cargo = builder.cargo(compiler, Mode::Tool, self.host, "test");
|
||||||
cargo.arg("--manifest-path").arg(build.src.join("src/tools/cargo/Cargo.toml"));
|
cargo.arg("--manifest-path").arg(build.src.join("src/tools/cargo/Cargo.toml"));
|
||||||
if !build.fail_fast {
|
if !build.fail_fast {
|
||||||
|
@ -240,7 +240,7 @@ impl Step for Rls {
|
||||||
let host = self.host;
|
let host = self.host;
|
||||||
let compiler = builder.compiler(stage, host);
|
let compiler = builder.compiler(stage, host);
|
||||||
|
|
||||||
builder.ensure(tool::Rls { stage: self.stage, target: self.host });
|
builder.ensure(tool::Rls { compiler, target: self.host });
|
||||||
let mut cargo = builder.cargo(compiler, Mode::Tool, host, "test");
|
let mut cargo = builder.cargo(compiler, Mode::Tool, host, "test");
|
||||||
cargo.arg("--manifest-path").arg(build.src.join("src/tools/rls/Cargo.toml"));
|
cargo.arg("--manifest-path").arg(build.src.join("src/tools/rls/Cargo.toml"));
|
||||||
|
|
||||||
|
@ -1165,7 +1165,7 @@ impl Step for RemoteCopyLibs {
|
||||||
println!("REMOTE copy libs to emulator ({})", target);
|
println!("REMOTE copy libs to emulator ({})", target);
|
||||||
t!(fs::create_dir_all(build.out.join("tmp")));
|
t!(fs::create_dir_all(build.out.join("tmp")));
|
||||||
|
|
||||||
let server = builder.ensure(tool::RemoteTestServer { stage: compiler.stage, target });
|
let server = builder.ensure(tool::RemoteTestServer { compiler, target });
|
||||||
|
|
||||||
// Spawn the emulator and wait for it to come online
|
// Spawn the emulator and wait for it to come online
|
||||||
let tool = builder.tool_exe(Tool::RemoteTestClient);
|
let tool = builder.tool_exe(Tool::RemoteTestClient);
|
||||||
|
|
|
@ -963,7 +963,10 @@ impl Step for Cargo {
|
||||||
// Prepare the image directory
|
// Prepare the image directory
|
||||||
t!(fs::create_dir_all(image.join("share/zsh/site-functions")));
|
t!(fs::create_dir_all(image.join("share/zsh/site-functions")));
|
||||||
t!(fs::create_dir_all(image.join("etc/bash_completion.d")));
|
t!(fs::create_dir_all(image.join("etc/bash_completion.d")));
|
||||||
let cargo = builder.ensure(tool::Cargo { stage, target });
|
let cargo = builder.ensure(tool::Cargo {
|
||||||
|
compiler: builder.compiler(stage, build.build),
|
||||||
|
target
|
||||||
|
});
|
||||||
install(&cargo, &image.join("bin"), 0o755);
|
install(&cargo, &image.join("bin"), 0o755);
|
||||||
for man in t!(etc.join("man").read_dir()) {
|
for man in t!(etc.join("man").read_dir()) {
|
||||||
let man = t!(man);
|
let man = t!(man);
|
||||||
|
@ -1046,7 +1049,10 @@ impl Step for Rls {
|
||||||
t!(fs::create_dir_all(&image));
|
t!(fs::create_dir_all(&image));
|
||||||
|
|
||||||
// Prepare the image directory
|
// Prepare the image directory
|
||||||
let rls = builder.ensure(tool::Rls { stage, target });
|
let rls = builder.ensure(tool::Rls {
|
||||||
|
compiler: builder.compiler(stage, build.build),
|
||||||
|
target
|
||||||
|
});
|
||||||
install(&rls, &image.join("bin"), 0o755);
|
install(&rls, &image.join("bin"), 0o755);
|
||||||
let doc = image.join("share/doc/rls");
|
let doc = image.join("share/doc/rls");
|
||||||
install(&src.join("README.md"), &doc, 0o644);
|
install(&src.join("README.md"), &doc, 0o644);
|
||||||
|
|
|
@ -22,10 +22,10 @@ use channel::GitInfo;
|
||||||
use cache::Interned;
|
use cache::Interned;
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||||
pub struct CleanTools {
|
struct CleanTools {
|
||||||
pub stage: u32,
|
compiler: Compiler,
|
||||||
pub target: Interned<String>,
|
target: Interned<String>,
|
||||||
pub mode: Mode,
|
mode: Mode,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Step for CleanTools {
|
impl Step for CleanTools {
|
||||||
|
@ -41,12 +41,10 @@ impl Step for CleanTools {
|
||||||
/// `stage` into the normal cargo output directory.
|
/// `stage` into the normal cargo output directory.
|
||||||
fn run(self, builder: &Builder) {
|
fn run(self, builder: &Builder) {
|
||||||
let build = builder.build;
|
let build = builder.build;
|
||||||
let stage = self.stage;
|
let compiler = self.compiler;
|
||||||
let target = self.target;
|
let target = self.target;
|
||||||
let mode = self.mode;
|
let mode = self.mode;
|
||||||
|
|
||||||
let compiler = builder.compiler(stage, build.build);
|
|
||||||
|
|
||||||
let stamp = match mode {
|
let stamp = match mode {
|
||||||
Mode::Libstd => libstd_stamp(build, compiler, target),
|
Mode::Libstd => libstd_stamp(build, compiler, target),
|
||||||
Mode::Libtest => libtest_stamp(build, compiler, target),
|
Mode::Libtest => libtest_stamp(build, compiler, target),
|
||||||
|
@ -59,11 +57,11 @@ impl Step for CleanTools {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||||
pub struct ToolBuild {
|
struct ToolBuild {
|
||||||
pub stage: u32,
|
compiler: Compiler,
|
||||||
pub target: Interned<String>,
|
target: Interned<String>,
|
||||||
pub tool: &'static str,
|
tool: &'static str,
|
||||||
pub mode: Mode,
|
mode: Mode,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Step for ToolBuild {
|
impl Step for ToolBuild {
|
||||||
|
@ -79,12 +77,11 @@ impl Step for ToolBuild {
|
||||||
/// `stage` into the normal cargo output directory.
|
/// `stage` into the normal cargo output directory.
|
||||||
fn run(self, builder: &Builder) -> PathBuf {
|
fn run(self, builder: &Builder) -> PathBuf {
|
||||||
let build = builder.build;
|
let build = builder.build;
|
||||||
let stage = self.stage;
|
let compiler = self.compiler;
|
||||||
let target = self.target;
|
let target = self.target;
|
||||||
let tool = self.tool;
|
let tool = self.tool;
|
||||||
|
|
||||||
let compiler = builder.compiler(stage, build.build);
|
builder.ensure(CleanTools { compiler, target, mode: self.mode });
|
||||||
builder.ensure(CleanTools { stage, target, mode: self.mode });
|
|
||||||
match self.mode {
|
match self.mode {
|
||||||
Mode::Libstd => builder.ensure(compile::Std { compiler, target }),
|
Mode::Libstd => builder.ensure(compile::Std { compiler, target }),
|
||||||
Mode::Libtest => builder.ensure(compile::Test { compiler, target }),
|
Mode::Libtest => builder.ensure(compile::Test { compiler, target }),
|
||||||
|
@ -92,8 +89,8 @@ impl Step for ToolBuild {
|
||||||
Mode::Tool => panic!("unexpected Mode::Tool for tool build")
|
Mode::Tool => panic!("unexpected Mode::Tool for tool build")
|
||||||
}
|
}
|
||||||
|
|
||||||
let _folder = build.fold_output(|| format!("stage{}-{}", stage, tool));
|
let _folder = build.fold_output(|| format!("stage{}-{}", compiler.stage, tool));
|
||||||
println!("Building stage{} tool {} ({})", stage, tool, target);
|
println!("Building stage{} tool {} ({})", compiler.stage, tool, target);
|
||||||
|
|
||||||
let mut cargo = builder.cargo(compiler, Mode::Tool, target, "build");
|
let mut cargo = builder.cargo(compiler, Mode::Tool, target, "build");
|
||||||
let dir = build.src.join("src/tools").join(tool);
|
let dir = build.src.join("src/tools").join(tool);
|
||||||
|
@ -141,7 +138,7 @@ macro_rules! tool {
|
||||||
match tool {
|
match tool {
|
||||||
$(Tool::$name =>
|
$(Tool::$name =>
|
||||||
self.ensure($name {
|
self.ensure($name {
|
||||||
stage: 0,
|
compiler: self.compiler(0, self.build.build),
|
||||||
target: self.build.build,
|
target: self.build.build,
|
||||||
}),
|
}),
|
||||||
)+
|
)+
|
||||||
|
@ -152,7 +149,7 @@ macro_rules! tool {
|
||||||
$(
|
$(
|
||||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||||
pub struct $name {
|
pub struct $name {
|
||||||
pub stage: u32,
|
pub compiler: Compiler,
|
||||||
pub target: Interned<String>,
|
pub target: Interned<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,14 +162,14 @@ macro_rules! tool {
|
||||||
|
|
||||||
fn make_run(run: RunConfig) {
|
fn make_run(run: RunConfig) {
|
||||||
run.builder.ensure($name {
|
run.builder.ensure($name {
|
||||||
stage: run.builder.top_stage,
|
compiler: run.builder.compiler(run.builder.top_stage, run.builder.build.build),
|
||||||
target: run.target,
|
target: run.target,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run(self, builder: &Builder) -> PathBuf {
|
fn run(self, builder: &Builder) -> PathBuf {
|
||||||
builder.ensure(ToolBuild {
|
builder.ensure(ToolBuild {
|
||||||
stage: self.stage,
|
compiler: self.compiler,
|
||||||
target: self.target,
|
target: self.target,
|
||||||
tool: $tool_name,
|
tool: $tool_name,
|
||||||
mode: $mode,
|
mode: $mode,
|
||||||
|
@ -198,7 +195,7 @@ tool!(
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||||
pub struct RemoteTestServer {
|
pub struct RemoteTestServer {
|
||||||
pub stage: u32,
|
pub compiler: Compiler,
|
||||||
pub target: Interned<String>,
|
pub target: Interned<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,14 +208,14 @@ impl Step for RemoteTestServer {
|
||||||
|
|
||||||
fn make_run(run: RunConfig) {
|
fn make_run(run: RunConfig) {
|
||||||
run.builder.ensure(RemoteTestServer {
|
run.builder.ensure(RemoteTestServer {
|
||||||
stage: run.builder.top_stage,
|
compiler: run.builder.compiler(run.builder.top_stage, run.builder.build.build),
|
||||||
target: run.target,
|
target: run.target,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn run(self, builder: &Builder) -> PathBuf {
|
fn run(self, builder: &Builder) -> PathBuf {
|
||||||
builder.ensure(ToolBuild {
|
builder.ensure(ToolBuild {
|
||||||
stage: self.stage,
|
compiler: self.compiler,
|
||||||
target: self.target,
|
target: self.target,
|
||||||
tool: "remote-test-server",
|
tool: "remote-test-server",
|
||||||
mode: Mode::Libstd,
|
mode: Mode::Libstd,
|
||||||
|
@ -228,7 +225,7 @@ impl Step for RemoteTestServer {
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||||
pub struct Cargo {
|
pub struct Cargo {
|
||||||
pub stage: u32,
|
pub compiler: Compiler,
|
||||||
pub target: Interned<String>,
|
pub target: Interned<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,7 +241,7 @@ impl Step for Cargo {
|
||||||
|
|
||||||
fn make_run(run: RunConfig) {
|
fn make_run(run: RunConfig) {
|
||||||
run.builder.ensure(Cargo {
|
run.builder.ensure(Cargo {
|
||||||
stage: run.builder.top_stage,
|
compiler: run.builder.compiler(run.builder.top_stage, run.builder.build.build),
|
||||||
target: run.target,
|
target: run.target,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -256,11 +253,11 @@ impl Step for Cargo {
|
||||||
// Cargo depends on procedural macros, which requires a full host
|
// Cargo depends on procedural macros, which requires a full host
|
||||||
// compiler to be available, so we need to depend on that.
|
// compiler to be available, so we need to depend on that.
|
||||||
builder.ensure(compile::Rustc {
|
builder.ensure(compile::Rustc {
|
||||||
compiler: builder.compiler(self.stage, builder.build.build),
|
compiler: self.compiler,
|
||||||
target: builder.build.build,
|
target: builder.build.build,
|
||||||
});
|
});
|
||||||
builder.ensure(ToolBuild {
|
builder.ensure(ToolBuild {
|
||||||
stage: self.stage,
|
compiler: self.compiler,
|
||||||
target: self.target,
|
target: self.target,
|
||||||
tool: "cargo",
|
tool: "cargo",
|
||||||
mode: Mode::Librustc,
|
mode: Mode::Librustc,
|
||||||
|
@ -270,7 +267,7 @@ impl Step for Cargo {
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
|
||||||
pub struct Rls {
|
pub struct Rls {
|
||||||
pub stage: u32,
|
pub compiler: Compiler,
|
||||||
pub target: Interned<String>,
|
pub target: Interned<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -286,7 +283,7 @@ impl Step for Rls {
|
||||||
|
|
||||||
fn make_run(run: RunConfig) {
|
fn make_run(run: RunConfig) {
|
||||||
run.builder.ensure(Rls {
|
run.builder.ensure(Rls {
|
||||||
stage: run.builder.top_stage,
|
compiler: run.builder.compiler(run.builder.top_stage, run.builder.build.build),
|
||||||
target: run.target,
|
target: run.target,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -298,11 +295,11 @@ impl Step for Rls {
|
||||||
// RLS depends on procedural macros, which requires a full host
|
// RLS depends on procedural macros, which requires a full host
|
||||||
// compiler to be available, so we need to depend on that.
|
// compiler to be available, so we need to depend on that.
|
||||||
builder.ensure(compile::Rustc {
|
builder.ensure(compile::Rustc {
|
||||||
compiler: builder.compiler(self.stage, builder.build.build),
|
compiler: self.compiler,
|
||||||
target: builder.build.build,
|
target: builder.build.build,
|
||||||
});
|
});
|
||||||
builder.ensure(ToolBuild {
|
builder.ensure(ToolBuild {
|
||||||
stage: self.stage,
|
compiler: self.compiler,
|
||||||
target: self.target,
|
target: self.target,
|
||||||
tool: "rls",
|
tool: "rls",
|
||||||
mode: Mode::Librustc,
|
mode: Mode::Librustc,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue