3
3
use crate :: core:: build_steps:: compile:: {
4
4
add_to_sysroot, run_cargo, rustc_cargo, rustc_cargo_env, std_cargo, std_crates_for_run_make,
5
5
} ;
6
+ use crate :: core:: build_steps:: tool;
6
7
use crate :: core:: build_steps:: tool:: { COMPILETEST_ALLOW_FEATURES , SourceType , prepare_tool_cargo} ;
7
8
use crate :: core:: builder:: {
8
9
self , Alias , Builder , Kind , RunConfig , ShouldRun , Step , StepMetadata , crate_description,
@@ -477,6 +478,7 @@ macro_rules! tool_check_step {
477
478
path: $path: literal
478
479
$( , alt_path: $alt_path: literal ) *
479
480
, mode: $mode: path
481
+ $( , allow_features: $allow_features: expr ) ?
480
482
$( , default : $default: literal ) ?
481
483
$( , ) ?
482
484
}
@@ -505,7 +507,12 @@ macro_rules! tool_check_step {
505
507
506
508
fn run( self , builder: & Builder <' _>) {
507
509
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) ;
509
516
}
510
517
511
518
fn metadata( & self ) -> Option <StepMetadata > {
@@ -522,6 +529,7 @@ fn run_tool_check_step(
522
529
target : TargetSelection ,
523
530
path : & str ,
524
531
mode : Mode ,
532
+ allow_features : & str ,
525
533
) {
526
534
let display_name = path. rsplit ( '/' ) . next ( ) . unwrap ( ) ;
527
535
@@ -539,6 +547,7 @@ fn run_tool_check_step(
539
547
SourceType :: InTree ,
540
548
& [ ] ,
541
549
) ;
550
+ cargo. allow_features ( allow_features) ;
542
551
543
552
// FIXME: check bootstrap doesn't currently work with --all-targets
544
553
cargo. arg ( "--all-targets" ) ;
@@ -575,7 +584,11 @@ tool_check_step!(MiroptTestTools {
575
584
mode: Mode :: ToolBootstrap
576
585
} ) ;
577
586
// 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
+ } ) ;
579
592
tool_check_step ! ( FeaturesStatusDump {
580
593
path: "src/tools/features-status-dump" ,
581
594
mode: Mode :: ToolBootstrap
0 commit comments