Skip to content

Commit

Permalink
handle channel info before handling git info
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Nov 10, 2024
1 parent 09bc03c commit a9944be
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1668,6 +1668,14 @@ impl Config {
let mut lld_enabled = None;
let mut std_features = None;

let is_user_configured_rust_channel =
if let Some(channel) = toml.rust.as_ref().and_then(|r| r.channel.clone()) {
config.channel = channel;
true
} else {
false
};

let default = config.channel == "dev";
config.omit_git_hash = toml.rust.as_ref().and_then(|r| r.omit_git_hash).unwrap_or(default);

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

let mut is_user_configured_rust_channel = false;

if let Some(rust) = toml.rust {
let Rust {
optimize: optimize_toml,
Expand All @@ -1708,7 +1714,7 @@ impl Config {
parallel_compiler,
randomize_layout,
default_linker,
channel,
channel: _, // already handled above
description,
musl_root,
rpath,
Expand Down Expand Up @@ -1745,9 +1751,6 @@ impl Config {
std_features: std_features_toml,
} = rust;

is_user_configured_rust_channel = channel.is_some();
set(&mut config.channel, channel.clone());

config.download_rustc_commit =
config.download_ci_rustc_commit(download_rustc, config.llvm_assertions);

Expand Down

0 comments on commit a9944be

Please sign in to comment.