Skip to content
Merged
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
21 changes: 7 additions & 14 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, CommandLineStep, Kind, RunConfig, ShouldRun, Step, StepMetadata,
crate_description,
};
use crate::core::config::TargetSelection;
use crate::utils::build_stamp::{self, BuildStamp};
Expand All @@ -36,7 +37,7 @@ impl Std {
const CRATE_OR_DEPS: &[&str] = &["sysroot", "coretests", "alloctests"];
}

impl Step for Std {
impl CommandLineStep for Std {
type Output = BuildStamp;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
Expand Down Expand Up @@ -222,10 +223,6 @@ impl PrepareRustcRmetaSysroot {
impl Step 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 @@ -266,10 +263,6 @@ impl PrepareStdRmetaSysroot {
impl Step 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 Expand Up @@ -317,7 +310,7 @@ impl Rustc {
}
}

impl Step for Rustc {
impl CommandLineStep for Rustc {
type Output = BuildStamp;
const IS_HOST: bool = true;

Expand Down Expand Up @@ -528,7 +521,7 @@ pub struct CraneliftCodegenBackend {
target: TargetSelection,
}

impl Step for CraneliftCodegenBackend {
impl CommandLineStep for CraneliftCodegenBackend {
type Output = ();
const IS_HOST: bool = true;

Expand Down Expand Up @@ -607,7 +600,7 @@ pub struct GccCodegenBackend {
target: TargetSelection,
}

impl Step for GccCodegenBackend {
impl CommandLineStep for GccCodegenBackend {
type Output = ();
const IS_HOST: bool = true;

Expand Down Expand Up @@ -701,7 +694,7 @@ macro_rules! tool_check_step {
target: TargetSelection,
}

impl Step for $name {
impl CommandLineStep for $name {
type Output = ();
const IS_HOST: bool = true;

Expand Down
11 changes: 6 additions & 5 deletions src/bootstrap/src/core/build_steps/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,21 @@ use std::fs;
use std::io::{self, ErrorKind};
use std::path::Path;

use crate::core::builder::{Builder, RunConfig, ShouldRun, Step, crate_description};
use crate::core::builder::{Builder, CommandLineStep, RunConfig, ShouldRun, crate_description};
use crate::utils::build_stamp::BuildStamp;
use crate::utils::helpers::t;
use crate::{Build, Compiler, Kind, Mode, Subcommand};

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct CleanAll {}

impl Step for CleanAll {
impl CommandLineStep 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 Expand Up @@ -54,7 +55,7 @@ macro_rules! clean_crate_tree {
crates: Vec<String>,
}

impl Step for $name {
impl CommandLineStep for $name {
type Output = ();

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
Expand Down
14 changes: 8 additions & 6 deletions src/bootstrap/src/core/build_steps/clippy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ use crate::core::build_steps::compile::{
ArtifactKeepMode, run_cargo, rustc_cargo, std_cargo, std_crates_for_make_run,
};
use crate::core::builder;
use crate::core::builder::{Alias, Kind, RunConfig, Step, StepMetadata, crate_description};
use crate::core::builder::{
Alias, CommandLineStep, Kind, RunConfig, StepMetadata, crate_description,
};
use crate::utils::build_stamp::{self, BuildStamp};
use crate::{Compiler, Mode, Subcommand, TargetSelection, exit};

Expand Down Expand Up @@ -167,7 +169,7 @@ impl Std {
}
}

impl Step for Std {
impl CommandLineStep for Std {
type Output = ();

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
Expand Down Expand Up @@ -251,7 +253,7 @@ impl Rustc {
}
}

impl Step for Rustc {
impl CommandLineStep for Rustc {
type Output = ();
const IS_HOST: bool = true;

Expand Down Expand Up @@ -336,7 +338,7 @@ impl CodegenGcc {
}
}

impl Step for CodegenGcc {
impl CommandLineStep for CodegenGcc {
type Output = ();

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
Expand Down Expand Up @@ -422,7 +424,7 @@ macro_rules! lint_any {
config: LintConfig,
}

impl Step for $name {
impl CommandLineStep for $name {
type Output = ();

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
Expand Down Expand Up @@ -522,7 +524,7 @@ pub struct CI {
config: LintConfig,
}

impl Step for CI {
impl CommandLineStep for CI {
type Output = ();

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
Expand Down
28 changes: 8 additions & 20 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, CommandLineStep, Kind, RunConfig, ShouldRun, Step, StepMetadata,
apply_pgo, crate_description,
};
use crate::core::config::toml::target::DefaultLinuxLinkerOverride;
use crate::core::config::{
Expand Down Expand Up @@ -109,7 +109,7 @@ impl Std {
}
}

impl Step for Std {
impl CommandLineStep for Std {
/// Build stamp of std, if it was indeed built or uplifted.
type Output = Option<BuildStamp>;

Expand Down Expand Up @@ -743,10 +743,6 @@ impl StdLink {
impl Step 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 @@ -900,7 +896,7 @@ pub struct StartupObjects {
pub target: TargetSelection,
}

impl Step for StartupObjects {
impl CommandLineStep for StartupObjects {
type Output = Vec<(PathBuf, DependencyType)>;

fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
Expand Down Expand Up @@ -1013,7 +1009,7 @@ impl Rustc {
}
}

impl Step for Rustc {
impl CommandLineStep for Rustc {
type Output = BuiltRustc;
const IS_HOST: bool = true;

Expand Down Expand Up @@ -1535,10 +1531,6 @@ impl RustcLink {
impl Step 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 @@ -1659,7 +1651,7 @@ impl GccCodegenBackend {
}
}

impl Step for GccCodegenBackend {
impl CommandLineStep for GccCodegenBackend {
type Output = GccCodegenBackendOutput;

const IS_HOST: bool = true;
Expand Down Expand Up @@ -1728,7 +1720,7 @@ pub struct CraneliftCodegenBackend {
pub compilers: RustcPrivateCompilers,
}

impl Step for CraneliftCodegenBackend {
impl CommandLineStep for CraneliftCodegenBackend {
type Output = BuildStamp;
const IS_HOST: bool = true;

Expand Down Expand Up @@ -1909,10 +1901,6 @@ impl Sysroot {
impl Step 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 Expand Up @@ -2078,7 +2066,7 @@ pub struct Assemble {
pub target_compiler: Compiler,
}

impl Step for Assemble {
impl CommandLineStep for Assemble {
type Output = Compiler;
const IS_HOST: bool = true;

Expand Down
Loading
Loading