@@ -181,7 +181,7 @@ pub struct Config {
181
181
pub test_compare_mode : bool ,
182
182
pub color : Color ,
183
183
pub patch_binaries_for_nix : Option < bool > ,
184
- pub stage0_metadata : Stage0Metadata ,
184
+ pub stage0_metadata : build_helper :: stage0_parser :: Stage0 ,
185
185
pub android_ndk : Option < PathBuf > ,
186
186
/// Whether to use the `c` feature of the `compiler_builtins` crate.
187
187
pub optimized_compiler_builtins : bool ,
@@ -350,34 +350,6 @@ pub struct Config {
350
350
pub paths : Vec < PathBuf > ,
351
351
}
352
352
353
- #[ derive( Default , Deserialize , Clone ) ]
354
- pub struct Stage0Metadata {
355
- pub compiler : CompilerMetadata ,
356
- pub config : Stage0Config ,
357
- pub checksums_sha256 : HashMap < String , String > ,
358
- pub rustfmt : Option < RustfmtMetadata > ,
359
- }
360
- #[ derive( Default , Deserialize , Clone ) ]
361
- pub struct CompilerMetadata {
362
- pub date : String ,
363
- pub version : String ,
364
- }
365
-
366
- #[ derive( Default , Deserialize , Clone ) ]
367
- pub struct Stage0Config {
368
- pub dist_server : String ,
369
- pub artifacts_server : String ,
370
- pub artifacts_with_llvm_assertions_server : String ,
371
- pub git_merge_commit_email : String ,
372
- pub git_repository : String ,
373
- pub nightly_branch : String ,
374
- }
375
- #[ derive( Default , Deserialize , Clone ) ]
376
- pub struct RustfmtMetadata {
377
- pub date : String ,
378
- pub version : String ,
379
- }
380
-
381
353
#[ derive( Clone , Debug , Default ) ]
382
354
pub enum RustfmtState {
383
355
SystemToolchain ( PathBuf ) ,
@@ -1296,13 +1268,13 @@ impl Config {
1296
1268
Some ( p) => PathBuf :: from ( p) ,
1297
1269
None => git_root,
1298
1270
} ;
1299
- // If this doesn't have at least `stage0.json `, we guessed wrong. This can happen when,
1271
+ // If this doesn't have at least `stage0`, we guessed wrong. This can happen when,
1300
1272
// for example, the build directory is inside of another unrelated git directory.
1301
1273
// In that case keep the original `CARGO_MANIFEST_DIR` handling.
1302
1274
//
1303
1275
// NOTE: this implies that downloadable bootstrap isn't supported when the build directory is outside
1304
1276
// the source directory. We could fix that by setting a variable from all three of python, ./x, and x.ps1.
1305
- if git_root. join ( "src" ) . join ( "stage0.json " ) . exists ( ) {
1277
+ if git_root. join ( "src" ) . join ( "stage0" ) . exists ( ) {
1306
1278
config. src = git_root;
1307
1279
}
1308
1280
} else {
@@ -1320,9 +1292,7 @@ impl Config {
1320
1292
. to_path_buf ( ) ;
1321
1293
}
1322
1294
1323
- let stage0_json = t ! ( std:: fs:: read( config. src. join( "src" ) . join( "stage0.json" ) ) ) ;
1324
-
1325
- config. stage0_metadata = t ! ( serde_json:: from_slice:: <Stage0Metadata >( & stage0_json) ) ;
1295
+ config. stage0_metadata = build_helper:: stage0_parser:: parse_stage0_file ( ) ;
1326
1296
1327
1297
// Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then `./config.toml`, then `config.toml` in the root directory.
1328
1298
let toml_path = flags
0 commit comments