|
10 | 10 |
|
11 | 11 | //! Implementation of compiling the compiler and standard library, in "check" mode.
|
12 | 12 |
|
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}; |
14 | 15 | use builder::{RunConfig, Builder, ShouldRun, Step};
|
15 | 16 | use tool::{self, prepare_tool_cargo};
|
16 | 17 | use {Compiler, Mode};
|
@@ -43,17 +44,25 @@ impl Step for Std {
|
43 | 44 | let out_dir = builder.stage_out(compiler, Mode::Std);
|
44 | 45 | builder.clear_if_dirty(&out_dir, &builder.rustc(compiler));
|
45 | 46 |
|
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); |
48 | 51 |
|
49 | 52 | let _folder = builder.fold_output(|| format!("stage{}-std", compiler.stage));
|
| 53 | + let libdir = builder.sysroot_libdir(compiler, target); |
| 54 | + |
50 | 55 | println!("Checking std artifacts ({} -> {})", &compiler.host, target);
|
51 | 56 | 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, |
53 | 63 | &libstd_stamp(builder, compiler, target),
|
54 | 64 | true);
|
55 | 65 |
|
56 |
| - let libdir = builder.sysroot_libdir(compiler, target); |
57 | 66 | add_to_sysroot(&builder, &libdir, &libstd_stamp(builder, compiler, target));
|
58 | 67 | }
|
59 | 68 | }
|
@@ -88,6 +97,7 @@ impl Step for Rustc {
|
88 | 97 | let target = self.target;
|
89 | 98 |
|
90 | 99 | let stage_out = builder.stage_out(compiler, Mode::Rustc);
|
| 100 | + builder.clear_if_dirty(&stage_out, &libcore_stamp(builder, compiler, target)); |
91 | 101 | builder.clear_if_dirty(&stage_out, &libstd_stamp(builder, compiler, target));
|
92 | 102 | builder.clear_if_dirty(&stage_out, &libtest_stamp(builder, compiler, target));
|
93 | 103 |
|
@@ -176,6 +186,7 @@ impl Step for Test {
|
176 | 186 | let target = self.target;
|
177 | 187 |
|
178 | 188 | let out_dir = builder.stage_out(compiler, Mode::Test);
|
| 189 | + builder.clear_if_dirty(&out_dir, &libcore_stamp(builder, compiler, target)); |
179 | 190 | builder.clear_if_dirty(&out_dir, &libstd_stamp(builder, compiler, target));
|
180 | 191 |
|
181 | 192 | let mut cargo = builder.cargo(compiler, Mode::Test, target, "check");
|
@@ -242,6 +253,12 @@ impl Step for Rustdoc {
|
242 | 253 | }
|
243 | 254 | }
|
244 | 255 |
|
| 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 | + |
245 | 262 | /// Cargo's output path for the standard library in a given stage, compiled
|
246 | 263 | /// by a particular compiler for the specified target.
|
247 | 264 | pub fn libstd_stamp(builder: &Builder, compiler: Compiler, target: Interned<String>) -> PathBuf {
|
|
0 commit comments