diff options
| author | Jakub Beránek <berykubik@gmail.com> | 2025-07-05 11:46:23 +0200 |
|---|---|---|
| committer | Jakub Beránek <berykubik@gmail.com> | 2025-07-06 17:25:19 +0200 |
| commit | 775c970aaef323e78dfa77c61d8f328d3c5cf21a (patch) | |
| tree | 3c7989b3776cf51d9c193844d79b11c4211aba9e /src/bootstrap | |
| parent | 20719767bc04ab72ae1c1d0751caff960b984ac9 (diff) | |
| download | rust-775c970aaef323e78dfa77c61d8f328d3c5cf21a.tar.gz rust-775c970aaef323e78dfa77c61d8f328d3c5cf21a.zip | |
Add support for allowing features when checking tools
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/src/core/build_steps/check.rs | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/bootstrap/src/core/build_steps/check.rs b/src/bootstrap/src/core/build_steps/check.rs index 40632f35bd7..dad8e69e933 100644 --- a/src/bootstrap/src/core/build_steps/check.rs +++ b/src/bootstrap/src/core/build_steps/check.rs @@ -3,6 +3,7 @@ use crate::core::build_steps::compile::{ add_to_sysroot, run_cargo, rustc_cargo, rustc_cargo_env, std_cargo, std_crates_for_run_make, }; +use crate::core::build_steps::tool; use crate::core::build_steps::tool::{COMPILETEST_ALLOW_FEATURES, SourceType, prepare_tool_cargo}; use crate::core::builder::{ self, Alias, Builder, Kind, RunConfig, ShouldRun, Step, StepMetadata, crate_description, @@ -477,6 +478,7 @@ macro_rules! tool_check_step { path: $path:literal $(, alt_path: $alt_path:literal )* , mode: $mode:path + $(, allow_features: $allow_features:expr )? $(, default: $default:literal )? $( , )? } @@ -505,7 +507,12 @@ macro_rules! tool_check_step { fn run(self, builder: &Builder<'_>) { let Self { target, build_compiler } = self; - run_tool_check_step(builder, build_compiler, target, $path, $mode); + let allow_features = { + let mut _value = ""; + $( _value = $allow_features; )? + _value + }; + run_tool_check_step(builder, build_compiler, target, $path, $mode, allow_features); } fn metadata(&self) -> Option<StepMetadata> { @@ -522,6 +529,7 @@ fn run_tool_check_step( target: TargetSelection, path: &str, mode: Mode, + allow_features: &str, ) { let display_name = path.rsplit('/').next().unwrap(); @@ -539,6 +547,7 @@ fn run_tool_check_step( SourceType::InTree, &[], ); + cargo.allow_features(allow_features); // FIXME: check bootstrap doesn't currently work with --all-targets cargo.arg("--all-targets"); @@ -575,7 +584,11 @@ tool_check_step!(MiroptTestTools { mode: Mode::ToolBootstrap }); // We want to test the local std -tool_check_step!(TestFloatParse { path: "src/tools/test-float-parse", mode: Mode::ToolStd }); +tool_check_step!(TestFloatParse { + path: "src/tools/test-float-parse", + mode: Mode::ToolStd, + allow_features: tool::TestFloatParse::ALLOW_FEATURES +}); tool_check_step!(FeaturesStatusDump { path: "src/tools/features-status-dump", mode: Mode::ToolBootstrap |
