Skip to content

Commit 775c970

Browse files
committed
Add support for allowing features when checking tools
1 parent 2071976 commit 775c970

File tree

1 file changed

+15
-2
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+15
-2
lines changed

src/bootstrap/src/core/build_steps/check.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use crate::core::build_steps::compile::{
44
add_to_sysroot, run_cargo, rustc_cargo, rustc_cargo_env, std_cargo, std_crates_for_run_make,
55
};
6+
use crate::core::build_steps::tool;
67
use crate::core::build_steps::tool::{COMPILETEST_ALLOW_FEATURES, SourceType, prepare_tool_cargo};
78
use crate::core::builder::{
89
self, Alias, Builder, Kind, RunConfig, ShouldRun, Step, StepMetadata, crate_description,
@@ -477,6 +478,7 @@ macro_rules! tool_check_step {
477478
path: $path:literal
478479
$(, alt_path: $alt_path:literal )*
479480
, mode: $mode:path
481+
$(, allow_features: $allow_features:expr )?
480482
$(, default: $default:literal )?
481483
$( , )?
482484
}
@@ -505,7 +507,12 @@ macro_rules! tool_check_step {
505507

506508
fn run(self, builder: &Builder<'_>) {
507509
let Self { target, build_compiler } = self;
508-
run_tool_check_step(builder, build_compiler, target, $path, $mode);
510+
let allow_features = {
511+
let mut _value = "";
512+
$( _value = $allow_features; )?
513+
_value
514+
};
515+
run_tool_check_step(builder, build_compiler, target, $path, $mode, allow_features);
509516
}
510517

511518
fn metadata(&self) -> Option<StepMetadata> {
@@ -522,6 +529,7 @@ fn run_tool_check_step(
522529
target: TargetSelection,
523530
path: &str,
524531
mode: Mode,
532+
allow_features: &str,
525533
) {
526534
let display_name = path.rsplit('/').next().unwrap();
527535

@@ -539,6 +547,7 @@ fn run_tool_check_step(
539547
SourceType::InTree,
540548
&[],
541549
);
550+
cargo.allow_features(allow_features);
542551

543552
// FIXME: check bootstrap doesn't currently work with --all-targets
544553
cargo.arg("--all-targets");
@@ -575,7 +584,11 @@ tool_check_step!(MiroptTestTools {
575584
mode: Mode::ToolBootstrap
576585
});
577586
// We want to test the local std
578-
tool_check_step!(TestFloatParse { path: "src/tools/test-float-parse", mode: Mode::ToolStd });
587+
tool_check_step!(TestFloatParse {
588+
path: "src/tools/test-float-parse",
589+
mode: Mode::ToolStd,
590+
allow_features: tool::TestFloatParse::ALLOW_FEATURES
591+
});
579592
tool_check_step!(FeaturesStatusDump {
580593
path: "src/tools/features-status-dump",
581594
mode: Mode::ToolBootstrap

0 commit comments

Comments
 (0)