Skip to content

rustbuild: Set ignore-git based on channel #43873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bootstrap/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct Info {
impl GitInfo {
pub fn new(config: &Config, dir: &Path) -> GitInfo {
// See if this even begins to look like a git dir
if config.ignore_git || !dir.join(".git").exists() {
if config.ignore_git == Some(true) || !dir.join(".git").exists() {
return GitInfo { inner: None }
}

Expand Down
9 changes: 6 additions & 3 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub struct Config {
pub extended: bool,
pub sanitizers: bool,
pub profiler: bool,
pub ignore_git: bool,
pub ignore_git: Option<bool>,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should make this an optional -- I've been trying to make Config as much a "source of truth" as possible without needing interpretation outside this file. We can save rust.ignore_git to a variable when loading and process the logic here.


pub run_host_only: bool,

Expand Down Expand Up @@ -296,7 +296,6 @@ impl Config {
config.rust_codegen_units = 1;
config.channel = "dev".to_string();
config.codegen_tests = true;
config.ignore_git = false;
config.rust_dist_src = true;

config.on_fail = flags.on_fail;
Expand Down Expand Up @@ -419,7 +418,7 @@ impl Config {
set(&mut config.use_jemalloc, rust.use_jemalloc);
set(&mut config.backtrace, rust.backtrace);
set(&mut config.channel, rust.channel.clone());
set(&mut config.ignore_git, rust.ignore_git);
config.ignore_git = rust.ignore_git;
config.rustc_default_linker = rust.default_linker.clone();
config.rustc_default_ar = rust.default_ar.clone();
config.musl_root = rust.musl_root.clone().map(PathBuf::from);
Expand Down Expand Up @@ -478,6 +477,10 @@ impl Config {
config.update_with_config_mk();
}

if config.channel == "dev" && config.ignore_git.is_none() {
config.ignore_git = Some(true);
}

config
}

Expand Down