Skip to content

Commit a9944be

Browse files
committed
handle channel info before handling git info
Signed-off-by: onur-ozkan <[email protected]>
1 parent 09bc03c commit a9944be

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/bootstrap/src/core/config/config.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -1668,6 +1668,14 @@ impl Config {
16681668
let mut lld_enabled = None;
16691669
let mut std_features = None;
16701670

1671+
let is_user_configured_rust_channel =
1672+
if let Some(channel) = toml.rust.as_ref().and_then(|r| r.channel.clone()) {
1673+
config.channel = channel;
1674+
true
1675+
} else {
1676+
false
1677+
};
1678+
16711679
let default = config.channel == "dev";
16721680
config.omit_git_hash = toml.rust.as_ref().and_then(|r| r.omit_git_hash).unwrap_or(default);
16731681

@@ -1685,8 +1693,6 @@ impl Config {
16851693
config.in_tree_llvm_info = GitInfo::new(false, &config.src.join("src/llvm-project"));
16861694
config.in_tree_gcc_info = GitInfo::new(false, &config.src.join("src/gcc"));
16871695

1688-
let mut is_user_configured_rust_channel = false;
1689-
16901696
if let Some(rust) = toml.rust {
16911697
let Rust {
16921698
optimize: optimize_toml,
@@ -1708,7 +1714,7 @@ impl Config {
17081714
parallel_compiler,
17091715
randomize_layout,
17101716
default_linker,
1711-
channel,
1717+
channel: _, // already handled above
17121718
description,
17131719
musl_root,
17141720
rpath,
@@ -1745,9 +1751,6 @@ impl Config {
17451751
std_features: std_features_toml,
17461752
} = rust;
17471753

1748-
is_user_configured_rust_channel = channel.is_some();
1749-
set(&mut config.channel, channel.clone());
1750-
17511754
config.download_rustc_commit =
17521755
config.download_ci_rustc_commit(download_rustc, config.llvm_assertions);
17531756

0 commit comments

Comments
 (0)