diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs index 6d393446d458e..1e08e8547dc72 100644 --- a/src/bootstrap/src/core/build_steps/check.rs +++ b/src/bootstrap/src/core/build_steps/check.rs @@ -172,7 +172,7 @@ impl Rustc { impl Step for Rustc { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; const DEFAULT: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { @@ -324,7 +324,7 @@ pub struct CodegenBackend { impl Step for CodegenBackend { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; const DEFAULT: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { @@ -410,7 +410,7 @@ macro_rules! tool_check_step { impl Step for $name { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; /// Most of the tool-checks using this macro are run by default. const DEFAULT: bool = true $( && $default )?; diff --git a/src/bootstrap/src/core/build_steps/clippy.rs b/src/bootstrap/src/core/build_steps/clippy.rs index 23d9a032eb909..3c4aa0886c2a5 100644 --- a/src/bootstrap/src/core/build_steps/clippy.rs +++ b/src/bootstrap/src/core/build_steps/clippy.rs @@ -256,7 +256,7 @@ impl Rustc { impl Step for Rustc { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; const DEFAULT: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index 2a236de01921e..c04f42ab05576 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -995,7 +995,7 @@ impl Step for Rustc { /// uplifting it from stage Y, causing the other stage to fail when attempting to link with /// stage X which was never actually built. type Output = u32; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; const DEFAULT: bool = false; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { @@ -1559,7 +1559,7 @@ pub struct GccCodegenBackend { impl Step for GccCodegenBackend { type Output = GccCodegenBackendOutput; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.alias("rustc_codegen_gcc").alias("cg_gcc") @@ -1644,7 +1644,7 @@ pub struct CraneliftCodegenBackend { impl Step for CraneliftCodegenBackend { type Output = BuildStamp; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.alias("rustc_codegen_cranelift").alias("cg_clif") @@ -2008,7 +2008,7 @@ pub struct Assemble { impl Step for Assemble { type Output = Compiler; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("compiler/rustc").path("compiler") diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index 7fdfeabe29d9c..64c2cdd2ec795 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -140,7 +140,7 @@ pub struct RustcDocs { impl Step for RustcDocs { type Output = Option; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder; @@ -402,7 +402,7 @@ pub struct Rustc { impl Step for Rustc { type Output = GeneratedTarball; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.alias("rustc") @@ -794,7 +794,7 @@ pub struct RustcDev { impl Step for RustcDev { type Output = Option; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.alias("rustc-dev") @@ -1024,7 +1024,7 @@ impl Step for Src { /// The output path of the src installer tarball type Output = GeneratedTarball; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.alias("rust-src") @@ -1085,7 +1085,7 @@ impl Step for PlainSourceTarball { /// Produces the location of the tarball generated type Output = GeneratedTarball; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder; @@ -1233,7 +1233,7 @@ pub struct Cargo { impl Step for Cargo { type Output = Option; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let default = should_build_extended_tool(run.builder, "cargo"); @@ -1287,7 +1287,7 @@ pub struct RustAnalyzer { impl Step for RustAnalyzer { type Output = Option; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let default = should_build_extended_tool(run.builder, "rust-analyzer"); @@ -1330,7 +1330,7 @@ pub struct Clippy { impl Step for Clippy { type Output = Option; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let default = should_build_extended_tool(run.builder, "clippy"); @@ -1378,7 +1378,7 @@ pub struct Miri { impl Step for Miri { type Output = Option; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let default = should_build_extended_tool(run.builder, "miri"); @@ -1428,7 +1428,7 @@ pub struct CraneliftCodegenBackend { impl Step for CraneliftCodegenBackend { type Output = Option; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { // We only want to build the cranelift backend in `x dist` if the backend was enabled @@ -1519,7 +1519,7 @@ pub struct Rustfmt { impl Step for Rustfmt { type Output = Option; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let default = should_build_extended_tool(run.builder, "rustfmt"); @@ -1564,7 +1564,7 @@ pub struct Extended { impl Step for Extended { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder; @@ -2301,7 +2301,7 @@ pub struct LlvmTools { impl Step for LlvmTools { type Output = Option; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; const DEFAULT: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { @@ -2406,7 +2406,7 @@ pub struct LlvmBitcodeLinker { impl Step for LlvmBitcodeLinker { type Output = Option; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let default = should_build_extended_tool(run.builder, "llvm-bitcode-linker"); @@ -2458,7 +2458,7 @@ pub struct RustDev { impl Step for RustDev { type Output = Option; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.alias("rust-dev") @@ -2561,7 +2561,7 @@ pub struct Bootstrap { impl Step for Bootstrap { type Output = Option; const DEFAULT: bool = false; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.alias("bootstrap") @@ -2601,7 +2601,7 @@ pub struct BuildManifest { impl Step for BuildManifest { type Output = GeneratedTarball; const DEFAULT: bool = false; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.alias("build-manifest") @@ -2633,7 +2633,7 @@ pub struct ReproducibleArtifacts { impl Step for ReproducibleArtifacts { type Output = Option; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.alias("reproducible-artifacts") diff --git a/src/bootstrap/src/core/build_steps/doc.rs b/src/bootstrap/src/core/build_steps/doc.rs index 6f0d5203d1176..f6b27d8312063 100644 --- a/src/bootstrap/src/core/build_steps/doc.rs +++ b/src/bootstrap/src/core/build_steps/doc.rs @@ -830,7 +830,7 @@ impl Rustc { impl Step for Rustc { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder; @@ -975,7 +975,7 @@ macro_rules! tool_doc { impl Step for $tool { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder; @@ -1139,7 +1139,7 @@ pub struct ErrorIndex { impl Step for ErrorIndex { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder; @@ -1181,7 +1181,7 @@ pub struct UnstableBookGen { impl Step for UnstableBookGen { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder; @@ -1248,7 +1248,7 @@ impl RustcBook { impl Step for RustcBook { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder; diff --git a/src/bootstrap/src/core/build_steps/gcc.rs b/src/bootstrap/src/core/build_steps/gcc.rs index 389afaecea336..2b36b0f2e2717 100644 --- a/src/bootstrap/src/core/build_steps/gcc.rs +++ b/src/bootstrap/src/core/build_steps/gcc.rs @@ -47,7 +47,7 @@ impl GccOutput { impl Step for Gcc { type Output = GccOutput; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/gcc").alias("gcc") diff --git a/src/bootstrap/src/core/build_steps/install.rs b/src/bootstrap/src/core/build_steps/install.rs index 666f2715224e2..4457258e9cdd0 100644 --- a/src/bootstrap/src/core/build_steps/install.rs +++ b/src/bootstrap/src/core/build_steps/install.rs @@ -163,7 +163,7 @@ macro_rules! install { $($name:ident, $condition_name: ident = $path_or_alias: literal, $default_cond:expr, - only_hosts: $only_hosts:expr, + IS_HOST: $IS_HOST:expr, $run_item:block $(, $c:ident)*;)+) => { $( #[derive(Debug, Clone, Hash, PartialEq, Eq)] @@ -183,7 +183,7 @@ macro_rules! install { impl Step for $name { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = $only_hosts; + const IS_HOST: bool = $IS_HOST; $(const $c: bool = true;)* fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { @@ -206,11 +206,11 @@ macro_rules! install { } install!((self, builder, _config), - Docs, path = "src/doc", _config.docs, only_hosts: false, { + Docs, path = "src/doc", _config.docs, IS_HOST: false, { let tarball = builder.ensure(dist::Docs { host: self.target }).expect("missing docs"); install_sh(builder, "docs", self.compiler.stage, Some(self.target), &tarball); }; - Std, path = "library/std", true, only_hosts: false, { + Std, path = "library/std", true, IS_HOST: false, { // `expect` should be safe, only None when host != build, but this // only runs when host == build let tarball = builder.ensure(dist::Std { @@ -219,13 +219,13 @@ install!((self, builder, _config), }).expect("missing std"); install_sh(builder, "std", self.compiler.stage, Some(self.target), &tarball); }; - Cargo, alias = "cargo", Self::should_build(_config), only_hosts: true, { + Cargo, alias = "cargo", Self::should_build(_config), IS_HOST: true, { let tarball = builder .ensure(dist::Cargo { build_compiler: self.compiler, target: self.target }) .expect("missing cargo"); install_sh(builder, "cargo", self.compiler.stage, Some(self.target), &tarball); }; - RustAnalyzer, alias = "rust-analyzer", Self::should_build(_config), only_hosts: true, { + RustAnalyzer, alias = "rust-analyzer", Self::should_build(_config), IS_HOST: true, { if let Some(tarball) = builder.ensure(dist::RustAnalyzer { build_compiler: self.compiler, target: self.target }) { @@ -236,13 +236,13 @@ install!((self, builder, _config), ); } }; - Clippy, alias = "clippy", Self::should_build(_config), only_hosts: true, { + Clippy, alias = "clippy", Self::should_build(_config), IS_HOST: true, { let tarball = builder .ensure(dist::Clippy { build_compiler: self.compiler, target: self.target }) .expect("missing clippy"); install_sh(builder, "clippy", self.compiler.stage, Some(self.target), &tarball); }; - Miri, alias = "miri", Self::should_build(_config), only_hosts: true, { + Miri, alias = "miri", Self::should_build(_config), IS_HOST: true, { if let Some(tarball) = builder.ensure(dist::Miri { build_compiler: self.compiler, target: self.target }) { install_sh(builder, "miri", self.compiler.stage, Some(self.target), &tarball); } else { @@ -252,7 +252,7 @@ install!((self, builder, _config), ); } }; - LlvmTools, alias = "llvm-tools", _config.llvm_tools_enabled && _config.llvm_enabled(_config.host_target), only_hosts: true, { + LlvmTools, alias = "llvm-tools", _config.llvm_tools_enabled && _config.llvm_enabled(_config.host_target), IS_HOST: true, { if let Some(tarball) = builder.ensure(dist::LlvmTools { target: self.target }) { install_sh(builder, "llvm-tools", self.compiler.stage, Some(self.target), &tarball); } else { @@ -261,7 +261,7 @@ install!((self, builder, _config), ); } }; - Rustfmt, alias = "rustfmt", Self::should_build(_config), only_hosts: true, { + Rustfmt, alias = "rustfmt", Self::should_build(_config), IS_HOST: true, { if let Some(tarball) = builder.ensure(dist::Rustfmt { build_compiler: self.compiler, target: self.target @@ -273,13 +273,13 @@ install!((self, builder, _config), ); } }; - Rustc, path = "compiler/rustc", true, only_hosts: true, { + Rustc, path = "compiler/rustc", true, IS_HOST: true, { let tarball = builder.ensure(dist::Rustc { compiler: builder.compiler(builder.top_stage, self.target), }); install_sh(builder, "rustc", self.compiler.stage, Some(self.target), &tarball); }; - RustcCodegenCranelift, alias = "rustc-codegen-cranelift", Self::should_build(_config), only_hosts: true, { + RustcCodegenCranelift, alias = "rustc-codegen-cranelift", Self::should_build(_config), IS_HOST: true, { if let Some(tarball) = builder.ensure(dist::CraneliftCodegenBackend { build_compiler: self.compiler, target: self.target @@ -292,7 +292,7 @@ install!((self, builder, _config), ); } }; - LlvmBitcodeLinker, alias = "llvm-bitcode-linker", Self::should_build(_config), only_hosts: true, { + LlvmBitcodeLinker, alias = "llvm-bitcode-linker", Self::should_build(_config), IS_HOST: true, { if let Some(tarball) = builder.ensure(dist::LlvmBitcodeLinker { build_compiler: self.compiler, target: self.target }) { install_sh(builder, "llvm-bitcode-linker", self.compiler.stage, Some(self.target), &tarball); } else { @@ -311,7 +311,7 @@ pub struct Src { impl Step for Src { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let config = &run.builder.config; diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs index 16941a32bb16e..c476d1c1a2d8b 100644 --- a/src/bootstrap/src/core/build_steps/llvm.rs +++ b/src/bootstrap/src/core/build_steps/llvm.rs @@ -255,7 +255,7 @@ pub struct Llvm { impl Step for Llvm { type Output = LlvmResult; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/llvm-project").path("src/llvm-project/llvm") @@ -908,7 +908,7 @@ pub struct Enzyme { impl Step for Enzyme { type Output = PathBuf; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/enzyme/enzyme") @@ -1013,7 +1013,7 @@ pub struct Lld { impl Step for Lld { type Output = PathBuf; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/llvm-project/lld") diff --git a/src/bootstrap/src/core/build_steps/run.rs b/src/bootstrap/src/core/build_steps/run.rs index 962dd372849d2..7f1a7d0025742 100644 --- a/src/bootstrap/src/core/build_steps/run.rs +++ b/src/bootstrap/src/core/build_steps/run.rs @@ -22,7 +22,7 @@ pub struct BuildManifest; impl Step for BuildManifest { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/build-manifest") @@ -61,7 +61,7 @@ pub struct BumpStage0; impl Step for BumpStage0 { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/bump-stage0") @@ -83,7 +83,7 @@ pub struct ReplaceVersionPlaceholder; impl Step for ReplaceVersionPlaceholder { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/replace-version-placeholder") @@ -107,7 +107,6 @@ pub struct Miri { impl Step for Miri { type Output = (); - const ONLY_HOSTS: bool = false; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/miri") @@ -175,7 +174,7 @@ pub struct CollectLicenseMetadata; impl Step for CollectLicenseMetadata { type Output = PathBuf; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/collect-license-metadata") @@ -206,7 +205,7 @@ pub struct GenerateCopyright; impl Step for GenerateCopyright { type Output = Vec; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/generate-copyright") @@ -270,7 +269,7 @@ pub struct GenerateWindowsSys; impl Step for GenerateWindowsSys { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/generate-windows-sys") @@ -332,7 +331,7 @@ pub struct UnicodeTableGenerator; impl Step for UnicodeTableGenerator { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/unicode-table-generator") @@ -354,7 +353,7 @@ pub struct FeaturesStatusDump; impl Step for FeaturesStatusDump { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/features-status-dump") @@ -416,7 +415,7 @@ impl Step for CoverageDump { type Output = (); const DEFAULT: bool = false; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/coverage-dump") @@ -438,7 +437,7 @@ pub struct Rustfmt; impl Step for Rustfmt { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/rustfmt") diff --git a/src/bootstrap/src/core/build_steps/synthetic_targets.rs b/src/bootstrap/src/core/build_steps/synthetic_targets.rs index 477ff9553a480..21733c5d9e3f7 100644 --- a/src/bootstrap/src/core/build_steps/synthetic_targets.rs +++ b/src/bootstrap/src/core/build_steps/synthetic_targets.rs @@ -21,7 +21,6 @@ pub(crate) struct MirOptPanicAbortSyntheticTarget { impl Step for MirOptPanicAbortSyntheticTarget { type Output = TargetSelection; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = false; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.never() diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs index f1be0af31837b..9bf1f889f761a 100644 --- a/src/bootstrap/src/core/build_steps/test.rs +++ b/src/bootstrap/src/core/build_steps/test.rs @@ -51,7 +51,7 @@ pub struct CrateBootstrap { impl Step for CrateBootstrap { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; const DEFAULT: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { @@ -109,7 +109,7 @@ pub struct Linkcheck { impl Step for Linkcheck { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; const DEFAULT: bool = true; /// Runs the `linkchecker` tool as compiled in `stage` by the `host` compiler. @@ -189,7 +189,7 @@ pub struct HtmlCheck { impl Step for HtmlCheck { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder; @@ -236,7 +236,7 @@ pub struct Cargotest { impl Step for Cargotest { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/cargotest") @@ -313,7 +313,7 @@ impl Cargo { impl Step for Cargo { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path(Self::CRATE_PATH) @@ -410,7 +410,7 @@ pub struct RustAnalyzer { impl Step for RustAnalyzer { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; const DEFAULT: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { @@ -469,7 +469,7 @@ pub struct Rustfmt { impl Step for Rustfmt { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/rustfmt") @@ -561,7 +561,6 @@ impl Miri { impl Step for Miri { type Output = (); - const ONLY_HOSTS: bool = false; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/miri") @@ -681,7 +680,6 @@ pub struct CargoMiri { impl Step for CargoMiri { type Output = (); - const ONLY_HOSTS: bool = false; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/miri/cargo-miri") @@ -811,7 +809,7 @@ pub struct Clippy { impl Step for Clippy { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; const DEFAULT: bool = false; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { @@ -911,7 +909,7 @@ pub struct RustdocTheme { impl Step for RustdocTheme { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/rustdoc-themes") @@ -948,7 +946,7 @@ pub struct RustdocJSStd { impl Step for RustdocJSStd { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let default = run.builder.config.nodejs.is_some(); @@ -1008,7 +1006,7 @@ pub struct RustdocJSNotStd { impl Step for RustdocJSNotStd { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let default = run.builder.config.nodejs.is_some(); @@ -1063,7 +1061,7 @@ pub struct RustdocGUI { impl Step for RustdocGUI { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder; @@ -1156,7 +1154,7 @@ pub struct Tidy; impl Step for Tidy { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; /// Runs the `tidy` tool. /// @@ -1274,7 +1272,7 @@ macro_rules! test { mode: $mode:expr, suite: $suite:expr, default: $default:expr - $( , only_hosts: $only_hosts:expr )? // default: false + $( , IS_HOST: $IS_HOST:expr )? // default: false $( , compare_mode: $compare_mode:expr )? // default: None $( , )? // optional trailing comma } @@ -1289,10 +1287,10 @@ macro_rules! test { impl Step for $name { type Output = (); const DEFAULT: bool = $default; - const ONLY_HOSTS: bool = (const { + const IS_HOST: bool = (const { #[allow(unused_assignments, unused_mut)] let mut value = false; - $( value = $only_hosts; )? + $( value = $IS_HOST; )? value }); @@ -1340,7 +1338,7 @@ pub struct CrateRunMakeSupport { impl Step for CrateRunMakeSupport { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/run-make-support") @@ -1377,7 +1375,7 @@ pub struct CrateBuildHelper { impl Step for CrateBuildHelper { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/build_helper") @@ -1445,7 +1443,7 @@ test!(UiFullDeps { mode: "ui", suite: "ui-fulldeps", default: true, - only_hosts: true, + IS_HOST: true, }); test!(Rustdoc { @@ -1453,14 +1451,14 @@ test!(Rustdoc { mode: "rustdoc", suite: "rustdoc", default: true, - only_hosts: true, + IS_HOST: true, }); test!(RustdocUi { path: "tests/rustdoc-ui", mode: "ui", suite: "rustdoc-ui", default: true, - only_hosts: true, + IS_HOST: true, }); test!(RustdocJson { @@ -1468,7 +1466,7 @@ test!(RustdocJson { mode: "rustdoc-json", suite: "rustdoc-json", default: true, - only_hosts: true, + IS_HOST: true, }); test!(Pretty { @@ -1476,7 +1474,7 @@ test!(Pretty { mode: "pretty", suite: "pretty", default: true, - only_hosts: true, + IS_HOST: true, }); test!(RunMake { path: "tests/run-make", mode: "run-make", suite: "run-make", default: true }); @@ -1507,7 +1505,7 @@ impl Step for Coverage { type Output = (); const DEFAULT: bool = true; /// Compiletest will automatically skip the "coverage-run" tests if necessary. - const ONLY_HOSTS: bool = false; + const IS_HOST: bool = false; fn should_run(mut run: ShouldRun<'_>) -> ShouldRun<'_> { // Support various invocation styles, including: @@ -1586,7 +1584,7 @@ test!(CoverageRunRustdoc { mode: "coverage-run", suite: "coverage-run-rustdoc", default: true, - only_hosts: true, + IS_HOST: true, }); // For the mir-opt suite we do not use macros, as we need custom behavior when blessing. @@ -1599,7 +1597,6 @@ pub struct MirOpt { impl Step for MirOpt { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = false; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.suite_path("tests/mir-opt") @@ -2276,7 +2273,7 @@ struct BookTest { impl Step for BookTest { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.never() @@ -2442,7 +2439,7 @@ macro_rules! test_book { impl Step for $name { type Output = (); const DEFAULT: bool = $default; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path($path) @@ -2502,7 +2499,7 @@ pub struct ErrorIndex { impl Step for ErrorIndex { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { // Also add `error-index` here since that is what appears in the error message @@ -2598,7 +2595,7 @@ pub struct CrateLibrustc { impl Step for CrateLibrustc { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.crate_or_deps("rustc-main").path("compiler") @@ -2883,7 +2880,7 @@ pub struct CrateRustdoc { impl Step for CrateRustdoc { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.paths(&["src/librustdoc", "src/tools/rustdoc"]) @@ -2975,7 +2972,7 @@ pub struct CrateRustdocJsonTypes { impl Step for CrateRustdocJsonTypes { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/rustdoc-json-types") @@ -3164,7 +3161,7 @@ pub struct Bootstrap; impl Step for Bootstrap { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; /// Tests the build system itself. fn run(self, builder: &Builder<'_>) { @@ -3234,7 +3231,7 @@ pub struct TierCheck { impl Step for TierCheck { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/tier-check") @@ -3288,7 +3285,7 @@ pub struct LintDocs { impl Step for LintDocs { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/lint-docs") @@ -3314,7 +3311,7 @@ pub struct RustInstaller; impl Step for RustInstaller { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; const DEFAULT: bool = true; /// Ensure the version placeholder replacement tool builds @@ -3434,7 +3431,7 @@ pub struct CodegenCranelift { impl Step for CodegenCranelift { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.paths(&["compiler/rustc_codegen_cranelift"]) @@ -3562,7 +3559,7 @@ pub struct CodegenGCC { impl Step for CodegenGCC { type Output = (); const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.paths(&["compiler/rustc_codegen_gcc"]) @@ -3695,7 +3692,7 @@ pub struct TestFloatParse { impl Step for TestFloatParse { type Output = (); - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; const DEFAULT: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { @@ -3761,7 +3758,7 @@ pub struct CollectLicenseMetadata; impl Step for CollectLicenseMetadata { type Output = PathBuf; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/collect-license-metadata") diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core/build_steps/tool.rs index 793e6b629c991..d7afe1ff7db89 100644 --- a/src/bootstrap/src/core/build_steps/tool.rs +++ b/src/bootstrap/src/core/build_steps/tool.rs @@ -687,7 +687,7 @@ impl Step for Rustdoc { type Output = PathBuf; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/rustdoc").path("src/librustdoc") @@ -809,7 +809,7 @@ impl Cargo { impl Step for Cargo { type Output = ToolBuildResult; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder; @@ -885,7 +885,7 @@ impl LldWrapper { impl Step for LldWrapper { type Output = BuiltLldWrapper; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/lld-wrapper") @@ -986,7 +986,7 @@ impl WasmComponentLd { impl Step for WasmComponentLd { type Output = ToolBuildResult; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.path("src/tools/wasm-component-ld") @@ -1049,7 +1049,7 @@ impl RustAnalyzer { impl Step for RustAnalyzer { type Output = ToolBuildResult; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder; @@ -1102,7 +1102,7 @@ impl Step for RustAnalyzerProcMacroSrv { type Output = ToolBuildResult; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder; @@ -1192,7 +1192,7 @@ impl LlvmBitcodeLinker { impl Step for LlvmBitcodeLinker { type Output = ToolBuildResult; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { let builder = run.builder; @@ -1246,7 +1246,7 @@ pub enum LibcxxVersion { impl Step for LibcxxVersionTool { type Output = LibcxxVersion; const DEFAULT: bool = false; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.never() @@ -1407,7 +1407,7 @@ macro_rules! tool_rustc_extended { impl Step for $name { type Output = ToolBuildResult; const DEFAULT: bool = true; // Overridden by `should_run_tool_build_step` - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { should_run_extended_rustc_tool( @@ -1575,7 +1575,7 @@ impl TestFloatParse { impl Step for TestFloatParse { type Output = ToolBuildResult; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; const DEFAULT: bool = false; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { diff --git a/src/bootstrap/src/core/build_steps/vendor.rs b/src/bootstrap/src/core/build_steps/vendor.rs index 0caeb328811aa..7b860ceb94325 100644 --- a/src/bootstrap/src/core/build_steps/vendor.rs +++ b/src/bootstrap/src/core/build_steps/vendor.rs @@ -53,7 +53,7 @@ pub(crate) struct Vendor { impl Step for Vendor { type Output = VendorOutput; const DEFAULT: bool = true; - const ONLY_HOSTS: bool = true; + const IS_HOST: bool = true; fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { run.alias("placeholder").default_condition(true) diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs index 54bf1842ab31b..7462d549d0828 100644 --- a/src/bootstrap/src/core/builder/mod.rs +++ b/src/bootstrap/src/core/builder/mod.rs @@ -100,8 +100,13 @@ pub trait Step: 'static + Clone + Debug + PartialEq + Eq + Hash { /// by `Step::should_run`. const DEFAULT: bool = false; - /// If true, then this rule should be skipped if --target was specified, but --host was not - const ONLY_HOSTS: bool = false; + /// If this value is true, then the values of `run.target` passed to the `make_run` function of + /// this Step will be determined based on the `--host` flag. + /// If this value is false, then they will be determined based on the `--target` flag. + /// + /// A corollary of the above is that if this is set to true, then the step will be skipped if + /// `--target` was specified, but `--host` was explicitly set to '' (empty string). + const IS_HOST: bool = false; /// Primary function to implement `Step` logic. /// @@ -298,7 +303,7 @@ pub fn crate_description(crates: &[impl AsRef]) -> String { struct StepDescription { default: bool, - only_hosts: bool, + is_host: bool, should_run: fn(ShouldRun<'_>) -> ShouldRun<'_>, make_run: fn(RunConfig<'_>), name: &'static str, @@ -500,7 +505,7 @@ impl StepDescription { fn from(kind: Kind) -> StepDescription { StepDescription { default: S::DEFAULT, - only_hosts: S::ONLY_HOSTS, + is_host: S::IS_HOST, should_run: S::should_run, make_run: S::make_run, name: std::any::type_name::(), @@ -516,7 +521,7 @@ impl StepDescription { } // Determine the targets participating in this rule. - let targets = if self.only_hosts { &builder.hosts } else { &builder.targets }; + let targets = if self.is_host { &builder.hosts } else { &builder.targets }; for target in targets { let run = RunConfig { builder, paths: pathsets.clone(), target: *target };