Skip to content

Commit 5653421

Browse files
committed
fix, found two different crates with name core
1 parent 093d9a6 commit 5653421

File tree

3 files changed

+41
-31
lines changed

3 files changed

+41
-31
lines changed

src/bootstrap/builder.rs

+7-18
Original file line numberDiff line numberDiff line change
@@ -719,28 +719,19 @@ impl<'a> Builder<'a> {
719719
_ => self.stage_out(compiler, mode),
720720
};
721721

722-
// This is for the original compiler, but if we're forced to use stage 1, then
723-
// std/test/rustc stamps won't exist in stage 2, so we need to get those from stage 1, since
724-
// we copy the libs forward.
725-
let cmp = if self.force_use_stage1(compiler, target) {
726-
self.compiler(1, compiler.host)
727-
} else {
728-
compiler
729-
};
730-
731722
let libstd_stamp = match cmd {
732-
"check" => check::libstd_stamp(self, cmp, target),
733-
_ => compile::libstd_stamp(self, cmp, target),
723+
"check" => check::libstd_stamp(self, compiler, target),
724+
_ => compile::libstd_stamp(self, compiler, target),
734725
};
735726

736727
let libtest_stamp = match cmd {
737-
"check" => check::libtest_stamp(self, cmp, target),
738-
_ => compile::libstd_stamp(self, cmp, target),
728+
"check" => check::libtest_stamp(self, compiler, target),
729+
_ => compile::libstd_stamp(self, compiler, target),
739730
};
740731

741732
let librustc_stamp = match cmd {
742-
"check" => check::librustc_stamp(self, cmp, target),
743-
_ => compile::librustc_stamp(self, cmp, target),
733+
"check" => check::librustc_stamp(self, compiler, target),
734+
_ => compile::librustc_stamp(self, compiler, target),
744735
};
745736

746737
if cmd == "doc" {
@@ -764,9 +755,7 @@ impl<'a> Builder<'a> {
764755
self.clear_if_dirty(&my_out, &libtest_stamp);
765756
},
766757
Mode::Codegen => {
767-
self.clear_if_dirty(&my_out, &self.rustc(compiler));
768-
self.clear_if_dirty(&my_out, &libstd_stamp);
769-
self.clear_if_dirty(&my_out, &libtest_stamp);
758+
self.clear_if_dirty(&my_out, &librustc_stamp);
770759
},
771760
Mode::ToolBootstrap => { },
772761
Mode::ToolStd => {

src/bootstrap/check.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,6 @@ impl Step for CodegenBackend {
132132
let target = self.target;
133133
let backend = self.backend;
134134

135-
let out_dir = builder.cargo_out(compiler, Mode::Codegen, target);
136-
builder.clear_if_dirty(&out_dir, &librustc_stamp(builder, compiler, target));
137-
138135
let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "check");
139136
cargo.arg("--manifest-path").arg(builder.src.join("src/librustc_codegen_llvm/Cargo.toml"));
140137
rustc_cargo_env(builder, &mut cargo);
@@ -210,14 +207,9 @@ impl Step for Rustdoc {
210207
}
211208

212209
fn run(self, builder: &Builder) {
213-
let compiler = builder.compiler(0, builder.config.build);
210+
let mut compiler = builder.compiler(0, builder.config.build);
214211
let target = self.target;
215212

216-
let stage_out = builder.stage_out(compiler, Mode::ToolRustc);
217-
builder.clear_if_dirty(&stage_out, &libstd_stamp(builder, compiler, target));
218-
builder.clear_if_dirty(&stage_out, &libtest_stamp(builder, compiler, target));
219-
builder.clear_if_dirty(&stage_out, &librustc_stamp(builder, compiler, target));
220-
221213
let mut cargo = prepare_tool_cargo(builder,
222214
compiler,
223215
Mode::ToolRustc,
@@ -236,6 +228,14 @@ impl Step for Rustdoc {
236228

237229
let libdir = builder.sysroot_libdir(compiler, target);
238230
add_to_sysroot(&builder, &libdir, &rustdoc_stamp(builder, compiler, target));
231+
232+
// This is for the original compiler, but if we're forced to use stage 1, then
233+
// std/test/rustc stamps won't exist in stage 2, so we need to get those from stage 1, since
234+
// we copy the libs forward.
235+
if builder.force_use_stage1(compiler, target) {
236+
compiler = builder.compiler(1, compiler.host)
237+
};
238+
239239
builder.cargo(compiler, Mode::ToolRustc, target, "clean");
240240
}
241241
}

src/bootstrap/compile.rs

+25-4
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ impl Step for StdLink {
225225
/// output directory.
226226
fn run(self, builder: &Builder) {
227227
let compiler = self.compiler;
228-
let target_compiler = self.target_compiler;
228+
let mut target_compiler = self.target_compiler;
229229
let target = self.target;
230230
builder.info(&format!("Copying stage{} std from stage{} ({} -> {} / {})",
231231
target_compiler.stage,
@@ -243,6 +243,13 @@ impl Step for StdLink {
243243
copy_apple_sanitizer_dylibs(builder, &builder.native_dir(target), "osx", &libdir);
244244
}
245245

246+
// This is for the original compiler, but if we're forced to use stage 1, then
247+
// std/test/rustc stamps won't exist in stage 2, so we need to get those from stage 1, since
248+
// we copy the libs forward.
249+
if builder.force_use_stage1(target_compiler, target) {
250+
target_compiler = builder.compiler(1, target_compiler.host)
251+
};
252+
246253
builder.cargo(target_compiler, Mode::ToolStd, target, "clean");
247254
}
248255
}
@@ -429,7 +436,7 @@ impl Step for TestLink {
429436
/// Same as `std_link`, only for libtest
430437
fn run(self, builder: &Builder) {
431438
let compiler = self.compiler;
432-
let target_compiler = self.target_compiler;
439+
let mut target_compiler = self.target_compiler;
433440
let target = self.target;
434441
builder.info(&format!("Copying stage{} test from stage{} ({} -> {} / {})",
435442
target_compiler.stage,
@@ -440,6 +447,13 @@ impl Step for TestLink {
440447
add_to_sysroot(builder, &builder.sysroot_libdir(target_compiler, target),
441448
&libtest_stamp(builder, compiler, target));
442449

450+
// This is for the original compiler, but if we're forced to use stage 1, then
451+
// std/test/rustc stamps won't exist in stage 2, so we need to get those from stage 1, since
452+
// we copy the libs forward.
453+
if builder.force_use_stage1(target_compiler, target) {
454+
target_compiler = builder.compiler(1, target_compiler.host)
455+
};
456+
443457
builder.cargo(target_compiler, Mode::ToolTest, target, "clean");
444458
}
445459
}
@@ -588,7 +602,7 @@ impl Step for RustcLink {
588602
/// Same as `std_link`, only for librustc
589603
fn run(self, builder: &Builder) {
590604
let compiler = self.compiler;
591-
let target_compiler = self.target_compiler;
605+
let mut target_compiler = self.target_compiler;
592606
let target = self.target;
593607
builder.info(&format!("Copying stage{} rustc from stage{} ({} -> {} / {})",
594608
target_compiler.stage,
@@ -598,6 +612,14 @@ impl Step for RustcLink {
598612
target));
599613
add_to_sysroot(builder, &builder.sysroot_libdir(target_compiler, target),
600614
&librustc_stamp(builder, compiler, target));
615+
616+
// This is for the original compiler, but if we're forced to use stage 1, then
617+
// std/test/rustc stamps won't exist in stage 2, so we need to get those from stage 1, since
618+
// we copy the libs forward.
619+
if builder.force_use_stage1(target_compiler, target) {
620+
target_compiler = builder.compiler(1, target_compiler.host)
621+
};
622+
601623
builder.cargo(target_compiler, Mode::ToolRustc, target, "clean");
602624
}
603625
}
@@ -655,7 +677,6 @@ impl Step for CodegenBackend {
655677
}
656678

657679
let out_dir = builder.cargo_out(compiler, Mode::Codegen, target);
658-
builder.clear_if_dirty(&out_dir, &librustc_stamp(builder, compiler, target));
659680

660681
let mut cargo = builder.cargo(compiler, Mode::Codegen, target, "rustc");
661682
cargo.arg("--manifest-path")

0 commit comments

Comments
 (0)