@@ -17,7 +17,6 @@ use std::{env, fs};
1717use build_helper:: ci:: CiEnv ;
1818use build_helper:: exit;
1919use build_helper:: git:: { GitConfig , PathFreshness , check_path_modifications, output_result} ;
20- use serde:: Deserialize ;
2120#[ cfg( feature = "tracing" ) ]
2221use tracing:: { instrument, span} ;
2322
@@ -26,13 +25,12 @@ use crate::core::build_steps::llvm::LLVM_INVALIDATION_PATHS;
2625use crate :: core:: config:: flags:: Color ;
2726pub use crate :: core:: config:: flags:: Subcommand ;
2827use crate :: core:: config:: parsing:: check_incompatible_options_for_ci_rustc;
29- use crate :: core:: config:: toml:: change_id:: { ChangeId , ChangeIdWrapper } ;
28+ use crate :: core:: config:: toml:: change_id:: ChangeId ;
3029use crate :: core:: config:: toml:: common:: {
3130 DebuginfoLevel , LlvmLibunwind , SplitDebuginfo , StringOrBool ,
3231} ;
3332use crate :: core:: config:: toml:: rust:: { LldMode , RustOptimize } ;
3433use crate :: core:: config:: toml:: target:: Target ;
35- use crate :: core:: config:: toml:: * ;
3634use crate :: core:: config:: types:: { DryRun , GccCiMode , RustcLto } ;
3735use crate :: core:: download:: is_download_ci_available;
3836use crate :: utils:: channel;
@@ -58,14 +56,6 @@ pub const RUSTC_IF_UNCHANGED_ALLOWED_PATHS: &[&str] = &[
5856 ":!triagebot.toml" ,
5957] ;
6058
61- /// This file is embedded in the overlay directory of the tarball sources. It is
62- /// useful in scenarios where developers want to see how the tarball sources were
63- /// generated.
64- ///
65- /// We also use this file to compare the host's bootstrap.toml against the CI rustc builder
66- /// configuration to detect any incompatible options.
67- pub const BUILDER_CONFIG_FILENAME : & str = "builder-config" ;
68-
6959/// Global configuration for the entire build and/or bootstrap.
7060///
7161/// This structure is parsed from `bootstrap.toml`, and some of the fields are inferred from `git` or build-time parameters.
@@ -358,47 +348,6 @@ impl Config {
358348 Self :: parse_inner ( flags, Self :: get_toml)
359349 }
360350
361- pub ( crate ) fn get_builder_toml ( & self , build_name : & str ) -> Result < TomlConfig , toml:: de:: Error > {
362- if self . dry_run ( ) {
363- return Ok ( TomlConfig :: default ( ) ) ;
364- }
365-
366- let builder_config_path =
367- self . out . join ( self . build . triple ) . join ( build_name) . join ( BUILDER_CONFIG_FILENAME ) ;
368- Self :: get_toml ( & builder_config_path)
369- }
370-
371- pub ( crate ) fn get_toml ( file : & Path ) -> Result < TomlConfig , toml:: de:: Error > {
372- #[ cfg( test) ]
373- return Ok ( TomlConfig :: default ( ) ) ;
374-
375- #[ cfg( not( test) ) ]
376- Self :: get_toml_inner ( file)
377- }
378-
379- pub ( crate ) fn get_toml_inner ( file : & Path ) -> Result < TomlConfig , toml:: de:: Error > {
380- let contents =
381- t ! ( fs:: read_to_string( file) , format!( "config file {} not found" , file. display( ) ) ) ;
382- // Deserialize to Value and then TomlConfig to prevent the Deserialize impl of
383- // TomlConfig and sub types to be monomorphized 5x by toml.
384- toml:: from_str ( & contents)
385- . and_then ( |table : toml:: Value | TomlConfig :: deserialize ( table) )
386- . inspect_err ( |_| {
387- if let Ok ( ChangeIdWrapper { inner : Some ( ChangeId :: Id ( id) ) } ) =
388- toml:: from_str :: < toml:: Value > ( & contents)
389- . and_then ( |table : toml:: Value | ChangeIdWrapper :: deserialize ( table) )
390- {
391- let changes = crate :: find_recent_config_change_ids ( id) ;
392- if !changes. is_empty ( ) {
393- println ! (
394- "WARNING: There have been changes to x.py since you last updated:\n {}" ,
395- crate :: human_readable_changes( changes)
396- ) ;
397- }
398- }
399- } )
400- }
401-
402351 pub fn dry_run ( & self ) -> bool {
403352 match self . dry_run {
404353 DryRun :: Disabled => false ,
0 commit comments