about summary refs log tree commit diff
path: root/src/bootstrap/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-10-02 07:41:52 +0000
committerbors <bors@rust-lang.org>2023-10-02 07:41:52 +0000
commit781ebbec8a0a2fdba7ea8113e09e21e972448d66 (patch)
treea032e307404aa3640b7b212c928df9f3d7b54dc5 /src/bootstrap/lib.rs
parent15783292e5e26336f76ddc2123d66025ec6d84b7 (diff)
parent7d3dcd918eb1f1308a1d901821ede3041d563ae9 (diff)
downloadrust-781ebbec8a0a2fdba7ea8113e09e21e972448d66.tar.gz
rust-781ebbec8a0a2fdba7ea8113e09e21e972448d66.zip
Auto merge of #115898 - onur-ozkan:config-change-tracking, r=Mark-Simulacrum
bootstrap major change detection implementation

The use of `changelog-seen` and `bootstrap/CHANGELOG.md` has not been functional in any way for many years. We often do major/breaking changes but never update the changelog file or the `changelog-seen`. This is an alternative method for tracking major or breaking changes and informing developers when such changes occur.

Example output when bootstrap detects a major change:
![image](https://github.com/rust-lang/rust/assets/39852038/ee802dfa-a02b-488b-a433-f853ce079b8a)
Diffstat (limited to 'src/bootstrap/lib.rs')
-rw-r--r--src/bootstrap/lib.rs23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 8b8d4b23795..5c78015e560 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -112,7 +112,15 @@ const LLVM_TOOLS: &[&str] = &[
 /// LLD file names for all flavors.
 const LLD_FILE_NAMES: &[&str] = &["ld.lld", "ld64.lld", "lld-link", "wasm-ld"];
 
-pub const VERSION: usize = 2;
+/// Keeps track of major changes made to the bootstrap configuration.
+///
+/// These values also represent the IDs of the PRs that caused major changes.
+/// You can visit `https://github.com/rust-lang/rust/pull/{any-id-from-the-list}` to
+/// check for more details regarding each change.
+///
+/// If you make any major changes (such as adding new values or changing default values), please
+/// ensure that the associated PR ID is added to the end of this list.
+pub const CONFIG_CHANGE_HISTORY: &[usize] = &[115898];
 
 /// Extra --check-cfg to add when building
 /// (Mode restriction, config name, config values (if any))
@@ -1844,3 +1852,16 @@ fn envify(s: &str) -> String {
         .flat_map(|c| c.to_uppercase())
         .collect()
 }
+
+pub fn find_recent_config_change_ids(current_id: usize) -> Vec<usize> {
+    let index = CONFIG_CHANGE_HISTORY
+        .iter()
+        .position(|&id| id == current_id)
+        .expect(&format!("Value `{}` was not found in `CONFIG_CHANGE_HISTORY`.", current_id));
+
+    CONFIG_CHANGE_HISTORY
+        .iter()
+        .skip(index + 1) // Skip the current_id and IDs before it
+        .cloned()
+        .collect()
+}