Skip to content

Commit

Permalink
Rollup merge of rust-lang#129731 - ferrocene:x-test-compiler, r=onur-…
Browse files Browse the repository at this point in the history
…ozkan

Allow running `./x.py test compiler`
  • Loading branch information
workingjubilee committed Aug 29, 2024
2 parents ff6e551 + e20a888 commit 1327cea
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ use crate::core::build_steps::synthetic_targets::MirOptPanicAbortSyntheticTarget
use crate::core::build_steps::tool::{self, SourceType, Tool};
use crate::core::build_steps::toolstate::ToolState;
use crate::core::build_steps::{compile, dist, llvm};
use crate::core::builder;
use crate::core::builder::{
crate_description, Builder, Compiler, Kind, RunConfig, ShouldRun, Step,
self, crate_description, Alias, Builder, Compiler, Kind, RunConfig, ShouldRun, Step,
};
use crate::core::config::flags::{get_completion, Subcommand};
use crate::core::config::TargetSelection;
Expand Down Expand Up @@ -2435,18 +2434,14 @@ impl Step for CrateLibrustc {
const ONLY_HOSTS: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.crate_or_deps("rustc-main")
run.crate_or_deps("rustc-main").path("compiler")
}

fn make_run(run: RunConfig<'_>) {
let builder = run.builder;
let host = run.build_triple();
let compiler = builder.compiler_for(builder.top_stage, host, host);
let crates = run
.paths
.iter()
.map(|p| builder.crate_paths[&p.assert_single_path().path].clone())
.collect();
let crates = run.make_run_crates(Alias::Compiler);

builder.ensure(CrateLibrustc { compiler, target: run.target, crates });
}
Expand Down

0 comments on commit 1327cea

Please sign in to comment.