Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/bootstrap/src/core/build_steps/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use serde_derive::Deserialize;
use tracing::span;

use crate::core::build_steps::gcc::{Gcc, GccOutput, GccTargetPair};
use crate::core::build_steps::test::failed_tests::IsForRerunningTests;
use crate::core::build_steps::tool::{RustcPrivateCompilers, SourceType, copy_lld_artifacts};
use crate::core::build_steps::{dist, llvm};
use crate::core::builder;
Expand Down Expand Up @@ -1027,7 +1028,7 @@ impl Step for Rustc {
fn make_run(run: RunConfig<'_>) {
// If only `compiler` was passed, do not run this step.
// Instead the `Assemble` step will take care of compiling Rustc.
if run.builder.paths == vec![PathBuf::from("compiler")] {
if run.builder.paths(IsForRerunningTests::DontCare) == vec![PathBuf::from("compiler")] {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussion:

The last commit is a little awkward, but I think it's the best way to make it so that we first run all tests that have to be rerun, and then rerun tests passed through the cli.

I really do not like this viral complexity that cross-cuts all these test steps. Can we keep the rerun functionality simple, to only rerun the set of failed tests?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, is it that complex? Cause I do really like doing x test --rerun tests/ui and using that to run a small part (that likely errors) first and then try everything

return;
}

Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use crate::core::build_steps::compile::{
};
use crate::core::build_steps::doc::DocumentationFormat;
use crate::core::build_steps::gcc::GccTargetPair;
use crate::core::build_steps::test::failed_tests::IsForRerunningTests;
use crate::core::build_steps::tool::{
self, RustcPrivateCompilers, ToolTargetBuildMode, get_tool_target_compiler,
};
Expand Down Expand Up @@ -2650,7 +2651,7 @@ impl Step for LlvmTools {
// Prepare the image directory
let src_bindir = builder.llvm_out(target).join("bin");
let dst_bindir = format!("lib/rustlib/{}/bin", target.triple);
for tool in tools_to_install(&builder.paths) {
for tool in tools_to_install(builder.paths(IsForRerunningTests::DontCare)) {
let exe = src_bindir.join(exe(tool, target));
// When using `download-ci-llvm`, some of the tools may not exist, so skip trying to copy them.
if !exe.exists() && builder.config.llvm_from_ci {
Expand Down
17 changes: 14 additions & 3 deletions src/bootstrap/src/core/build_steps/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use std::path::{Path, PathBuf};
use std::{env, fs, mem};

use crate::core::build_steps::compile;
use crate::core::build_steps::test::failed_tests::IsForRerunningTests;
use crate::core::build_steps::tool::{
self, RustcPrivateCompilers, SourceType, Tool, prepare_tool_cargo,
};
Expand Down Expand Up @@ -436,7 +437,9 @@ impl Step for Standalone {

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

// Open if the format is HTML
if let DocumentationFormat::Html = self.format {
if builder.paths.iter().any(|path| path.ends_with("library")) {
if builder
.paths(IsForRerunningTests::DontCare)
.iter()
.any(|path| path.ends_with("library"))
{
// For `x.py doc library --open`, open `std` by default.
let index = out.join("std").join("index.html");
builder.maybe_open_in_browser::<Self>(index);
Expand Down Expand Up @@ -991,7 +998,11 @@ impl Step for Rustc {
}
}

if builder.paths.iter().any(|path| path.ends_with("compiler")) {
if builder
.paths(IsForRerunningTests::DontCare)
.iter()
.any(|path| path.ends_with("compiler"))
{
// For `x.py doc compiler --open`, open `rustc_middle` by default.
let index = out.join("rustc_middle").join("index.html");
builder.open_in_browser(index);
Expand Down
Loading
Loading