diff options
| author | onur-ozkan <work@onurozkan.dev> | 2023-11-11 16:20:06 +0300 |
|---|---|---|
| committer | onur-ozkan <work@onurozkan.dev> | 2023-11-11 18:47:32 +0300 |
| commit | 056d4e4c51dce1fddb1773e5a523525b8fd24d65 (patch) | |
| tree | abbb15a08f34d6c63daf9f8de855e89f56fa6cb9 | |
| parent | 1db4b12494f698754b925f55061eb9e6b3241423 (diff) | |
| download | rust-056d4e4c51dce1fddb1773e5a523525b8fd24d65.tar.gz rust-056d4e4c51dce1fddb1773e5a523525b8fd24d65.zip | |
print the change warnings once for per id
Signed-off-by: onur-ozkan <work@onurozkan.dev>
| -rw-r--r-- | src/bootstrap/src/bin/main.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/bootstrap/src/bin/main.rs b/src/bootstrap/src/bin/main.rs index 0a6072ae1a5..1cbe3991abf 100644 --- a/src/bootstrap/src/bin/main.rs +++ b/src/bootstrap/src/bin/main.rs @@ -109,11 +109,19 @@ fn check_version(config: &Config) -> Option<String> { } let latest_config_id = CONFIG_CHANGE_HISTORY.last().unwrap(); + let warned_id_path = config.out.join("bootstrap").join(".last-warned-change-id"); + if let Some(id) = config.change_id { if &id == latest_config_id { return None; } + if let Ok(last_warned_id) = fs::read_to_string(&warned_id_path) { + if id.to_string() == last_warned_id { + return None; + } + } + let change_links: Vec<String> = find_recent_config_change_ids(id) .iter() .map(|id| format!("https://github.com/rust-lang/rust/pull/{id}")) @@ -132,6 +140,8 @@ fn check_version(config: &Config) -> Option<String> { msg.push_str(&format!( "update `config.toml` to use `change-id = {latest_config_id}` instead" )); + + t!(fs::write(warned_id_path, id.to_string())); } } else { 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"); |
