mirror of https://github.com/rust-lang/rust.git
Use build.build instead of build.config.build
This commit is contained in:
parent
5809a7d0b7
commit
1654a2f5ac
|
@ -42,10 +42,13 @@ use config::Target;
|
|||
pub fn find(build: &mut Build) {
|
||||
// For all targets we're going to need a C compiler for building some shims
|
||||
// and such as well as for being a linker for Rust code.
|
||||
for target in build.config.target.iter() {
|
||||
//
|
||||
// This includes targets that aren't necessarily passed on the commandline
|
||||
// (FIXME: Perhaps it shouldn't?)
|
||||
for target in &build.config.target {
|
||||
let mut cfg = gcc::Config::new();
|
||||
cfg.cargo_metadata(false).opt_level(0).debug(false)
|
||||
.target(target).host(&build.config.build);
|
||||
.target(target).host(&build.build);
|
||||
|
||||
let config = build.config.target_config.get(target);
|
||||
if let Some(cc) = config.and_then(|c| c.cc.as_ref()) {
|
||||
|
@ -64,10 +67,13 @@ pub fn find(build: &mut Build) {
|
|||
}
|
||||
|
||||
// For all host triples we need to find a C++ compiler as well
|
||||
for host in build.config.host.iter() {
|
||||
//
|
||||
// This includes hosts that aren't necessarily passed on the commandline
|
||||
// (FIXME: Perhaps it shouldn't?)
|
||||
for host in &build.config.host {
|
||||
let mut cfg = gcc::Config::new();
|
||||
cfg.cargo_metadata(false).opt_level(0).debug(false).cpp(true)
|
||||
.target(host).host(&build.config.build);
|
||||
.target(host).host(&build.build);
|
||||
let config = build.config.target_config.get(host);
|
||||
if let Some(cxx) = config.and_then(|c| c.cxx.as_ref()) {
|
||||
cfg.compiler(cxx);
|
||||
|
|
|
@ -196,7 +196,7 @@ pub fn compiletest(build: &Build,
|
|||
cmd.arg("--mode").arg(mode);
|
||||
cmd.arg("--target").arg(target);
|
||||
cmd.arg("--host").arg(compiler.host);
|
||||
cmd.arg("--llvm-filecheck").arg(build.llvm_filecheck(&build.config.build));
|
||||
cmd.arg("--llvm-filecheck").arg(build.llvm_filecheck(&build.build));
|
||||
|
||||
if let Some(ref nodejs) = build.config.nodejs {
|
||||
cmd.arg("--nodejs").arg(nodejs);
|
||||
|
@ -222,7 +222,7 @@ pub fn compiletest(build: &Build,
|
|||
|
||||
cmd.arg("--docck-python").arg(build.python());
|
||||
|
||||
if build.config.build.ends_with("apple-darwin") {
|
||||
if build.build.ends_with("apple-darwin") {
|
||||
// Force /usr/bin/python on macOS for LLDB tests because we're loading the
|
||||
// LLDB plugin's compiled module which only works with the system python
|
||||
// (namely not Homebrew-installed python)
|
||||
|
@ -277,7 +277,7 @@ pub fn compiletest(build: &Build,
|
|||
|
||||
if build.remote_tested(target) {
|
||||
cmd.arg("--remote-test-client")
|
||||
.arg(build.tool(&Compiler::new(0, &build.config.build),
|
||||
.arg(build.tool(&Compiler::new(0, &build.build),
|
||||
"remote-test-client"));
|
||||
}
|
||||
|
||||
|
@ -366,7 +366,7 @@ pub fn error_index(build: &Build, compiler: &Compiler) {
|
|||
"error_index_generator")
|
||||
.arg("markdown")
|
||||
.arg(&output)
|
||||
.env("CFG_BUILD", &build.config.build));
|
||||
.env("CFG_BUILD", &build.build));
|
||||
|
||||
markdown_test(build, compiler, &output);
|
||||
}
|
||||
|
@ -540,7 +540,7 @@ fn krate_remote(build: &Build,
|
|||
let out_dir = build.cargo_out(compiler, mode, target);
|
||||
let tests = find_tests(&out_dir.join("deps"), target);
|
||||
|
||||
let tool = build.tool(&Compiler::new(0, &build.config.build),
|
||||
let tool = build.tool(&Compiler::new(0, &build.build),
|
||||
"remote-test-client");
|
||||
for test in tests {
|
||||
let mut cmd = Command::new(&tool);
|
||||
|
@ -585,7 +585,7 @@ pub fn remote_copy_libs(build: &Build, compiler: &Compiler, target: &str) {
|
|||
.join(exe("remote-test-server", target));
|
||||
|
||||
// Spawn the emulator and wait for it to come online
|
||||
let tool = build.tool(&Compiler::new(0, &build.config.build),
|
||||
let tool = build.tool(&Compiler::new(0, &build.build),
|
||||
"remote-test-client");
|
||||
let mut cmd = Command::new(&tool);
|
||||
cmd.arg("spawn-emulator")
|
||||
|
@ -611,7 +611,7 @@ pub fn remote_copy_libs(build: &Build, compiler: &Compiler, target: &str) {
|
|||
|
||||
/// Run "distcheck", a 'make check' from a tarball
|
||||
pub fn distcheck(build: &Build) {
|
||||
if build.config.build != "x86_64-unknown-linux-gnu" {
|
||||
if build.build != "x86_64-unknown-linux-gnu" {
|
||||
return
|
||||
}
|
||||
if !build.config.host.iter().any(|s| s == "x86_64-unknown-linux-gnu") {
|
||||
|
@ -636,7 +636,7 @@ pub fn distcheck(build: &Build) {
|
|||
.args(&build.config.configure_args)
|
||||
.arg("--enable-vendor")
|
||||
.current_dir(&dir));
|
||||
build.run(Command::new(build_helper::make(&build.config.build))
|
||||
build.run(Command::new(build_helper::make(&build.build))
|
||||
.arg("check")
|
||||
.current_dir(&dir));
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ pub fn build_startup_objects(build: &Build, for_compiler: &Compiler, target: &st
|
|||
return
|
||||
}
|
||||
|
||||
let compiler = Compiler::new(0, &build.config.build);
|
||||
let compiler = Compiler::new(0, &build.build);
|
||||
let compiler_path = build.compiler_path(&compiler);
|
||||
let src_dir = &build.src.join("src/rtstartup");
|
||||
let dst_dir = &build.native_dir(target).join("rtstartup");
|
||||
|
@ -351,7 +351,7 @@ pub fn create_sysroot(build: &Build, compiler: &Compiler) {
|
|||
/// Prepare a new compiler from the artifacts in `stage`
|
||||
///
|
||||
/// This will assemble a compiler in `build/$host/stage$stage`. The compiler
|
||||
/// must have been previously produced by the `stage - 1` build.config.build
|
||||
/// must have been previously produced by the `stage - 1` build.build
|
||||
/// compiler.
|
||||
pub fn assemble_rustc(build: &Build, stage: u32, host: &str) {
|
||||
// nothing to do in stage0
|
||||
|
@ -365,7 +365,7 @@ pub fn assemble_rustc(build: &Build, stage: u32, host: &str) {
|
|||
let target_compiler = Compiler::new(stage, host);
|
||||
|
||||
// The compiler that compiled the compiler we're assembling
|
||||
let build_compiler = Compiler::new(stage - 1, &build.config.build);
|
||||
let build_compiler = Compiler::new(stage - 1, &build.build);
|
||||
|
||||
// Link in all dylibs to the libdir
|
||||
let sysroot = build.sysroot(&target_compiler);
|
||||
|
@ -423,7 +423,7 @@ fn add_to_sysroot(sysroot_dst: &Path, stamp: &Path) {
|
|||
/// This will build the specified tool with the specified `host` compiler in
|
||||
/// `stage` into the normal cargo output directory.
|
||||
pub fn maybe_clean_tools(build: &Build, stage: u32, target: &str, mode: Mode) {
|
||||
let compiler = Compiler::new(stage, &build.config.build);
|
||||
let compiler = Compiler::new(stage, &build.build);
|
||||
|
||||
let stamp = match mode {
|
||||
Mode::Libstd => libstd_stamp(build, &compiler, target),
|
||||
|
@ -443,7 +443,7 @@ pub fn tool(build: &Build, stage: u32, target: &str, tool: &str) {
|
|||
let _folder = build.fold_output(|| format!("stage{}-{}", stage, tool));
|
||||
println!("Building stage{} tool {} ({})", stage, tool, target);
|
||||
|
||||
let compiler = Compiler::new(stage, &build.config.build);
|
||||
let compiler = Compiler::new(stage, &build.build);
|
||||
|
||||
let mut cargo = build.cargo(&compiler, Mode::Tool, target, "build");
|
||||
let dir = build.src.join("src/tools").join(tool);
|
||||
|
|
|
@ -50,7 +50,7 @@ pub fn tmpdir(build: &Build) -> PathBuf {
|
|||
}
|
||||
|
||||
fn rust_installer(build: &Build) -> Command {
|
||||
build.tool_cmd(&Compiler::new(0, &build.config.build), "rust-installer")
|
||||
build.tool_cmd(&Compiler::new(0, &build.build), "rust-installer")
|
||||
}
|
||||
|
||||
/// Builds the `rust-docs` installer component.
|
||||
|
@ -89,7 +89,7 @@ pub fn docs(build: &Build, stage: u32, host: &str) {
|
|||
|
||||
// As part of this step, *also* copy the docs directory to a directory which
|
||||
// buildbot typically uploads.
|
||||
if host == build.config.build {
|
||||
if host == build.build {
|
||||
let dst = distdir(build).join("doc").join(build.rust_package_vers());
|
||||
t!(fs::create_dir_all(&dst));
|
||||
cp_r(&src, &dst);
|
||||
|
@ -394,7 +394,7 @@ pub fn std(build: &Build, compiler: &Compiler, target: &str) {
|
|||
|
||||
// The only true set of target libraries came from the build triple, so
|
||||
// let's reduce redundant work by only producing archives from that host.
|
||||
if compiler.host != build.config.build {
|
||||
if compiler.host != build.build {
|
||||
println!("\tskipping, not a build host");
|
||||
return
|
||||
}
|
||||
|
@ -440,7 +440,7 @@ pub fn analysis(build: &Build, compiler: &Compiler, target: &str) {
|
|||
assert!(build.config.extended);
|
||||
println!("Dist analysis");
|
||||
|
||||
if compiler.host != build.config.build {
|
||||
if compiler.host != build.build {
|
||||
println!("\tskipping, not a build host");
|
||||
return;
|
||||
}
|
||||
|
@ -705,7 +705,7 @@ fn write_file(path: &Path, data: &[u8]) {
|
|||
|
||||
pub fn cargo(build: &Build, stage: u32, target: &str) {
|
||||
println!("Dist cargo stage{} ({})", stage, target);
|
||||
let compiler = Compiler::new(stage, &build.config.build);
|
||||
let compiler = Compiler::new(stage, &build.build);
|
||||
|
||||
let src = build.src.join("src/tools/cargo");
|
||||
let etc = src.join("src/etc");
|
||||
|
@ -766,7 +766,7 @@ pub fn cargo(build: &Build, stage: u32, target: &str) {
|
|||
pub fn rls(build: &Build, stage: u32, target: &str) {
|
||||
assert!(build.config.extended);
|
||||
println!("Dist RLS stage{} ({})", stage, target);
|
||||
let compiler = Compiler::new(stage, &build.config.build);
|
||||
let compiler = Compiler::new(stage, &build.build);
|
||||
|
||||
let src = build.src.join("src/tools/rls");
|
||||
let release_num = build.release_num("rls");
|
||||
|
@ -1198,7 +1198,7 @@ fn add_env(build: &Build, cmd: &mut Command, target: &str) {
|
|||
}
|
||||
|
||||
pub fn hash_and_sign(build: &Build) {
|
||||
let compiler = Compiler::new(0, &build.config.build);
|
||||
let compiler = Compiler::new(0, &build.build);
|
||||
let mut cmd = build.tool_cmd(&compiler, "build-manifest");
|
||||
let sign = build.config.dist_sign_folder.as_ref().unwrap_or_else(|| {
|
||||
panic!("\n\nfailed to specify `dist.sign-folder` in `config.toml`\n\n")
|
||||
|
|
|
@ -45,7 +45,7 @@ pub fn rustbook_src(build: &Build, target: &str, name: &str, src: &Path) {
|
|||
t!(fs::create_dir_all(&out));
|
||||
|
||||
let out = out.join(name);
|
||||
let compiler = Compiler::new(0, &build.config.build);
|
||||
let compiler = Compiler::new(0, &build.build);
|
||||
let src = src.join(name);
|
||||
let index = out.join("index.html");
|
||||
let rustbook = build.tool(&compiler, "rustbook");
|
||||
|
@ -95,7 +95,7 @@ pub fn book(build: &Build, target: &str, name: &str) {
|
|||
fn invoke_rustdoc(build: &Build, target: &str, markdown: &str) {
|
||||
let out = build.doc_out(target);
|
||||
|
||||
let compiler = Compiler::new(0, &build.config.build);
|
||||
let compiler = Compiler::new(0, &build.build);
|
||||
|
||||
let path = build.src.join("src/doc").join(markdown);
|
||||
|
||||
|
@ -150,7 +150,7 @@ pub fn standalone(build: &Build, target: &str) {
|
|||
let out = build.doc_out(target);
|
||||
t!(fs::create_dir_all(&out));
|
||||
|
||||
let compiler = Compiler::new(0, &build.config.build);
|
||||
let compiler = Compiler::new(0, &build.build);
|
||||
|
||||
let favicon = build.src.join("src/doc/favicon.inc");
|
||||
let footer = build.src.join("src/doc/footer.inc");
|
||||
|
@ -217,7 +217,7 @@ pub fn std(build: &Build, stage: u32, target: &str) {
|
|||
println!("Documenting stage{} std ({})", stage, target);
|
||||
let out = build.doc_out(target);
|
||||
t!(fs::create_dir_all(&out));
|
||||
let compiler = Compiler::new(stage, &build.config.build);
|
||||
let compiler = Compiler::new(stage, &build.build);
|
||||
let compiler = if build.force_use_stage1(&compiler, target) {
|
||||
Compiler::new(1, compiler.host)
|
||||
} else {
|
||||
|
@ -276,7 +276,7 @@ pub fn test(build: &Build, stage: u32, target: &str) {
|
|||
println!("Documenting stage{} test ({})", stage, target);
|
||||
let out = build.doc_out(target);
|
||||
t!(fs::create_dir_all(&out));
|
||||
let compiler = Compiler::new(stage, &build.config.build);
|
||||
let compiler = Compiler::new(stage, &build.build);
|
||||
let compiler = if build.force_use_stage1(&compiler, target) {
|
||||
Compiler::new(1, compiler.host)
|
||||
} else {
|
||||
|
@ -306,7 +306,7 @@ pub fn rustc(build: &Build, stage: u32, target: &str) {
|
|||
println!("Documenting stage{} compiler ({})", stage, target);
|
||||
let out = build.doc_out(target);
|
||||
t!(fs::create_dir_all(&out));
|
||||
let compiler = Compiler::new(stage, &build.config.build);
|
||||
let compiler = Compiler::new(stage, &build.build);
|
||||
let compiler = if build.force_use_stage1(&compiler, target) {
|
||||
Compiler::new(1, compiler.host)
|
||||
} else {
|
||||
|
@ -351,13 +351,13 @@ pub fn error_index(build: &Build, target: &str) {
|
|||
println!("Documenting error index ({})", target);
|
||||
let out = build.doc_out(target);
|
||||
t!(fs::create_dir_all(&out));
|
||||
let compiler = Compiler::new(0, &build.config.build);
|
||||
let compiler = Compiler::new(0, &build.build);
|
||||
let mut index = build.tool_cmd(&compiler, "error_index_generator");
|
||||
index.arg("html");
|
||||
index.arg(out.join("error-index.html"));
|
||||
|
||||
// FIXME: shouldn't have to pass this env var
|
||||
index.env("CFG_BUILD", &build.config.build);
|
||||
index.env("CFG_BUILD", &build.build);
|
||||
|
||||
build.run(&mut index);
|
||||
}
|
||||
|
@ -367,7 +367,7 @@ pub fn unstable_book_gen(build: &Build, target: &str) {
|
|||
let out = build.md_doc_out(target).join("unstable-book");
|
||||
t!(fs::create_dir_all(&out));
|
||||
t!(fs::remove_dir_all(&out));
|
||||
let compiler = Compiler::new(0, &build.config.build);
|
||||
let compiler = Compiler::new(0, &build.build);
|
||||
let mut cmd = build.tool_cmd(&compiler, "unstable-book-gen");
|
||||
cmd.arg(build.src.join("src"));
|
||||
cmd.arg(out);
|
||||
|
|
|
@ -1079,7 +1079,7 @@ impl<'a> Compiler<'a> {
|
|||
|
||||
/// Returns whether this is a snapshot compiler for `build`'s configuration
|
||||
fn is_snapshot(&self, build: &Build) -> bool {
|
||||
self.stage == 0 && self.host == build.config.build
|
||||
self.stage == 0 && self.host == build.build
|
||||
}
|
||||
|
||||
/// Returns if this compiler should be treated as a final stage one in the
|
||||
|
|
|
@ -94,7 +94,7 @@ pub fn llvm(build: &Build, target: &str) {
|
|||
let assertions = if build.config.llvm_assertions {"ON"} else {"OFF"};
|
||||
|
||||
cfg.target(target)
|
||||
.host(&build.config.build)
|
||||
.host(&build.build)
|
||||
.out_dir(&out_dir)
|
||||
.profile(profile)
|
||||
.define("LLVM_ENABLE_ASSERTIONS", assertions)
|
||||
|
@ -129,11 +129,11 @@ pub fn llvm(build: &Build, target: &str) {
|
|||
}
|
||||
|
||||
// http://llvm.org/docs/HowToCrossCompileLLVM.html
|
||||
if target != build.config.build {
|
||||
if target != build.build {
|
||||
// FIXME: if the llvm root for the build triple is overridden then we
|
||||
// should use llvm-tblgen from there, also should verify that it
|
||||
// actually exists most of the time in normal installs of LLVM.
|
||||
let host = build.llvm_out(&build.config.build).join("bin/llvm-tblgen");
|
||||
let host = build.llvm_out(&build.build).join("bin/llvm-tblgen");
|
||||
cfg.define("CMAKE_CROSSCOMPILING", "True")
|
||||
.define("LLVM_TABLEGEN", &host);
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ pub fn test_helpers(build: &Build, target: &str) {
|
|||
cfg.cargo_metadata(false)
|
||||
.out_dir(&dst)
|
||||
.target(target)
|
||||
.host(&build.config.build)
|
||||
.host(&build.build)
|
||||
.opt_level(0)
|
||||
.debug(false)
|
||||
.file(build.src.join("src/rt/rust_test_helpers.c"))
|
||||
|
|
|
@ -139,7 +139,7 @@ pub fn check(build: &mut Build) {
|
|||
}
|
||||
|
||||
// Externally configured LLVM requires FileCheck to exist
|
||||
let filecheck = build.llvm_filecheck(&build.config.build);
|
||||
let filecheck = build.llvm_filecheck(&build.build);
|
||||
if !filecheck.starts_with(&build.out) && !filecheck.exists() && build.config.codegen_tests {
|
||||
panic!("FileCheck executable {:?} does not exist", filecheck);
|
||||
}
|
||||
|
@ -147,7 +147,7 @@ pub fn check(build: &mut Build) {
|
|||
for target in &build.config.target {
|
||||
// Can't compile for iOS unless we're on macOS
|
||||
if target.contains("apple-ios") &&
|
||||
!build.config.build.contains("apple-darwin") {
|
||||
!build.build.contains("apple-darwin") {
|
||||
panic!("the iOS target is only supported on macOS");
|
||||
}
|
||||
|
||||
|
|
|
@ -104,10 +104,10 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
rules.build("llvm", "src/llvm")
|
||||
.host(true)
|
||||
.dep(move |s| {
|
||||
if s.target == build.config.build {
|
||||
if s.target == build.build {
|
||||
Step::noop()
|
||||
} else {
|
||||
s.target(&build.config.build)
|
||||
s.target(&build.build)
|
||||
}
|
||||
})
|
||||
.run(move |s| native::llvm(build, s.target));
|
||||
|
@ -124,7 +124,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
Step::noop()
|
||||
} else {
|
||||
s.name("librustc")
|
||||
.host(&build.config.build)
|
||||
.host(&build.build)
|
||||
.stage(s.stage - 1)
|
||||
}
|
||||
})
|
||||
|
@ -215,24 +215,24 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
let mut rule = rules.build(&krate, "path/to/nowhere");
|
||||
rule.dep(move |s| {
|
||||
if build.force_use_stage1(&s.compiler(), s.target) {
|
||||
s.host(&build.config.build).stage(1)
|
||||
} else if s.host == build.config.build {
|
||||
s.host(&build.build).stage(1)
|
||||
} else if s.host == build.build {
|
||||
s.name(dep)
|
||||
} else {
|
||||
s.host(&build.config.build)
|
||||
s.host(&build.build)
|
||||
}
|
||||
})
|
||||
.run(move |s| {
|
||||
if build.force_use_stage1(&s.compiler(), s.target) {
|
||||
link(build,
|
||||
&s.stage(1).host(&build.config.build).compiler(),
|
||||
&s.stage(1).host(&build.build).compiler(),
|
||||
&s.compiler(),
|
||||
s.target)
|
||||
} else if s.host == build.config.build {
|
||||
} else if s.host == build.build {
|
||||
link(build, &s.compiler(), &s.compiler(), s.target)
|
||||
} else {
|
||||
link(build,
|
||||
&s.host(&build.config.build).compiler(),
|
||||
&s.host(&build.build).compiler(),
|
||||
&s.compiler(),
|
||||
s.target)
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
for (krate, path, _default) in krates("std") {
|
||||
rules.build(&krate.build_step, path)
|
||||
.dep(|s| s.name("startup-objects"))
|
||||
.dep(move |s| s.name("rustc").host(&build.config.build).target(s.host))
|
||||
.dep(move |s| s.name("rustc").host(&build.build).target(s.host))
|
||||
.run(move |s| compile::std(build, s.target, &s.compiler()));
|
||||
}
|
||||
for (krate, path, _default) in krates("test") {
|
||||
|
@ -280,7 +280,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
for (krate, path, _default) in krates("rustc-main") {
|
||||
rules.build(&krate.build_step, path)
|
||||
.dep(|s| s.name("libtest-link"))
|
||||
.dep(move |s| s.name("llvm").host(&build.config.build).stage(0))
|
||||
.dep(move |s| s.name("llvm").host(&build.build).stage(0))
|
||||
.dep(|s| s.name("may-run-build-script"))
|
||||
.run(move |s| compile::rustc(build, s.target, &s.compiler()));
|
||||
}
|
||||
|
@ -291,8 +291,8 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
rules.build("may-run-build-script", "path/to/nowhere")
|
||||
.dep(move |s| {
|
||||
s.name("libstd-link")
|
||||
.host(&build.config.build)
|
||||
.target(&build.config.build)
|
||||
.host(&build.build)
|
||||
.target(&build.build)
|
||||
});
|
||||
rules.build("startup-objects", "src/rtstartup")
|
||||
.dep(|s| s.name("create-sysroot").target(s.host))
|
||||
|
@ -332,7 +332,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
"incremental");
|
||||
}
|
||||
|
||||
if build.config.build.contains("msvc") {
|
||||
if build.build.contains("msvc") {
|
||||
// nothing to do for debuginfo tests
|
||||
} else {
|
||||
rules.test("check-debuginfo-lldb", "src/test/debuginfo-lldb")
|
||||
|
@ -352,7 +352,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
"debuginfo-gdb", "debuginfo"));
|
||||
let mut rule = rules.test("check-debuginfo", "src/test/debuginfo");
|
||||
rule.default(true);
|
||||
if build.config.build.contains("apple") {
|
||||
if build.build.contains("apple") {
|
||||
rule.dep(|s| s.name("check-debuginfo-lldb"));
|
||||
} else {
|
||||
rule.dep(|s| s.name("check-debuginfo-gdb"));
|
||||
|
@ -594,8 +594,8 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
// Cargo depends on procedural macros, which requires a full host
|
||||
// compiler to be available, so we need to depend on that.
|
||||
s.name("librustc-link")
|
||||
.target(&build.config.build)
|
||||
.host(&build.config.build)
|
||||
.target(&build.build)
|
||||
.host(&build.build)
|
||||
})
|
||||
.run(move |s| compile::tool(build, s.stage, s.target, "cargo"));
|
||||
rules.build("tool-rls", "src/tools/rls")
|
||||
|
@ -606,8 +606,8 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
.dep(move |s| {
|
||||
// rls, like cargo, uses procedural macros
|
||||
s.name("librustc-link")
|
||||
.target(&build.config.build)
|
||||
.host(&build.config.build)
|
||||
.target(&build.build)
|
||||
.host(&build.build)
|
||||
})
|
||||
.run(move |s| compile::tool(build, s.stage, s.target, "rls"));
|
||||
|
||||
|
@ -635,8 +635,8 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
rules.doc("doc-book", "src/doc/book")
|
||||
.dep(move |s| {
|
||||
s.name("tool-rustbook")
|
||||
.host(&build.config.build)
|
||||
.target(&build.config.build)
|
||||
.host(&build.build)
|
||||
.target(&build.build)
|
||||
.stage(0)
|
||||
})
|
||||
.default(build.config.docs)
|
||||
|
@ -644,8 +644,8 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
rules.doc("doc-nomicon", "src/doc/nomicon")
|
||||
.dep(move |s| {
|
||||
s.name("tool-rustbook")
|
||||
.host(&build.config.build)
|
||||
.target(&build.config.build)
|
||||
.host(&build.build)
|
||||
.target(&build.build)
|
||||
.stage(0)
|
||||
})
|
||||
.default(build.config.docs)
|
||||
|
@ -653,8 +653,8 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
rules.doc("doc-reference", "src/doc/reference")
|
||||
.dep(move |s| {
|
||||
s.name("tool-rustbook")
|
||||
.host(&build.config.build)
|
||||
.target(&build.config.build)
|
||||
.host(&build.build)
|
||||
.target(&build.build)
|
||||
.stage(0)
|
||||
})
|
||||
.default(build.config.docs)
|
||||
|
@ -662,8 +662,8 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
rules.doc("doc-unstable-book", "src/doc/unstable-book")
|
||||
.dep(move |s| {
|
||||
s.name("tool-rustbook")
|
||||
.host(&build.config.build)
|
||||
.target(&build.config.build)
|
||||
.host(&build.build)
|
||||
.target(&build.build)
|
||||
.stage(0)
|
||||
})
|
||||
.dep(move |s| s.name("doc-unstable-book-gen"))
|
||||
|
@ -675,14 +675,14 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
rules.doc("doc-standalone", "src/doc")
|
||||
.dep(move |s| {
|
||||
s.name("rustc")
|
||||
.host(&build.config.build)
|
||||
.target(&build.config.build)
|
||||
.host(&build.build)
|
||||
.target(&build.build)
|
||||
.stage(0)
|
||||
})
|
||||
.default(build.config.docs)
|
||||
.run(move |s| doc::standalone(build, s.target));
|
||||
rules.doc("doc-error-index", "src/tools/error_index_generator")
|
||||
.dep(move |s| s.name("tool-error-index").target(&build.config.build).stage(0))
|
||||
.dep(move |s| s.name("tool-error-index").target(&build.build).stage(0))
|
||||
.dep(move |s| s.name("librustc-link"))
|
||||
.default(build.config.docs)
|
||||
.host(true)
|
||||
|
@ -690,8 +690,8 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
rules.doc("doc-unstable-book-gen", "src/tools/unstable-book-gen")
|
||||
.dep(move |s| {
|
||||
s.name("tool-unstable-book-gen")
|
||||
.host(&build.config.build)
|
||||
.target(&build.config.build)
|
||||
.host(&build.build)
|
||||
.target(&build.build)
|
||||
.stage(0)
|
||||
})
|
||||
.dep(move |s| s.name("libstd-link"))
|
||||
|
@ -725,7 +725,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
// ========================================================================
|
||||
// Distribution targets
|
||||
rules.dist("dist-rustc", "src/librustc")
|
||||
.dep(move |s| s.name("rustc").host(&build.config.build))
|
||||
.dep(move |s| s.name("rustc").host(&build.build))
|
||||
.host(true)
|
||||
.only_host_build(true)
|
||||
.default(true)
|
||||
|
@ -811,7 +811,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
.host(true)
|
||||
.only_build(true)
|
||||
.only_host_build(true)
|
||||
.dep(move |s| s.name("tool-build-manifest").target(&build.config.build).stage(0))
|
||||
.dep(move |s| s.name("tool-build-manifest").target(&build.build).stage(0))
|
||||
.run(move |_| dist::hash_and_sign(build));
|
||||
|
||||
rules.install("install-docs", "src/doc")
|
||||
|
@ -861,8 +861,8 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
|
|||
/// Helper to depend on a stage0 build-only rust-installer tool.
|
||||
fn tool_rust_installer<'a>(build: &'a Build, step: &Step<'a>) -> Step<'a> {
|
||||
step.name("tool-rust-installer")
|
||||
.host(&build.config.build)
|
||||
.target(&build.config.build)
|
||||
.host(&build.build)
|
||||
.target(&build.build)
|
||||
.stage(0)
|
||||
}
|
||||
}
|
||||
|
@ -1058,8 +1058,8 @@ impl<'a> Rules<'a> {
|
|||
build: build,
|
||||
sbuild: Step {
|
||||
stage: build.flags.stage.unwrap_or(2),
|
||||
target: &build.config.build,
|
||||
host: &build.config.build,
|
||||
target: &build.build,
|
||||
host: &build.build,
|
||||
name: "",
|
||||
},
|
||||
rules: BTreeMap::new(),
|
||||
|
@ -1486,8 +1486,8 @@ mod tests {
|
|||
let step = super::Step {
|
||||
name: "",
|
||||
stage: 2,
|
||||
host: &build.config.build,
|
||||
target: &build.config.build,
|
||||
host: &build.build,
|
||||
target: &build.build,
|
||||
};
|
||||
|
||||
assert!(plan.contains(&step.name("dist-docs")));
|
||||
|
@ -1509,8 +1509,8 @@ mod tests {
|
|||
let step = super::Step {
|
||||
name: "",
|
||||
stage: 2,
|
||||
host: &build.config.build,
|
||||
target: &build.config.build,
|
||||
host: &build.build,
|
||||
target: &build.build,
|
||||
};
|
||||
|
||||
assert!(plan.contains(&step.name("dist-docs")));
|
||||
|
@ -1537,8 +1537,8 @@ mod tests {
|
|||
let step = super::Step {
|
||||
name: "",
|
||||
stage: 2,
|
||||
host: &build.config.build,
|
||||
target: &build.config.build,
|
||||
host: &build.build,
|
||||
target: &build.build,
|
||||
};
|
||||
|
||||
assert!(!plan.iter().any(|s| s.host == "B"));
|
||||
|
@ -1567,8 +1567,8 @@ mod tests {
|
|||
let step = super::Step {
|
||||
name: "",
|
||||
stage: 2,
|
||||
host: &build.config.build,
|
||||
target: &build.config.build,
|
||||
host: &build.build,
|
||||
target: &build.build,
|
||||
};
|
||||
|
||||
assert!(!plan.iter().any(|s| s.host == "B"));
|
||||
|
@ -1604,8 +1604,8 @@ mod tests {
|
|||
let step = super::Step {
|
||||
name: "",
|
||||
stage: 2,
|
||||
host: &build.config.build,
|
||||
target: &build.config.build,
|
||||
host: &build.build,
|
||||
target: &build.build,
|
||||
};
|
||||
|
||||
assert!(!plan.iter().any(|s| s.target == "A"));
|
||||
|
@ -1631,8 +1631,8 @@ mod tests {
|
|||
let step = super::Step {
|
||||
name: "",
|
||||
stage: 2,
|
||||
host: &build.config.build,
|
||||
target: &build.config.build,
|
||||
host: &build.build,
|
||||
target: &build.build,
|
||||
};
|
||||
|
||||
assert!(!plan.iter().any(|s| s.target == "A"));
|
||||
|
@ -1675,8 +1675,8 @@ mod tests {
|
|||
let step = super::Step {
|
||||
name: "",
|
||||
stage: 2,
|
||||
host: &build.config.build,
|
||||
target: &build.config.build,
|
||||
host: &build.build,
|
||||
target: &build.build,
|
||||
};
|
||||
|
||||
// rustc built for all for of (A, B) x (A, B)
|
||||
|
|
Loading…
Reference in New Issue