Skip to content
Closed
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
15 changes: 4 additions & 11 deletions src/bootstrap/src/core/build_steps/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ use crate::core::build_steps::tool::{
prepare_tool_cargo,
};
use crate::core::builder::{
self, Alias, Builder, Cargo, Kind, RunConfig, ShouldRun, Step, StepMetadata, crate_description,
self, Alias, Builder, Cargo, Kind, RunConfig, ShouldRun, Step, StepMetadata, StepTask,
crate_description,
};
use crate::core::config::TargetSelection;
use crate::utils::build_stamp::{self, BuildStamp};
Expand Down Expand Up @@ -219,13 +220,9 @@ impl PrepareRustcRmetaSysroot {
}
}

impl Step for PrepareRustcRmetaSysroot {
impl StepTask for PrepareRustcRmetaSysroot {
type Output = RmetaSysroot;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.never()
}

fn run(self, builder: &Builder<'_>) -> Self::Output {
// Check rustc
let stamp = builder.ensure(Rustc::from_build_compiler(
Expand Down Expand Up @@ -263,13 +260,9 @@ impl PrepareStdRmetaSysroot {
}
}

impl Step for PrepareStdRmetaSysroot {
impl StepTask for PrepareStdRmetaSysroot {
type Output = RmetaSysroot;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.never()
}

fn run(self, builder: &Builder<'_>) -> Self::Output {
// Check std
let stamp = builder.ensure(Std {
Expand Down
5 changes: 3 additions & 2 deletions src/bootstrap/src/core/build_steps/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ impl Step for CleanAll {
type Output = ();

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
// Only runs as the default `./x clean` step; cannot be selected explicitly.
run.never()
// Normally this step is invoked implicitly via `./x clean`, but all
// steps are required to register at least one explicit path/alias.
run.alias("default")
}

fn is_default_step(_builder: &Builder<'_>) -> bool {
Expand Down
22 changes: 5 additions & 17 deletions src/bootstrap/src/core/build_steps/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ use tracing::span;
use crate::core::build_steps::gcc::{Gcc, GccOutput, GccTargetPair};
use crate::core::build_steps::tool::{RustcPrivateCompilers, SourceType, copy_lld_artifacts};
use crate::core::build_steps::{dist, llvm};
use crate::core::builder;
use crate::core::builder::{
Builder, Cargo, Kind, RunConfig, ShouldRun, Step, StepMetadata, apply_pgo, crate_description,
self, Builder, Cargo, Kind, RunConfig, ShouldRun, Step, StepMetadata, StepTask, apply_pgo,
crate_description,
};
use crate::core::config::toml::target::DefaultLinuxLinkerOverride;
use crate::core::config::{
Expand Down Expand Up @@ -740,13 +740,9 @@ impl StdLink {
}
}

impl Step for StdLink {
impl StepTask for StdLink {
type Output = ();

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.never()
}

/// Link all libstd rlibs/dylibs into the sysroot location.
///
/// Links those artifacts generated by `compiler` to the `stage` compiler's
Expand Down Expand Up @@ -1530,13 +1526,9 @@ impl RustcLink {
}
}

impl Step for RustcLink {
impl StepTask for RustcLink {
type Output = ();

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.never()
}

/// Same as `StdLink`, only for librustc
fn run(self, builder: &Builder<'_>) {
let build_compiler = self.build_compiler;
Expand Down Expand Up @@ -1904,13 +1896,9 @@ impl Sysroot {
}
}

impl Step for Sysroot {
impl StepTask for Sysroot {
type Output = PathBuf;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.never()
}

/// Returns the sysroot that `compiler` is supposed to use.
/// For the stage0 compiler, this is stage0-sysroot (because of the initial std build).
/// For all other stages, it's the same stage directory that the compiler lives in.
Expand Down
8 changes: 2 additions & 6 deletions src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use crate::core::build_steps::tool::{
};
use crate::core::build_steps::vendor::Vendor;
use crate::core::build_steps::{compile, llvm};
use crate::core::builder::{Builder, Kind, RunConfig, ShouldRun, Step, StepMetadata};
use crate::core::builder::{Builder, Kind, RunConfig, ShouldRun, Step, StepMetadata, StepTask};
use crate::core::config::{GccCiMode, TargetSelection};
use crate::utils::build_stamp::{self, BuildStamp};
use crate::utils::channel::{self, Info};
Expand Down Expand Up @@ -704,13 +704,9 @@ pub struct DebuggerScripts {
pub target: TargetSelection,
}

impl Step for DebuggerScripts {
impl StepTask for DebuggerScripts {
type Output = ();

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.never()
}

fn run(self, builder: &Builder<'_>) {
let target = self.target;
let sysroot = self.sysroot;
Expand Down
20 changes: 4 additions & 16 deletions src/bootstrap/src/core/build_steps/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ use crate::core::build_steps::tool::{
self, RustcPrivateCompilers, SourceType, Tool, prepare_tool_cargo,
};
use crate::core::builder::{
self, Builder, Compiler, Kind, RunConfig, ShouldRun, Step, StepMetadata, crate_description,
self, Builder, Compiler, Kind, RunConfig, ShouldRun, Step, StepMetadata, StepTask,
crate_description,
};
use crate::core::config::{Config, TargetSelection};
use crate::helpers::{submodule_path_of, symlink_dir, t, up_to_date};
Expand Down Expand Up @@ -138,13 +139,9 @@ struct RustbookSrc<P: Step> {
build_compiler: Option<Compiler>,
}

impl<P: Step> Step for RustbookSrc<P> {
impl<P: Step> StepTask for RustbookSrc<P> {
type Output = ();

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.never()
}

/// Invoke `rustbook` for `target` for the doc book `name` from the `src` path.
///
/// This will not actually generate any documentation if the documentation has
Expand Down Expand Up @@ -574,18 +571,9 @@ pub struct SharedAssets {
target: TargetSelection,
}

impl Step for SharedAssets {
impl StepTask for SharedAssets {
type Output = SharedAssetsPaths;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
// Other tasks depend on this, no need to execute it on its own
run.never()
}

fn is_default_step(_builder: &Builder<'_>) -> bool {
false
}

/// Generate shared resources used by other pieces of documentation.
fn run(self, builder: &Builder<'_>) -> Self::Output {
let out = builder.doc_out(self.target);
Expand Down
12 changes: 2 additions & 10 deletions src/bootstrap/src/core/build_steps/synthetic_targets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! that calls create_synthetic_target.

use crate::Compiler;
use crate::core::builder::{Builder, ShouldRun, Step};
use crate::core::builder::{Builder, StepTask};
use crate::core::config::TargetSelection;

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
Expand All @@ -17,17 +17,9 @@ pub(crate) struct MirOptPanicAbortSyntheticTarget {
pub(crate) base: TargetSelection,
}

impl Step for MirOptPanicAbortSyntheticTarget {
impl StepTask for MirOptPanicAbortSyntheticTarget {
type Output = TargetSelection;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.never()
}

fn is_default_step(_builder: &Builder<'_>) -> bool {
true
}

fn run(self, builder: &Builder<'_>) -> Self::Output {
create_synthetic_target(builder, self.compiler, "miropt-abort", self.base, |spec| {
spec.insert("panic-strategy".into(), "abort".into());
Expand Down
21 changes: 4 additions & 17 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::core::build_steps::tool::{
use crate::core::build_steps::toolstate::ToolState;
use crate::core::build_steps::{compile, dist, llvm};
use crate::core::builder::{
self, Alias, Builder, Compiler, Kind, RunConfig, ShouldRun, Step, StepMetadata,
self, Alias, Builder, Compiler, Kind, RunConfig, ShouldRun, Step, StepMetadata, StepTask,
crate_description,
};
use crate::core::config::TargetSelection;
Expand Down Expand Up @@ -2129,13 +2129,9 @@ struct Compiletest {
compare_mode: Option<&'static str>,
}

impl Step for Compiletest {
impl StepTask for Compiletest {
type Output = ();

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.never()
}

fn run(self, builder: &Builder<'_>) {
if builder.test_target == TestTarget::DocOnly {
return;
Expand Down Expand Up @@ -2854,13 +2850,8 @@ struct BookTest {
dependencies: Vec<&'static str>,
}

impl Step for BookTest {
impl StepTask for BookTest {
type Output = ();
const IS_HOST: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.never()
}

fn run(self, builder: &Builder<'_>) {
// External docs are different from local because:
Expand Down Expand Up @@ -3663,13 +3654,9 @@ pub struct RemoteCopyLibs {
target: TargetSelection,
}

impl Step for RemoteCopyLibs {
impl StepTask for RemoteCopyLibs {
type Output = ();

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.never()
}

fn run(self, builder: &Builder<'_>) {
let build_compiler = self.build_compiler;
let target = self.target;
Expand Down
8 changes: 2 additions & 6 deletions src/bootstrap/src/core/build_steps/test/failed_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::fs::{self, File};
use std::io::{BufRead, BufReader, ErrorKind};
use std::path::{Path, PathBuf};

use crate::core::builder::{Builder, ShouldRun, Step};
use crate::core::builder::{Builder, StepTask};
use crate::t;

#[derive(Clone)]
Expand All @@ -29,13 +29,9 @@ impl RecordFailedTests {
/// and the `RecordFailedTest` type doesn't (need to) signify anything.
#[derive(Clone, Copy, Eq, PartialEq, Hash, Debug)]
pub struct SetupFailedTestsFile;
impl Step for SetupFailedTestsFile {
impl StepTask for SetupFailedTestsFile {
type Output = RecordFailedTests;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.never()
}

fn run(self, builder: &Builder<'_>) -> Self::Output {
if !builder.config.cmd.record() || builder.config.dry_run() {
return RecordFailedTests { failed_tests_path: None };
Expand Down
22 changes: 4 additions & 18 deletions src/bootstrap/src/core/build_steps/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ use std::{env, fs};
use crate::core::build_steps::compile::is_lto_stage;
use crate::core::build_steps::toolstate::ToolState;
use crate::core::build_steps::{compile, llvm};
use crate::core::builder;
use crate::core::builder::{
Builder, Cargo as CargoCommand, RunConfig, ShouldRun, Step, StepMetadata, apply_pgo,
cargo_profile_var,
self, Builder, Cargo as CargoCommand, RunConfig, ShouldRun, Step, StepMetadata, StepTask,
apply_pgo, cargo_profile_var,
};
use crate::core::config::{DebuginfoLevel, RustcLto, TargetSelection};
use crate::utils::exec::{BootstrapCommand, command};
Expand Down Expand Up @@ -66,13 +65,9 @@ pub struct ToolBuildResult {
pub build_compiler: Compiler,
}

impl Step for ToolBuild {
impl StepTask for ToolBuild {
type Output = ToolBuildResult;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.never()
}

/// Builds a tool in `src/tools`
///
/// This will build the specified tool with the specified `host` compiler in
Expand Down Expand Up @@ -1239,17 +1234,8 @@ pub enum LibcxxVersion {
Llvm(usize),
}

impl Step for LibcxxVersionTool {
impl StepTask for LibcxxVersionTool {
type Output = LibcxxVersion;
const IS_HOST: bool = true;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.never()
}

fn is_default_step(_builder: &Builder<'_>) -> bool {
false
}

fn run(self, builder: &Builder<'_>) -> LibcxxVersion {
let out_dir = builder.out.join(self.target.to_string()).join("libcxx-version");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ expression: clean
---
[Clean] clean::CleanAll
targets: [aarch64-unknown-linux-gnu]
- Set({})
- Set({clean::default})
Loading
Loading