Skip to content

Commit c80a694

Browse files
author
Gimbles
committed
s/ignore_git/omit_git_hash
1 parent 9452402 commit c80a694

File tree

6 files changed

+20
-20
lines changed

6 files changed

+20
-20
lines changed

config.example.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ changelog-seen = 2
585585
# Having the git information can cause a lot of rebuilds during development.
586586
#
587587
# FIXME(#76720): this can causes bugs if different compilers reuse the same metadata cache.
588-
#ignore-git = if rust.channel == "dev" { true } else { false }
588+
#omit-git-hash = if rust.channel == "dev" { true } else { false }
589589

590590
# Whether to create a source tarball by default when running `x dist`.
591591
#

src/bootstrap/channel.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub enum GitInfo {
1919
#[default]
2020
Absent,
2121
/// This is a git repository.
22-
/// If the info should be used (`ignore_git` is false), this will be
22+
/// If the info should be used (`omit_git_hash` is false), this will be
2323
/// `Some`, otherwise it will be `None`.
2424
Present(Option<Info>),
2525
/// This is not a git repostory, but the info can be fetched from the
@@ -35,7 +35,7 @@ pub struct Info {
3535
}
3636

3737
impl GitInfo {
38-
pub fn new(ignore_git: bool, dir: &Path) -> GitInfo {
38+
pub fn new(omit_git_hash: bool, dir: &Path) -> GitInfo {
3939
// See if this even begins to look like a git dir
4040
if !dir.join(".git").exists() {
4141
match read_commit_info_file(dir) {
@@ -52,7 +52,7 @@ impl GitInfo {
5252

5353
// If we're ignoring the git info, we don't actually need to collect it, just make sure this
5454
// was a git repo in the first place.
55-
if ignore_git {
55+
if omit_git_hash {
5656
return GitInfo::Present(None);
5757
}
5858

src/bootstrap/config.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub struct Config {
7777
pub tools: Option<HashSet<String>>,
7878
pub sanitizers: bool,
7979
pub profiler: bool,
80-
pub ignore_git: bool,
80+
pub omit_git_hash: bool,
8181
pub exclude: Vec<TaskPath>,
8282
pub include_default_paths: bool,
8383
pub rustc_error_format: Option<String>,
@@ -755,7 +755,7 @@ define_config! {
755755
verbose_tests: Option<bool> = "verbose-tests",
756756
optimize_tests: Option<bool> = "optimize-tests",
757757
codegen_tests: Option<bool> = "codegen-tests",
758-
ignore_git: Option<bool> = "ignore-git",
758+
omit_git_hash: Option<bool> = "omit-git-hash",
759759
dist_src: Option<bool> = "dist-src",
760760
save_toolstates: Option<String> = "save-toolstates",
761761
codegen_backends: Option<Vec<String>> = "codegen-backends",
@@ -1088,7 +1088,7 @@ impl Config {
10881088
let mut debuginfo_level_tools = None;
10891089
let mut debuginfo_level_tests = None;
10901090
let mut optimize = None;
1091-
let mut ignore_git = None;
1091+
let mut omit_git_hash = None;
10921092

10931093
if let Some(rust) = toml.rust {
10941094
debug = rust.debug;
@@ -1109,7 +1109,7 @@ impl Config {
11091109
.map(|v| v.expect("invalid value for rust.split_debuginfo"))
11101110
.unwrap_or(SplitDebuginfo::default_for_platform(&config.build.triple));
11111111
optimize = rust.optimize;
1112-
ignore_git = rust.ignore_git;
1112+
omit_git_hash = rust.omit_git_hash;
11131113
config.rust_new_symbol_mangling = rust.new_symbol_mangling;
11141114
set(&mut config.rust_optimize_tests, rust.optimize_tests);
11151115
set(&mut config.codegen_tests, rust.codegen_tests);
@@ -1166,8 +1166,8 @@ impl Config {
11661166

11671167
// rust_info must be set before is_ci_llvm_available() is called.
11681168
let default = config.channel == "dev";
1169-
config.ignore_git = ignore_git.unwrap_or(default);
1170-
config.rust_info = GitInfo::new(config.ignore_git, &config.src);
1169+
config.omit_git_hash = omit_git_hash.unwrap_or(default);
1170+
config.rust_info = GitInfo::new(config.omit_git_hash, &config.src);
11711171

11721172
if let Some(llvm) = toml.llvm {
11731173
match llvm.ccache {

src/bootstrap/lib.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -358,14 +358,14 @@ impl Build {
358358
#[cfg(not(unix))]
359359
let is_sudo = false;
360360

361-
let ignore_git = config.ignore_git;
362-
let rust_info = channel::GitInfo::new(ignore_git, &src);
363-
let cargo_info = channel::GitInfo::new(ignore_git, &src.join("src/tools/cargo"));
361+
let omit_git_hash = config.omit_git_hash;
362+
let rust_info = channel::GitInfo::new(omit_git_hash, &src);
363+
let cargo_info = channel::GitInfo::new(omit_git_hash, &src.join("src/tools/cargo"));
364364
let rust_analyzer_info =
365-
channel::GitInfo::new(ignore_git, &src.join("src/tools/rust-analyzer"));
366-
let clippy_info = channel::GitInfo::new(ignore_git, &src.join("src/tools/clippy"));
367-
let miri_info = channel::GitInfo::new(ignore_git, &src.join("src/tools/miri"));
368-
let rustfmt_info = channel::GitInfo::new(ignore_git, &src.join("src/tools/rustfmt"));
365+
channel::GitInfo::new(omit_git_hash, &src.join("src/tools/rust-analyzer"));
366+
let clippy_info = channel::GitInfo::new(omit_git_hash, &src.join("src/tools/clippy"));
367+
let miri_info = channel::GitInfo::new(omit_git_hash, &src.join("src/tools/miri"));
368+
let rustfmt_info = channel::GitInfo::new(omit_git_hash, &src.join("src/tools/rustfmt"));
369369

370370
// we always try to use git for LLVM builds
371371
let in_tree_llvm_info = channel::GitInfo::new(false, &src.join("src/llvm-project"));
@@ -1233,7 +1233,7 @@ impl Build {
12331233
match &self.config.channel[..] {
12341234
"stable" => num.to_string(),
12351235
"beta" => {
1236-
if self.rust_info().is_managed_git_subrepository() && !self.config.ignore_git {
1236+
if self.rust_info().is_managed_git_subrepository() && !self.config.omit_git_hash {
12371237
format!("{}-beta.{}", num, self.beta_prerelease_version())
12381238
} else {
12391239
format!("{}-beta", num)

src/bootstrap/tool.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ pub fn prepare_tool_cargo(
320320
cargo.env("CFG_RELEASE_NUM", &builder.version);
321321
cargo.env("DOC_RUST_LANG_ORG_CHANNEL", builder.doc_rust_lang_org_channel());
322322

323-
let info = GitInfo::new(builder.config.ignore_git, &dir);
323+
let info = GitInfo::new(builder.config.omit_git_hash, &dir);
324324
if let Some(sha) = info.sha() {
325325
cargo.env("CFG_COMMIT_HASH", sha);
326326
}

src/ci/docker/host-x86_64/x86_64-gnu-distcheck/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ RUN sh /scripts/sccache.sh
2424
# We are disabling CI LLVM since distcheck is an offline build.
2525
ENV NO_DOWNLOAD_CI_LLVM 1
2626

27-
ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu --set rust.ignore-git=false
27+
ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu --set rust.omit-git-hash=false
2828
ENV SCRIPT python3 ../x.py --stage 2 test distcheck
2929
ENV DIST_SRC 1

0 commit comments

Comments
 (0)