Skip to content

Commit 4b7c63b

Browse files
committed
Simplify GitConfig
1 parent 0f258ca commit 4b7c63b

File tree

10 files changed

+6
-37
lines changed

10 files changed

+6
-37
lines changed

src/bootstrap/src/core/build_steps/suggest.rs

-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ pub fn suggest(builder: &Builder<'_>, run: bool) {
1313
let git_config = builder.config.git_config();
1414
let suggestions = builder
1515
.tool_cmd(Tool::SuggestTests)
16-
.env("SUGGEST_TESTS_GIT_REPOSITORY", git_config.git_repository)
17-
.env("SUGGEST_TESTS_NIGHTLY_BRANCH", git_config.nightly_branch)
1816
.env("SUGGEST_TESTS_MERGE_COMMIT_EMAIL", git_config.git_merge_commit_email)
1917
.run_capture_stdout(builder)
2018
.stdout();

src/bootstrap/src/core/build_steps/test.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2077,8 +2077,6 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
20772077
}
20782078

20792079
let git_config = builder.config.git_config();
2080-
cmd.arg("--git-repository").arg(git_config.git_repository);
2081-
cmd.arg("--nightly-branch").arg(git_config.nightly_branch);
20822080
cmd.arg("--git-merge-commit-email").arg(git_config.git_merge_commit_email);
20832081
cmd.force_coloring_in_ci();
20842082

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -2801,11 +2801,7 @@ impl Config {
28012801
}
28022802

28032803
pub fn git_config(&self) -> GitConfig<'_> {
2804-
GitConfig {
2805-
git_repository: &self.stage0_metadata.config.git_repository,
2806-
nightly_branch: &self.stage0_metadata.config.nightly_branch,
2807-
git_merge_commit_email: &self.stage0_metadata.config.git_merge_commit_email,
2808-
}
2804+
GitConfig { git_merge_commit_email: &self.stage0_metadata.config.git_merge_commit_email }
28092805
}
28102806

28112807
/// Given a path to the directory of a submodule, update it.

src/bootstrap/src/lib.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1579,10 +1579,7 @@ Executed at: {executed_at}"#,
15791579
.arg("rev-list")
15801580
.arg("--count")
15811581
.arg("--merges")
1582-
.arg(format!(
1583-
"refs/remotes/origin/{}..HEAD",
1584-
self.config.stage0_metadata.config.nightly_branch
1585-
))
1582+
.arg("refs/remotes/origin/master..HEAD")
15861583
.run_always()
15871584
.run_capture(self)
15881585
.stdout()

src/build_helper/src/git.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ use std::process::{Command, Stdio};
77
use crate::ci::CiEnv;
88

99
pub struct GitConfig<'a> {
10-
pub git_repository: &'a str,
11-
pub nightly_branch: &'a str,
1210
pub git_merge_commit_email: &'a str,
1311
}
1412

src/build_helper/src/stage0_parser.rs

-4
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ pub struct Stage0Config {
2020
pub artifacts_server: String,
2121
pub artifacts_with_llvm_assertions_server: String,
2222
pub git_merge_commit_email: String,
23-
pub git_repository: String,
24-
pub nightly_branch: String,
2523
}
2624

2725
pub fn parse_stage0_file() -> Stage0 {
@@ -49,8 +47,6 @@ pub fn parse_stage0_file() -> Stage0 {
4947
stage0.config.artifacts_with_llvm_assertions_server = value.to_owned()
5048
}
5149
"git_merge_commit_email" => stage0.config.git_merge_commit_email = value.to_owned(),
52-
"git_repository" => stage0.config.git_repository = value.to_owned(),
53-
"nightly_branch" => stage0.config.nightly_branch = value.to_owned(),
5450

5551
"compiler_date" => stage0.compiler.date = value.to_owned(),
5652
"compiler_version" => stage0.compiler.version = value.to_owned(),

src/stage0

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ dist_server=https://static.rust-lang.org
22
artifacts_server=https://ci-artifacts.rust-lang.org/rustc-builds
33
artifacts_with_llvm_assertions_server=https://ci-artifacts.rust-lang.org/rustc-builds-alt
44
5-
git_repository=rust-lang/rust
6-
nightly_branch=master
75

86
# The configuration above this comment is editable, and can be changed
97
# by forks of the repository if they have alternate values.
@@ -478,4 +476,4 @@ dist/2025-02-18/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz=e63d13a6acd596ebfd
478476
dist/2025-02-18/rustc-nightly-x86_64-unknown-linux-musl.tar.gz=b7bee098c32b321551f68e96e002f85e3a0323c864aa7f65641a58ae24f4238e
479477
dist/2025-02-18/rustc-nightly-x86_64-unknown-linux-musl.tar.xz=e5c22c2fab89c7ba548b11104c54e8f82cafb1979ba73a318682bb10ed9e4fb9
480478
dist/2025-02-18/rustc-nightly-x86_64-unknown-netbsd.tar.gz=7bf40bffe95437244f6f8a5fde69499f42d2b716e166115530fbcdbdcd837887
481-
dist/2025-02-18/rustc-nightly-x86_64-unknown-netbsd.tar.xz=0adeaa382f289233ffc9229e116a340ac03a861f0fdbb5bd35aaf5d0d7370877
479+
dist/2025-02-18/rustc-nightly-x86_64-unknown-netbsd.tar.xz=0adeaa382f289233ffc9229e116a340ac03a861f0fdbb5bd35aaf5d0d7370877

src/tools/compiletest/src/common.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -397,9 +397,7 @@ pub struct Config {
397397

398398
pub nocapture: bool,
399399

400-
// Needed both to construct build_helper::git::GitConfig
401-
pub git_repository: String,
402-
pub nightly_branch: String,
400+
// Needed to construct build_helper::git::GitConfig
403401
pub git_merge_commit_email: String,
404402

405403
/// True if the profiler runtime is enabled for this target.
@@ -499,11 +497,7 @@ impl Config {
499497
}
500498

501499
pub fn git_config(&self) -> GitConfig<'_> {
502-
GitConfig {
503-
git_repository: &self.git_repository,
504-
nightly_branch: &self.nightly_branch,
505-
git_merge_commit_email: &self.git_merge_commit_email,
506-
}
500+
GitConfig { git_merge_commit_email: &self.git_merge_commit_email }
507501
}
508502

509503
pub fn has_subprocess_support(&self) -> bool {

src/tools/compiletest/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,6 @@ pub fn parse_config(args: Vec<String>) -> Config {
424424

425425
nocapture: matches.opt_present("no-capture"),
426426

427-
git_repository: matches.opt_str("git-repository").unwrap(),
428-
nightly_branch: matches.opt_str("nightly-branch").unwrap(),
429427
git_merge_commit_email: matches.opt_str("git-merge-commit-email").unwrap(),
430428

431429
profiler_runtime: matches.opt_present("profiler-runtime"),

src/tools/suggest-tests/src/main.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@ use suggest_tests::get_suggestions;
55

66
fn main() -> ExitCode {
77
let modified_files = get_git_modified_files(
8-
&GitConfig {
9-
git_repository: &env("SUGGEST_TESTS_GIT_REPOSITORY"),
10-
nightly_branch: &env("SUGGEST_TESTS_NIGHTLY_BRANCH"),
11-
git_merge_commit_email: &env("SUGGEST_TESTS_MERGE_COMMIT_EMAIL"),
12-
},
8+
&GitConfig { git_merge_commit_email: &env("SUGGEST_TESTS_MERGE_COMMIT_EMAIL") },
139
None,
1410
&Vec::new(),
1511
);

0 commit comments

Comments
 (0)