@@ -2297,6 +2297,48 @@ impl Step for RustDev {
2297
2297
}
2298
2298
}
2299
2299
2300
+ // Tarball intended for internal consumption to ease rustc/std development.
2301
+ //
2302
+ // Should not be considered stable by end users.
2303
+ #[ derive( Clone , Debug , Eq , Hash , PartialEq ) ]
2304
+ pub struct RustDevConfig {
2305
+ pub target : TargetSelection ,
2306
+ }
2307
+
2308
+ impl Step for RustDevConfig {
2309
+ type Output = Option < GeneratedTarball > ;
2310
+ const DEFAULT : bool = true ;
2311
+ const ONLY_HOSTS : bool = true ;
2312
+
2313
+ fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
2314
+ run. alias ( "rust-dev-config" )
2315
+ }
2316
+
2317
+ fn make_run ( run : RunConfig < ' _ > ) {
2318
+ run. builder . ensure ( RustDevConfig { target : run. target } ) ;
2319
+ }
2320
+
2321
+ fn run ( self , builder : & Builder < ' _ > ) -> Option < GeneratedTarball > {
2322
+ let target = self . target ;
2323
+
2324
+ /* run only if llvm-config isn't used */
2325
+ if let Some ( config) = builder. config . target_config . get ( & target) {
2326
+ if let Some ( ref _s) = config. llvm_config {
2327
+ builder. info ( & format ! ( "Skipping RustDevConfig ({}): external LLVM" , target) ) ;
2328
+ return None ;
2329
+ }
2330
+ }
2331
+
2332
+ let mut tarball = Tarball :: new ( builder, "rust-dev-config" , & target. triple ) ;
2333
+ tarball. set_overlay ( OverlayKind :: LLVM ) ;
2334
+
2335
+ let config = t ! ( serde_json:: to_string_pretty( & builder. build. config. llvm) ) ;
2336
+ t ! ( std:: fs:: write( tarball. image_dir( ) . join( "llvm-opts.json" ) , config) ) ;
2337
+
2338
+ Some ( tarball. generate ( ) )
2339
+ }
2340
+ }
2341
+
2300
2342
// Tarball intended for internal consumption to ease rustc/std development.
2301
2343
//
2302
2344
// Should not be considered stable by end users.
0 commit comments