Skip to content

Commit feff24e

Browse files
committed
print the change warnings once for per id
Signed-off-by: onur-ozkan <[email protected]>
1 parent d8dbf7c commit feff24e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/bootstrap/src/bin/main.rs

+10
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,19 @@ fn check_version(config: &Config) -> Option<String> {
109109
}
110110

111111
let latest_config_id = CONFIG_CHANGE_HISTORY.last().unwrap();
112+
let warned_id_path = config.out.join("bootstrap").join(".last-warned-change-id");
113+
112114
if let Some(id) = config.change_id {
113115
if &id == latest_config_id {
114116
return None;
115117
}
116118

119+
if let Ok(last_warned_id) = fs::read_to_string(&warned_id_path) {
120+
if id.to_string() == last_warned_id {
121+
return None;
122+
}
123+
}
124+
117125
let change_links: Vec<String> = find_recent_config_change_ids(id)
118126
.iter()
119127
.map(|id| format!("https://github.com/rust-lang/rust/pull/{id}"))
@@ -132,6 +140,8 @@ fn check_version(config: &Config) -> Option<String> {
132140
msg.push_str(&format!(
133141
"update `config.toml` to use `change-id = {latest_config_id}` instead"
134142
));
143+
144+
t!(fs::write(warned_id_path, id.to_string()));
135145
}
136146
} else {
137147
msg.push_str("WARNING: The `change-id` is missing in the `config.toml`. This means that you will not be able to track the major changes made to the bootstrap configurations.\n");

0 commit comments

Comments
 (0)