diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-09-11 20:04:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-11 20:04:24 +0200 |
| commit | ff4b3d4780f4961297a223673e88dd73e504b25c (patch) | |
| tree | f583dad990155c9f0adaf54b638a7550dc231e36 /src/tools/compiletest | |
| parent | 5107ff43229b3e0f3c9ebcc3796c90e3497598cb (diff) | |
| parent | 5f327176492e3ef66d8140fb771d77bc2b5eebac (diff) | |
| download | rust-ff4b3d4780f4961297a223673e88dd73e504b25c.tar.gz rust-ff4b3d4780f4961297a223673e88dd73e504b25c.zip | |
Rollup merge of #130161 - onur-ozkan:fmt-changed-files, r=Kobzol,RalfJung
refactor merge base logic and fix `x fmt` When remote upstream is not configured, using [get_git_modified_files](https://github.com/rust-lang/rust/blob/38e3a5771cefc9362976a605549f8b04d5707311/src/tools/build_helper/src/git.rs#L114) to find modified files fails because [get_rust_lang_rust_remote](https://github.com/rust-lang/rust/blob/38e3a5771cefc9362976a605549f8b04d5707311/src/tools/build_helper/src/git.rs#L46-L48) can not resolve "rust-lang/rust" from the git output. The changes in this PR makes bootstrap to find the latest bors commit, treating it as the "closest upstream commit" so that the change tracker logic can use it to find the diffs. In addition, [skips formatting](https://github.com/rust-lang/rust/commit/e3924544832668a6e239153a90d3be2077fbdce4) if there are no modified files. Fixes #130147
Diffstat (limited to 'src/tools/compiletest')
| -rw-r--r-- | src/tools/compiletest/src/common.rs | 7 | ||||
| -rw-r--r-- | src/tools/compiletest/src/header/tests.rs | 1 | ||||
| -rw-r--r-- | src/tools/compiletest/src/lib.rs | 9 |
3 files changed, 15 insertions, 2 deletions
diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index 773d795f75a..5c18179b6fe 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -384,6 +384,7 @@ pub struct Config { // Needed both to construct build_helper::git::GitConfig pub git_repository: String, pub nightly_branch: String, + pub git_merge_commit_email: String, /// True if the profiler runtime is enabled for this target. /// Used by the "needs-profiler-support" header in test files. @@ -461,7 +462,11 @@ impl Config { } pub fn git_config(&self) -> GitConfig<'_> { - GitConfig { git_repository: &self.git_repository, nightly_branch: &self.nightly_branch } + GitConfig { + git_repository: &self.git_repository, + nightly_branch: &self.nightly_branch, + git_merge_commit_email: &self.git_merge_commit_email, + } } } diff --git a/src/tools/compiletest/src/header/tests.rs b/src/tools/compiletest/src/header/tests.rs index 29e11e77f1c..3a9a7eb9118 100644 --- a/src/tools/compiletest/src/header/tests.rs +++ b/src/tools/compiletest/src/header/tests.rs @@ -148,6 +148,7 @@ impl ConfigBuilder { self.target.as_deref().unwrap_or("x86_64-unknown-linux-gnu"), "--git-repository=", "--nightly-branch=", + "--git-merge-commit-email=", ]; let mut args: Vec<String> = args.iter().map(ToString::to_string).collect(); diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs index 33687a3dad3..5fe73a0e297 100644 --- a/src/tools/compiletest/src/lib.rs +++ b/src/tools/compiletest/src/lib.rs @@ -163,7 +163,13 @@ pub fn parse_config(args: Vec<String>) -> Config { ) .optopt("", "edition", "default Rust edition", "EDITION") .reqopt("", "git-repository", "name of the git repository", "ORG/REPO") - .reqopt("", "nightly-branch", "name of the git branch for nightly", "BRANCH"); + .reqopt("", "nightly-branch", "name of the git branch for nightly", "BRANCH") + .reqopt( + "", + "git-merge-commit-email", + "email address used for finding merge commits", + "EMAIL", + ); let (argv0, args_) = args.split_first().unwrap(); if args.len() == 1 || args[1] == "-h" || args[1] == "--help" { @@ -346,6 +352,7 @@ pub fn parse_config(args: Vec<String>) -> Config { git_repository: matches.opt_str("git-repository").unwrap(), nightly_branch: matches.opt_str("nightly-branch").unwrap(), + git_merge_commit_email: matches.opt_str("git-merge-commit-email").unwrap(), profiler_support: matches.opt_present("profiler-support"), } |
