mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Rollup merge of #136467 - onur-ozkan:override-default-profile-on-tarballs, r=jieyouxu
override default config profile on tarballs
This is the same logic used in the Python script 613bdd4997/src/bootstrap/bootstrap.py (L1273-L1274)
This commit is contained in:
commit
f65c6afcec
@ -700,7 +700,7 @@ trait Merge {
|
||||
impl Merge for TomlConfig {
|
||||
fn merge(
|
||||
&mut self,
|
||||
TomlConfig { build, install, llvm, rust, dist, target, profile: _, change_id }: Self,
|
||||
TomlConfig { build, install, llvm, rust, dist, target, profile, change_id }: Self,
|
||||
replace: ReplaceOpt,
|
||||
) {
|
||||
fn do_merge<T: Merge>(x: &mut Option<T>, y: Option<T>, replace: ReplaceOpt) {
|
||||
@ -712,7 +712,10 @@ impl Merge for TomlConfig {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.change_id.inner.merge(change_id.inner, replace);
|
||||
self.profile.merge(profile, replace);
|
||||
|
||||
do_merge(&mut self.build, build, replace);
|
||||
do_merge(&mut self.install, install, replace);
|
||||
do_merge(&mut self.llvm, llvm, replace);
|
||||
@ -1505,6 +1508,10 @@ impl Config {
|
||||
build.cargo = build.cargo.take().or(std::env::var_os("CARGO").map(|p| p.into()));
|
||||
}
|
||||
|
||||
if GitInfo::new(false, &config.src).is_from_tarball() && toml.profile.is_none() {
|
||||
toml.profile = Some("dist".into());
|
||||
}
|
||||
|
||||
if let Some(include) = &toml.profile {
|
||||
// Allows creating alias for profile names, allowing
|
||||
// profiles to be renamed while maintaining back compatibility
|
||||
|
Loading…
Reference in New Issue
Block a user