@@ -181,7 +181,7 @@ pub struct Config {
181181 pub test_compare_mode : bool ,
182182 pub color : Color ,
183183 pub patch_binaries_for_nix : Option < bool > ,
184- pub stage0_metadata : Stage0Metadata ,
184+ pub stage0_metadata : build_helper :: stage0_parser :: Stage0 ,
185185 pub android_ndk : Option < PathBuf > ,
186186 /// Whether to use the `c` feature of the `compiler_builtins` crate.
187187 pub optimized_compiler_builtins : bool ,
@@ -350,34 +350,6 @@ pub struct Config {
350350 pub paths : Vec < PathBuf > ,
351351}
352352
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-
381353#[ derive( Clone , Debug , Default ) ]
382354pub enum RustfmtState {
383355 SystemToolchain ( PathBuf ) ,
@@ -1296,13 +1268,13 @@ impl Config {
12961268 Some ( p) => PathBuf :: from ( p) ,
12971269 None => git_root,
12981270 } ;
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,
13001272 // for example, the build directory is inside of another unrelated git directory.
13011273 // In that case keep the original `CARGO_MANIFEST_DIR` handling.
13021274 //
13031275 // NOTE: this implies that downloadable bootstrap isn't supported when the build directory is outside
13041276 // 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 ( ) {
13061278 config. src = git_root;
13071279 }
13081280 } else {
@@ -1320,9 +1292,7 @@ impl Config {
13201292 . to_path_buf ( ) ;
13211293 }
13221294
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 ( ) ;
13261296
13271297 // Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then `./config.toml`, then `config.toml` in the root directory.
13281298 let toml_path = flags
0 commit comments