@@ -889,14 +889,19 @@ impl Step for RustcDev {
889889 }
890890}
891891
892+ /// The `rust-analysis` component used to create a tarball of save-analysis metadata.
893+ ///
894+ /// This component has been deprecated and its contents now only include a warning about
895+ /// its non-availability.
892896#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
893897pub struct Analysis {
894- pub compiler : Compiler ,
895- pub target : TargetSelection ,
898+ build_compiler : Compiler ,
899+ target : TargetSelection ,
896900}
897901
898902impl Step for Analysis {
899903 type Output = Option < GeneratedTarball > ;
904+
900905 const DEFAULT : bool = true ;
901906
902907 fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
@@ -905,24 +910,17 @@ impl Step for Analysis {
905910 }
906911
907912 fn make_run ( run : RunConfig < ' _ > ) {
913+ // The step just produces a deprecation notice, so we just hardcode stage 1
908914 run. builder . ensure ( Analysis {
909- // Find the actual compiler (handling the full bootstrap option) which
910- // produced the save-analysis data because that data isn't copied
911- // through the sysroot uplifting.
912- compiler : run. builder . compiler_for (
913- run. builder . top_stage ,
914- run. builder . config . host_target ,
915- run. target ,
916- ) ,
915+ build_compiler : run. builder . compiler ( 1 , run. builder . config . host_target ) ,
917916 target : run. target ,
918917 } ) ;
919918 }
920919
921- /// Creates a tarball of (degenerate) save-analysis metadata, if available.
922920 fn run ( self , builder : & Builder < ' _ > ) -> Option < GeneratedTarball > {
923- let compiler = self . compiler ;
921+ let compiler = self . build_compiler ;
924922 let target = self . target ;
925- if !builder . config . is_host_target ( compiler. host ) {
923+ if skip_host_target_lib ( builder , compiler) {
926924 return None ;
927925 }
928926
@@ -945,6 +943,10 @@ impl Step for Analysis {
945943 tarball. add_dir ( src, format ! ( "lib/rustlib/{}/analysis" , target. triple) ) ;
946944 Some ( tarball. generate ( ) )
947945 }
946+
947+ fn metadata ( & self ) -> Option < StepMetadata > {
948+ Some ( StepMetadata :: dist ( "analysis" , self . target ) . built_by ( self . build_compiler ) )
949+ }
948950}
949951
950952/// Use the `builder` to make a filtered copy of `base`/X for X in (`src_dirs` - `exclude_dirs`) to
@@ -1669,7 +1671,7 @@ impl Step for Extended {
16691671 add_component ! ( "llvm-components" => LlvmTools { target } ) ;
16701672 add_component ! ( "clippy" => Clippy { build_compiler: compiler, target } ) ;
16711673 add_component ! ( "miri" => Miri { build_compiler: compiler, target } ) ;
1672- add_component ! ( "analysis" => Analysis { compiler, target } ) ;
1674+ add_component ! ( "analysis" => Analysis { build_compiler : compiler, target } ) ;
16731675 add_component ! ( "rustc-codegen-cranelift" => CraneliftCodegenBackend {
16741676 build_compiler: compiler,
16751677 target
0 commit comments