From 86adf9e882266d658876b943ed062e3f9ea8a375 Mon Sep 17 00:00:00 2001 From: default Date: Tue, 23 Jul 2024 17:15:43 +0800 Subject: [PATCH] Revert "Add a check for and add a new change entry in change_tracker.rs" This reverts commit 7ed53215ea6b7ea12f512ac298796c7ba476aa91. --- src/bootstrap/bootstrap.py | 14 +++++++------- src/bootstrap/src/core/config/config.rs | 14 ++++++-------- src/bootstrap/src/utils/change_tracker.rs | 11 +++-------- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index cd224a2d08ce3..7e738df54e1a4 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -1107,18 +1107,18 @@ def bootstrap(args): "git clone nor distributed tarball.\nThis build may fail due to missing submodules " "unless you put them in place manually.") - # Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then `./bootstrap.toml` or `./config.toml`, - # then `bootstrap.toml` or `config.toml` in the root directory. + # Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then `./bootstrap.toml` + # then `bootstrap.toml`, then `config.toml` in the root directory. toml_path = args.config or os.getenv('RUST_BOOTSTRAP_CONFIG') using_default_path = toml_path is None if using_default_path: toml_path = 'bootstrap.toml' if not os.path.exists(toml_path): - toml_path = 'config.toml' - if not os.path.exists(toml_path): - toml_path = os.path.join(rust_root, 'bootstrap.toml') - if not os.path.exists(toml_path): - toml_path = os.path.join(rust_root, 'config.toml') + bootstrap_toml_path = os.path.join(rust_root, 'bootstrap.toml') + if not os.path.exists(bootstrap_toml_path): + toml_path = os.path.join(rust_root, 'config.toml') + else: + toml_path = bootstrap_toml_path # Give a hard error if `--config` or `RUST_BOOTSTRAP_CONFIG` are set to a missing path, # but not if `bootstrap.toml` hasn't been created. diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index cdcacf5b56ac7..647afcc5307c2 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -1305,8 +1305,7 @@ impl Config { config.stage0_metadata = build_helper::stage0_parser::parse_stage0_file(); - // Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then `./bootstrap.toml` or `./config.toml`, - // then `bootstrap.toml` or `config.toml` in the root directory. + // Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then `./bootstrap.toml`, then `bootstrap.toml`, then `config.toml` in the root directory. let toml_path = flags .config .clone() @@ -1314,12 +1313,11 @@ impl Config { let using_default_path = toml_path.is_none(); let mut toml_path = toml_path.unwrap_or_else(|| PathBuf::from("bootstrap.toml")); if using_default_path && !toml_path.exists() { - toml_path = PathBuf::from("config.toml"); - if using_default_path && !toml_path.exists() { - toml_path = config.src.join(PathBuf::from("bootstrap.toml")); - if !toml_path.exists() { - toml_path = config.src.join(PathBuf::from("config.toml")); - } + let bootstrap_toml_path = config.src.join(toml_path); + if !bootstrap_toml_path.exists() { + toml_path = config.src.join(PathBuf::from("config.toml")); + } else { + toml_path = bootstrap_toml_path; } } diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs index c54c4ea2dd40b..b7edacd417fb3 100644 --- a/src/bootstrap/src/utils/change_tracker.rs +++ b/src/bootstrap/src/utils/change_tracker.rs @@ -93,7 +93,7 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ ChangeInfo { change_id: 117435, severity: ChangeSeverity::Info, - summary: "New option `rust.parallel-compiler` added to config.toml.", + summary: "New option `rust.parallel-compiler` added to bootstrap.toml.", }, ChangeInfo { change_id: 116881, @@ -133,7 +133,7 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ ChangeInfo { change_id: 120348, severity: ChangeSeverity::Info, - summary: "New option `target..codegen-backends` added to config.toml.", + summary: "New option `target..codegen-backends` added to bootstrap.toml.", }, ChangeInfo { change_id: 121203, @@ -173,7 +173,7 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ ChangeInfo { change_id: 123711, severity: ChangeSeverity::Warning, - summary: "The deprecated field `changelog-seen` has been removed. Using that field in `config.toml` from now on will result in breakage.", + summary: "The deprecated field `changelog-seen` has been removed. Using that field in `bootstrap.toml` from now on will result in breakage.", }, ChangeInfo { change_id: 124501, @@ -200,9 +200,4 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[ severity: ChangeSeverity::Warning, summary: "`llvm.lld` is enabled by default for the dist profile. If set to false, `lld` will not be included in the dist build.", }, - ChangeInfo { - change_id: 126875, - severity: ChangeSeverity::Warning, - summary: "Renamed the bootstrap configuration file from `config.toml` to `bootstrap.toml`.", - }, ];