Skip to content

Commit 5050a44

Browse files
committed
Unbreak x.py check
1 parent 9653b80 commit 5050a44

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

src/bootstrap/check.rs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
//! Implementation of compiling the compiler and standard library, in "check" mode.
1212
13-
use compile::{run_cargo, std_cargo, test_cargo, rustc_cargo, rustc_cargo_env, add_to_sysroot};
13+
use compile::{run_cargo, core_cargo, std_cargo, test_cargo,
14+
rustc_cargo, rustc_cargo_env, add_to_sysroot};
1415
use builder::{RunConfig, Builder, ShouldRun, Step};
1516
use tool::{self, prepare_tool_cargo};
1617
use {Compiler, Mode};
@@ -43,17 +44,25 @@ impl Step for Std {
4344
let out_dir = builder.stage_out(compiler, Mode::Std);
4445
builder.clear_if_dirty(&out_dir, &builder.rustc(compiler));
4546

46-
let mut cargo = builder.cargo(compiler, Mode::Std, target, "check");
47-
std_cargo(builder, &compiler, target, &mut cargo);
47+
let mut core_cargo_invoc = builder.cargo(compiler, Mode::Std, target, "check");
48+
core_cargo(builder, &compiler, target, &mut core_cargo_invoc);
49+
let mut std_cargo_invoc = builder.cargo(compiler, Mode::Std, target, "check");
50+
std_cargo(builder, &compiler, target, &mut std_cargo_invoc);
4851

4952
let _folder = builder.fold_output(|| format!("stage{}-std", compiler.stage));
53+
let libdir = builder.sysroot_libdir(compiler, target);
54+
5055
println!("Checking std artifacts ({} -> {})", &compiler.host, target);
5156
run_cargo(builder,
52-
&mut cargo,
57+
&mut core_cargo_invoc,
58+
&libcore_stamp(builder, compiler, target),
59+
true);
60+
add_to_sysroot(&builder, &libdir, &libcore_stamp(builder, compiler, target));
61+
run_cargo(builder,
62+
&mut std_cargo_invoc,
5363
&libstd_stamp(builder, compiler, target),
5464
true);
5565

56-
let libdir = builder.sysroot_libdir(compiler, target);
5766
add_to_sysroot(&builder, &libdir, &libstd_stamp(builder, compiler, target));
5867
}
5968
}
@@ -88,6 +97,7 @@ impl Step for Rustc {
8897
let target = self.target;
8998

9099
let stage_out = builder.stage_out(compiler, Mode::Rustc);
100+
builder.clear_if_dirty(&stage_out, &libcore_stamp(builder, compiler, target));
91101
builder.clear_if_dirty(&stage_out, &libstd_stamp(builder, compiler, target));
92102
builder.clear_if_dirty(&stage_out, &libtest_stamp(builder, compiler, target));
93103

@@ -176,6 +186,7 @@ impl Step for Test {
176186
let target = self.target;
177187

178188
let out_dir = builder.stage_out(compiler, Mode::Test);
189+
builder.clear_if_dirty(&out_dir, &libcore_stamp(builder, compiler, target));
179190
builder.clear_if_dirty(&out_dir, &libstd_stamp(builder, compiler, target));
180191

181192
let mut cargo = builder.cargo(compiler, Mode::Test, target, "check");
@@ -242,6 +253,12 @@ impl Step for Rustdoc {
242253
}
243254
}
244255

256+
/// Cargo's output path for the core library in a given stage, compiled
257+
/// by a particular compiler for the specified target.
258+
pub fn libcore_stamp(builder: &Builder, compiler: Compiler, target: Interned<String>) -> PathBuf {
259+
builder.cargo_out(compiler, Mode::Std, target).join(".libcore-check.stamp")
260+
}
261+
245262
/// Cargo's output path for the standard library in a given stage, compiled
246263
/// by a particular compiler for the specified target.
247264
pub fn libstd_stamp(builder: &Builder, compiler: Compiler, target: Interned<String>) -> PathBuf {

0 commit comments

Comments
 (0)