From 565342182e25a5275178c869bd4fcc40af7a52f5 Mon Sep 17 00:00:00 2001 From: Collins Abitekaniza Date: Sat, 1 Sep 2018 03:18:40 +0300 Subject: [PATCH] fix, found two different crates with name core --- src/bootstrap/builder.rs | 25 +++++++------------------ src/bootstrap/check.rs | 18 +++++++++--------- src/bootstrap/compile.rs | 29 +++++++++++++++++++++++++---- 3 files changed, 41 insertions(+), 31 deletions(-) diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs index ebe4c23b38d02..67f5fd3c20075 100644 --- a/src/bootstrap/builder.rs +++ b/src/bootstrap/builder.rs @@ -719,28 +719,19 @@ impl<'a> Builder<'a> { _ => self.stage_out(compiler, mode), }; - // 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 - // we copy the libs forward. - let cmp = if self.force_use_stage1(compiler, target) { - self.compiler(1, compiler.host) - } else { - compiler - }; - let libstd_stamp = match cmd { - "check" => check::libstd_stamp(self, cmp, target), - _ => compile::libstd_stamp(self, cmp, target), + "check" => check::libstd_stamp(self, compiler, target), + _ => compile::libstd_stamp(self, compiler, target), }; let libtest_stamp = match cmd { - "check" => check::libtest_stamp(self, cmp, target), - _ => compile::libstd_stamp(self, cmp, target), + "check" => check::libtest_stamp(self, compiler, target), + _ => compile::libstd_stamp(self, compiler, target), }; let librustc_stamp = match cmd { - "check" => check::librustc_stamp(self, cmp, target), - _ => compile::librustc_stamp(self, cmp, target), + "check" => check::librustc_stamp(self, compiler, target), + _ => compile::librustc_stamp(self, compiler, target), }; if cmd == "doc" { @@ -764,9 +755,7 @@ impl<'a> Builder<'a> { self.clear_if_dirty(&my_out, &libtest_stamp); }, Mode::Codegen => { - self.clear_if_dirty(&my_out, &self.rustc(compiler)); - self.clear_if_dirty(&my_out, &libstd_stamp); - self.clear_if_dirty(&my_out, &libtest_stamp); + self.clear_if_dirty(&my_out, &librustc_stamp); }, Mode::ToolBootstrap => { }, Mode::ToolStd => { diff --git a/src/bootstrap/check.rs b/src/bootstrap/check.rs index 04de97b531562..74febe9bb2883 100644 --- a/src/bootstrap/check.rs +++ b/src/bootstrap/check.rs @@ -132,9 +132,6 @@ impl Step for CodegenBackend { let target = self.target; let backend = self.backend; - let out_dir = builder.cargo_out(compiler, Mode::Codegen, target); - builder.clear_if_dirty(&out_dir, &librustc_stamp(builder, compiler, target)); - let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "check"); cargo.arg("--manifest-path").arg(builder.src.join("src/librustc_codegen_llvm/Cargo.toml")); rustc_cargo_env(builder, &mut cargo); @@ -210,14 +207,9 @@ impl Step for Rustdoc { } fn run(self, builder: &Builder) { - let compiler = builder.compiler(0, builder.config.build); + let mut compiler = builder.compiler(0, builder.config.build); let target = self.target; - let stage_out = builder.stage_out(compiler, Mode::ToolRustc); - builder.clear_if_dirty(&stage_out, &libstd_stamp(builder, compiler, target)); - builder.clear_if_dirty(&stage_out, &libtest_stamp(builder, compiler, target)); - builder.clear_if_dirty(&stage_out, &librustc_stamp(builder, compiler, target)); - let mut cargo = prepare_tool_cargo(builder, compiler, Mode::ToolRustc, @@ -236,6 +228,14 @@ impl Step for Rustdoc { let libdir = builder.sysroot_libdir(compiler, target); add_to_sysroot(&builder, &libdir, &rustdoc_stamp(builder, compiler, target)); + + // 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 + // we copy the libs forward. + if builder.force_use_stage1(compiler, target) { + compiler = builder.compiler(1, compiler.host) + }; + builder.cargo(compiler, Mode::ToolRustc, target, "clean"); } } diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index ff6d2b504d265..a03860fc6ea2d 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -225,7 +225,7 @@ impl Step for StdLink { /// output directory. fn run(self, builder: &Builder) { let compiler = self.compiler; - let target_compiler = self.target_compiler; + let mut target_compiler = self.target_compiler; let target = self.target; builder.info(&format!("Copying stage{} std from stage{} ({} -> {} / {})", target_compiler.stage, @@ -243,6 +243,13 @@ impl Step for StdLink { copy_apple_sanitizer_dylibs(builder, &builder.native_dir(target), "osx", &libdir); } + // 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 + // we copy the libs forward. + if builder.force_use_stage1(target_compiler, target) { + target_compiler = builder.compiler(1, target_compiler.host) + }; + builder.cargo(target_compiler, Mode::ToolStd, target, "clean"); } } @@ -429,7 +436,7 @@ impl Step for TestLink { /// Same as `std_link`, only for libtest fn run(self, builder: &Builder) { let compiler = self.compiler; - let target_compiler = self.target_compiler; + let mut target_compiler = self.target_compiler; let target = self.target; builder.info(&format!("Copying stage{} test from stage{} ({} -> {} / {})", target_compiler.stage, @@ -440,6 +447,13 @@ impl Step for TestLink { add_to_sysroot(builder, &builder.sysroot_libdir(target_compiler, target), &libtest_stamp(builder, compiler, target)); + // 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 + // we copy the libs forward. + if builder.force_use_stage1(target_compiler, target) { + target_compiler = builder.compiler(1, target_compiler.host) + }; + builder.cargo(target_compiler, Mode::ToolTest, target, "clean"); } } @@ -588,7 +602,7 @@ impl Step for RustcLink { /// Same as `std_link`, only for librustc fn run(self, builder: &Builder) { let compiler = self.compiler; - let target_compiler = self.target_compiler; + let mut target_compiler = self.target_compiler; let target = self.target; builder.info(&format!("Copying stage{} rustc from stage{} ({} -> {} / {})", target_compiler.stage, @@ -598,6 +612,14 @@ impl Step for RustcLink { target)); add_to_sysroot(builder, &builder.sysroot_libdir(target_compiler, target), &librustc_stamp(builder, compiler, target)); + + // 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 + // we copy the libs forward. + if builder.force_use_stage1(target_compiler, target) { + target_compiler = builder.compiler(1, target_compiler.host) + }; + builder.cargo(target_compiler, Mode::ToolRustc, target, "clean"); } } @@ -655,7 +677,6 @@ impl Step for CodegenBackend { } let out_dir = builder.cargo_out(compiler, Mode::Codegen, target); - builder.clear_if_dirty(&out_dir, &librustc_stamp(builder, compiler, target)); let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "rustc"); cargo.arg("--manifest-path")