From 7fc6c019703d321bbca110a2604d3c0b1403cc38 Mon Sep 17 00:00:00 2001 From: SL <82523453+Swarnlataaa@users.noreply.github.com> Date: Tue, 30 May 2023 00:22:54 +0530 Subject: [PATCH 1/6] please consider merging --- src/bootstrap/config.rs | 27 ++++++++++++++++++++++--- src/bootstrap/defaults/config.user.toml | 2 +- src/bootstrap/setup.rs | 2 +- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 710c8b52194b4..ef757ad2e87ed 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -997,10 +997,31 @@ impl Config { include_path.push("bootstrap"); include_path.push("defaults"); include_path.push(format!("config.{}.toml", include)); - let included_toml = get_toml(&include_path); - toml.merge(included_toml); + + // Check if an alias TOML file exists + let alias_path = format!("config.{}.alias.toml", include); + let alias_toml = get_toml(&alias_path); + + // Check if the "dist" or "user" alias TOML files exist + let dist_alias_path = format!("config.dist.alias.toml"); + let dist_alias_toml = get_toml(&dist_alias_path); + + let user_alias_path = format!("config.user.alias.toml"); + let user_alias_toml = get_toml(&user_alias_path); + + // Merge the alias TOML if it exists, or the "dist" or "user" alias TOML + if alias_toml.is_some() { + toml.merge(alias_toml.unwrap()); + } else if dist_alias_toml.is_some() { + toml.merge(dist_alias_toml.unwrap()); + } else if user_alias_toml.is_some() { + toml.merge(user_alias_toml.unwrap()); + } else { + let included_toml = get_toml(&include_path); + toml.merge(included_toml); + } } - + config.changelog_seen = toml.changelog_seen; let build = toml.build.unwrap_or_default(); diff --git a/src/bootstrap/defaults/config.user.toml b/src/bootstrap/defaults/config.user.toml index 25d9e649f23c7..9af3a083c35b2 100644 --- a/src/bootstrap/defaults/config.user.toml +++ b/src/bootstrap/defaults/config.user.toml @@ -1,4 +1,4 @@ -# These defaults are meant for users and distro maintainers building from source, without intending to make multiple changes. +# These defaults are meant for dist and distro maintainers building from source, without intending to make multiple changes. [build] # When compiling from source, you almost always want a full stage 2 build, # which has all the latest optimizations from nightly. diff --git a/src/bootstrap/setup.rs b/src/bootstrap/setup.rs index 09f26862b4ab2..365316d3864f2 100644 --- a/src/bootstrap/setup.rs +++ b/src/bootstrap/setup.rs @@ -20,7 +20,7 @@ pub enum Profile { Codegen, Library, Tools, - User, + Dist, None, } From 5edd04c2eedbc818a36773831a68c860d74e6840 Mon Sep 17 00:00:00 2001 From: SL <82523453+Swarnlataaa@users.noreply.github.com> Date: Tue, 30 May 2023 00:23:36 +0530 Subject: [PATCH 2/6] #112074 --- src/bootstrap/config.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index ef757ad2e87ed..e292eaffaf907 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -1021,6 +1021,7 @@ impl Config { toml.merge(included_toml); } } + // config.changelog_seen = toml.changelog_seen; From 1027c3b95f1022801f7e287531abc5d2a455dbf2 Mon Sep 17 00:00:00 2001 From: SL <82523453+Swarnlataaa@users.noreply.github.com> Date: Tue, 30 May 2023 00:24:12 +0530 Subject: [PATCH 3/6] #error --- src/bootstrap/config.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index e292eaffaf907..ad4c4c484f3e5 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -1022,6 +1022,7 @@ impl Config { } } // + // config.changelog_seen = toml.changelog_seen; From 9abdd34f6f42ac12c6c72a21ab38d4f37ec18c11 Mon Sep 17 00:00:00 2001 From: SL <82523453+Swarnlataaa@users.noreply.github.com> Date: Tue, 30 May 2023 00:26:06 +0530 Subject: [PATCH 4/6] 994-1002 edited --- src/bootstrap/config.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index ad4c4c484f3e5..72ea4f2f47be3 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -991,12 +991,7 @@ impl Config { TomlConfig::default() }; - if let Some(include) = &toml.profile { - let mut include_path = config.src.clone(); - include_path.push("src"); - include_path.push("bootstrap"); - include_path.push("defaults"); - include_path.push(format!("config.{}.toml", include)); + // Check if an alias TOML file exists let alias_path = format!("config.{}.alias.toml", include); From d0f0ea84f1e20aa524074adab2f571dfd3d44965 Mon Sep 17 00:00:00 2001 From: SL <82523453+Swarnlataaa@users.noreply.github.com> Date: Tue, 30 May 2023 00:31:55 +0530 Subject: [PATCH 5/6] // --- src/bootstrap/config.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 72ea4f2f47be3..f92d42def0fae 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -1019,6 +1019,7 @@ impl Config { // // + config.changelog_seen = toml.changelog_seen; let build = toml.build.unwrap_or_default(); From c1120de49b0247a8587fab1523baf937a24a4831 Mon Sep 17 00:00:00 2001 From: SL <82523453+Swarnlataaa@users.noreply.github.com> Date: Tue, 30 May 2023 00:33:27 +0530 Subject: [PATCH 6/6] // --- src/bootstrap/config.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index f92d42def0fae..b2ecc639fbc92 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -991,7 +991,12 @@ impl Config { TomlConfig::default() }; - + if let Some(include) = &toml.profile { + let mut include_path = config.src.clone(); + include_path.push("src"); + include_path.push("bootstrap"); + include_path.push("defaults"); + include_path.push(format!("config.{}.toml", include)); // Check if an alias TOML file exists let alias_path = format!("config.{}.alias.toml", include);