mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
improve check::Std handling
Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
//! Implementation of compiling the compiler and standard library, in "check"-based modes.
|
||||
|
||||
use crate::core::build_steps::compile;
|
||||
use crate::core::build_steps::compile::{
|
||||
add_to_sysroot, run_cargo, rustc_cargo, rustc_cargo_env, std_cargo, std_crates_for_run_make,
|
||||
};
|
||||
@@ -45,10 +46,12 @@ impl Step for Std {
|
||||
const DEFAULT: bool = true;
|
||||
|
||||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
||||
let stage = run.builder.top_stage;
|
||||
run.crate_or_deps("sysroot")
|
||||
.crate_or_deps("coretests")
|
||||
.crate_or_deps("alloctests")
|
||||
.path("library")
|
||||
.default_condition(stage != 0)
|
||||
}
|
||||
|
||||
fn make_run(run: RunConfig<'_>) {
|
||||
@@ -62,6 +65,12 @@ fn run(self, builder: &Builder<'_>) {
|
||||
let target = self.target;
|
||||
let compiler = builder.compiler(builder.top_stage, builder.config.build);
|
||||
|
||||
if builder.top_stage == 0 {
|
||||
// Reuse the beta compiler's libstd
|
||||
builder.ensure(compile::Std::new(compiler, target));
|
||||
return;
|
||||
}
|
||||
|
||||
let mut cargo = builder::Cargo::new(
|
||||
builder,
|
||||
compiler,
|
||||
|
||||
Reference in New Issue
Block a user