diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 41aca0210f677..a76a0f997ccee 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -1062,6 +1062,35 @@ impl Config { 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); + 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); + } + } + + + + let included_toml = get_toml(&include_path); toml.merge(included_toml, ReplaceOpt::IgnoreDuplicate); } @@ -1097,7 +1126,7 @@ impl Config { crate::detail_exit(2) } toml.merge(override_toml, ReplaceOpt::Override); - + master 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, }