@@ -3028,6 +3028,63 @@ fn prepare_cargo_test(
30283028/// FIXME(Zalathar): Try to split this into two separate steps: a user-visible
30293029/// step for testing standard library crates, and an internal step used for both
30303030/// library crates and compiler crates.
3031+ #[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
3032+ pub struct Stdarch {
3033+ build_compiler : Compiler ,
3034+ target : TargetSelection ,
3035+ }
3036+
3037+ impl Step for Stdarch {
3038+ type Output = ( ) ;
3039+ const IS_HOST : bool = true ;
3040+
3041+ fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
3042+ run. path ( "library/stdarch" ) . path ( "library/stdarch/crates/core_arch" )
3043+ }
3044+
3045+ fn is_default_step ( _builder : & Builder < ' _ > ) -> bool {
3046+ false
3047+ }
3048+
3049+ fn make_run ( run : RunConfig < ' _ > ) {
3050+ let builder = run. builder ;
3051+ let host = run. build_triple ( ) ;
3052+ let build_compiler = builder. compiler ( builder. top_stage , host) ;
3053+
3054+ builder. ensure ( Stdarch { build_compiler, target : run. target } ) ;
3055+ }
3056+
3057+ fn run ( self , builder : & Builder < ' _ > ) {
3058+ let build_compiler = self . build_compiler ;
3059+ let target = self . target ;
3060+
3061+ builder. ensure ( Std :: new ( build_compiler, build_compiler. host ) . force_recompile ( true ) ) ;
3062+
3063+ if !builder. config . is_host_target ( target) {
3064+ builder. ensure ( compile:: Std :: new ( build_compiler, target) . force_recompile ( true ) ) ;
3065+ builder. ensure ( RemoteCopyLibs { build_compiler, target } ) ;
3066+ }
3067+
3068+ let mut cargo = builder:: Cargo :: new (
3069+ builder,
3070+ build_compiler,
3071+ Mode :: Std ,
3072+ SourceType :: InTree ,
3073+ target,
3074+ builder. kind ,
3075+ ) ;
3076+
3077+ cargo. arg ( "--manifest-path" ) . arg ( builder. src . join ( "library/stdarch/Cargo.toml" ) ) ;
3078+
3079+ let crates = vec ! [ "core_arch" . to_owned( ) ] ;
3080+ run_cargo_test ( cargo, & [ ] , & crates, "stdarch" , target, builder) ;
3081+ }
3082+
3083+ fn metadata ( & self ) -> Option < StepMetadata > {
3084+ Some ( StepMetadata :: test ( "stdarch" , self . target ) . built_by ( self . build_compiler ) )
3085+ }
3086+ }
3087+
30313088#[ derive( Debug , Clone , PartialEq , Eq , Hash ) ]
30323089pub struct Crate {
30333090 /// The compiler that will *build* libstd or rustc in test mode.
0 commit comments