Skip to content

Commit b6965a5

Browse files
committed
rerun first, then do normal tests as passed through the cli
1 parent 2de0c9a commit b6965a5

9 files changed

Lines changed: 355 additions & 112 deletions

File tree

src/bootstrap/src/core/build_steps/compile.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use serde_derive::Deserialize;
2020
use tracing::span;
2121

2222
use crate::core::build_steps::gcc::{Gcc, GccOutput, GccTargetPair};
23+
use crate::core::build_steps::test::failed_tests::IsForRerunningTests;
2324
use crate::core::build_steps::tool::{RustcPrivateCompilers, SourceType, copy_lld_artifacts};
2425
use crate::core::build_steps::{dist, llvm};
2526
use crate::core::builder;
@@ -1027,7 +1028,7 @@ impl Step for Rustc {
10271028
fn make_run(run: RunConfig<'_>) {
10281029
// If only `compiler` was passed, do not run this step.
10291030
// Instead the `Assemble` step will take care of compiling Rustc.
1030-
if run.builder.paths == vec![PathBuf::from("compiler")] {
1031+
if run.builder.paths(IsForRerunningTests::DontCare) == vec![PathBuf::from("compiler")] {
10311032
return;
10321033
}
10331034

src/bootstrap/src/core/build_steps/dist.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use crate::core::build_steps::compile::{
2424
};
2525
use crate::core::build_steps::doc::DocumentationFormat;
2626
use crate::core::build_steps::gcc::GccTargetPair;
27+
use crate::core::build_steps::test::failed_tests::IsForRerunningTests;
2728
use crate::core::build_steps::tool::{
2829
self, RustcPrivateCompilers, ToolTargetBuildMode, get_tool_target_compiler,
2930
};
@@ -2650,7 +2651,7 @@ impl Step for LlvmTools {
26502651
// Prepare the image directory
26512652
let src_bindir = builder.llvm_out(target).join("bin");
26522653
let dst_bindir = format!("lib/rustlib/{}/bin", target.triple);
2653-
for tool in tools_to_install(&builder.paths) {
2654+
for tool in tools_to_install(builder.paths(IsForRerunningTests::DontCare)) {
26542655
let exe = src_bindir.join(exe(tool, target));
26552656
// When using `download-ci-llvm`, some of the tools may not exist, so skip trying to copy them.
26562657
if !exe.exists() && builder.config.llvm_from_ci {

src/bootstrap/src/core/build_steps/doc.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use std::path::{Path, PathBuf};
1212
use std::{env, fs, mem};
1313

1414
use crate::core::build_steps::compile;
15+
use crate::core::build_steps::test::failed_tests::IsForRerunningTests;
1516
use crate::core::build_steps::tool::{
1617
self, RustcPrivateCompilers, SourceType, Tool, prepare_tool_cargo,
1718
};
@@ -436,7 +437,9 @@ impl Step for Standalone {
436437

437438
// We open doc/index.html as the default if invoked as `x.py doc --open`
438439
// with no particular explicit doc requested (e.g. library/core).
439-
if builder.paths.is_empty() || builder.was_invoked_explicitly::<Self>(Kind::Doc) {
440+
if builder.paths(IsForRerunningTests::DontCare).is_empty()
441+
|| builder.was_invoked_explicitly::<Self>(Kind::Doc)
442+
{
440443
let index = out.join("index.html");
441444
builder.open_in_browser(index);
442445
}
@@ -720,7 +723,11 @@ impl Step for Std {
720723

721724
// Open if the format is HTML
722725
if let DocumentationFormat::Html = self.format {
723-
if builder.paths.iter().any(|path| path.ends_with("library")) {
726+
if builder
727+
.paths(IsForRerunningTests::DontCare)
728+
.iter()
729+
.any(|path| path.ends_with("library"))
730+
{
724731
// For `x.py doc library --open`, open `std` by default.
725732
let index = out.join("std").join("index.html");
726733
builder.maybe_open_in_browser::<Self>(index);
@@ -991,7 +998,11 @@ impl Step for Rustc {
991998
}
992999
}
9931000

994-
if builder.paths.iter().any(|path| path.ends_with("compiler")) {
1001+
if builder
1002+
.paths(IsForRerunningTests::DontCare)
1003+
.iter()
1004+
.any(|path| path.ends_with("compiler"))
1005+
{
9951006
// For `x.py doc compiler --open`, open `rustc_middle` by default.
9961007
let index = out.join("rustc_middle").join("index.html");
9971008
builder.open_in_browser(index);

0 commit comments

Comments
 (0)