@@ -102,6 +102,21 @@ impl Step for JsonDocs {
102
102
103
103
/// Builds the `rust-docs-json` installer component.
104
104
fn run ( self , builder : & Builder < ' _ > ) -> Option < GeneratedTarball > {
105
+ fn is_tier_1_target ( target : & TargetSelection ) -> bool {
106
+ const T1_TARGETS : & [ & str ] = & [
107
+ "aarch64-unknown-linux-gnu" ,
108
+ "i686-pc-windows-gnu" ,
109
+ "i686-pc-windows-msvc" ,
110
+ "i686-unknown-linux-gnu" ,
111
+ "x86_64-unknown-linux-gnu" ,
112
+ "x86_64-apple-darwin" ,
113
+ "x86_64-pc-windows-gnu" ,
114
+ "x86_64-pc-windows-msvc" ,
115
+ ] ;
116
+
117
+ T1_TARGETS . contains ( & target. triple . to_string ( ) . as_str ( ) )
118
+ }
119
+
105
120
let host = self . host ;
106
121
builder. ensure ( crate :: core:: build_steps:: doc:: Std :: new (
107
122
builder. top_stage ,
@@ -110,11 +125,19 @@ impl Step for JsonDocs {
110
125
) ) ;
111
126
112
127
let dest = "share/doc/rust/json" ;
128
+ let out = builder. json_doc_out ( host) ;
129
+
130
+ if is_tier_1_target ( & host) {
131
+ // On tier 1 targets, make sure these are present in the component.
132
+ for f in [ "alloc.json" , "core.json" , "std.json" ] {
133
+ assert ! ( out. join( f) . exists( ) , "rust-docs-json is missing `{f}`." ) ;
134
+ }
135
+ }
113
136
114
137
let mut tarball = Tarball :: new ( builder, "rust-docs-json" , & host. triple ) ;
115
138
tarball. set_product_name ( "Rust Documentation In JSON Format" ) ;
116
139
tarball. is_preview ( true ) ;
117
- tarball. add_bulk_dir ( builder . json_doc_out ( host ) , dest) ;
140
+ tarball. add_bulk_dir ( out , dest) ;
118
141
Some ( tarball. generate ( ) )
119
142
}
120
143
}
0 commit comments