Skip to content

Commit dc50770

Browse files
author
default
committed
Add a check for and add a new change entry in change_tracker.rs
1 parent 61544b8 commit dc50770

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

src/bootstrap/bootstrap.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -1107,18 +1107,18 @@ def bootstrap(args):
11071107
"git clone nor distributed tarball.\nThis build may fail due to missing submodules "
11081108
"unless you put them in place manually.")
11091109

1110-
# Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then `./bootstrap.toml`
1111-
# then `bootstrap.toml`, then `config.toml` in the root directory.
1110+
# Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then `./bootstrap.toml` or `./config.toml`,
1111+
# then `bootstrap.toml` or `config.toml` in the root directory.
11121112
toml_path = args.config or os.getenv('RUST_BOOTSTRAP_CONFIG')
11131113
using_default_path = toml_path is None
11141114
if using_default_path:
11151115
toml_path = 'bootstrap.toml'
11161116
if not os.path.exists(toml_path):
1117-
bootstrap_toml_path = os.path.join(rust_root, 'bootstrap.toml')
1118-
if not os.path.exists(bootstrap_toml_path):
1119-
toml_path = os.path.join(rust_root, 'config.toml')
1120-
else:
1121-
toml_path = bootstrap_toml_path
1117+
toml_path = 'config.toml'
1118+
if not os.path.exists(toml_path):
1119+
toml_path = os.path.join(rust_root, 'bootstrap.toml')
1120+
if not os.path.exists(toml_path):
1121+
toml_path = os.path.join(rust_root, 'config.toml')
11221122

11231123
# Give a hard error if `--config` or `RUST_BOOTSTRAP_CONFIG` are set to a missing path,
11241124
# but not if `bootstrap.toml` hasn't been created.

src/bootstrap/src/core/config/config.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -1305,19 +1305,21 @@ impl Config {
13051305

13061306
config.stage0_metadata = build_helper::stage0_parser::parse_stage0_file();
13071307

1308-
// Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then `./bootstrap.toml`, then `bootstrap.toml`, then `config.toml` in the root directory.
1308+
// Read from `--config`, then `RUST_BOOTSTRAP_CONFIG`, then `./bootstrap.toml` or `./config.toml`,
1309+
// then `bootstrap.toml` or `config.toml` in the root directory.
13091310
let toml_path = flags
13101311
.config
13111312
.clone()
13121313
.or_else(|| env::var_os("RUST_BOOTSTRAP_CONFIG").map(PathBuf::from));
13131314
let using_default_path = toml_path.is_none();
13141315
let mut toml_path = toml_path.unwrap_or_else(|| PathBuf::from("bootstrap.toml"));
13151316
if using_default_path && !toml_path.exists() {
1316-
let bootstrap_toml_path = config.src.join(toml_path);
1317-
if !bootstrap_toml_path.exists() {
1318-
toml_path = config.src.join(PathBuf::from("config.toml"));
1319-
} else {
1320-
toml_path = bootstrap_toml_path;
1317+
toml_path = PathBuf::from("config.toml");
1318+
if using_default_path && !toml_path.exists() {
1319+
toml_path = config.src.join(PathBuf::from("bootstrap.toml"));
1320+
if !toml_path.exists() {
1321+
toml_path = config.src.join(PathBuf::from("config.toml"));
1322+
}
13211323
}
13221324
}
13231325

src/bootstrap/src/utils/change_tracker.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
9393
ChangeInfo {
9494
change_id: 117435,
9595
severity: ChangeSeverity::Info,
96-
summary: "New option `rust.parallel-compiler` added to bootstrap.toml.",
96+
summary: "New option `rust.parallel-compiler` added to config.toml.",
9797
},
9898
ChangeInfo {
9999
change_id: 116881,
@@ -133,7 +133,7 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
133133
ChangeInfo {
134134
change_id: 120348,
135135
severity: ChangeSeverity::Info,
136-
summary: "New option `target.<triple>.codegen-backends` added to bootstrap.toml.",
136+
summary: "New option `target.<triple>.codegen-backends` added to config.toml.",
137137
},
138138
ChangeInfo {
139139
change_id: 121203,
@@ -173,7 +173,7 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
173173
ChangeInfo {
174174
change_id: 123711,
175175
severity: ChangeSeverity::Warning,
176-
summary: "The deprecated field `changelog-seen` has been removed. Using that field in `bootstrap.toml` from now on will result in breakage.",
176+
summary: "The deprecated field `changelog-seen` has been removed. Using that field in `config.toml` from now on will result in breakage.",
177177
},
178178
ChangeInfo {
179179
change_id: 124501,

0 commit comments

Comments
 (0)