about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-03-24 07:25:53 +0000
committerbors <bors@rust-lang.org>2025-03-24 07:25:53 +0000
commitb95aac6a98e43ee9d47cd05cb2d476610c51dcb7 (patch)
tree72fb4faf2fe2655ddd442b959c8aa6ce203bebef
parentae8ab87de4d8caab5d91a027bc19bb5d5e8a3691 (diff)
parentc71569a765fdd9364ea215ae01442a026e127ab9 (diff)
downloadrust-b95aac6a98e43ee9d47cd05cb2d476610c51dcb7.tar.gz
rust-b95aac6a98e43ee9d47cd05cb2d476610c51dcb7.zip
Auto merge of #138878 - jieyouxu:revert-ci-llvm, r=dianqk
Revert "fix download-llvm logic for subtree sync branches #137593"

Reverts #137593.

Looks like unfortunately the `--diff-merges=first-parent` flag is a `git show`-only flag, not `git rev-list` which only accepts `--first-parent`.

See https://git-scm.com/docs/git-rev-list#Documentation/git-rev-list.txt---first-parent which has `--first-parent`, versus https://git-scm.com/docs/git-show#Documentation/git-show.txt---diff-mergesltformatgt which has `--diff-merges=first-parent`.

This reverts commit 95994f94ff5c9335426af4dec19afb5024f82fab, reversing changes made to 7290b04b0a46de2118968aa556bfc0970aac6661.

This will unfortunately re-open https://github.com/rust-lang/rust/issues/101907 but that isn't fixed anyway since the git invocation is broken.

cc `@RalfJung` `@Mark-Simulacrum` for FYI (but I would've written the same incorrect flag 💀)
r? `@onur-ozkan` (or bootstrap or infra or anyone really)
-rw-r--r--src/build_helper/src/git.rs10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/build_helper/src/git.rs b/src/build_helper/src/git.rs
index f47d5663fc9..693e0fc8f46 100644
--- a/src/build_helper/src/git.rs
+++ b/src/build_helper/src/git.rs
@@ -140,7 +140,6 @@ pub fn get_closest_merge_commit(
             //    cd \"/checkout\" && \"git\" \"merge-base\" \"origin/master\" \"HEAD\"\nexpected success, got: exit status: 1\n"
             // ```
             // Investigate and resolve this issue instead of skipping it like this.
-            // NOTE (2025-03): this is probably caused by CI using a sparse checkout.
             (channel == "nightly" || !CiEnv::is_rust_lang_managed_ci_job())
         {
             git_upstream_merge_base(config, git_dir).unwrap()
@@ -151,18 +150,11 @@ pub fn get_closest_merge_commit(
         }
     };
 
-    // Now that rust-lang/rust is the only repo using bors, we can search the entire
-    // history for a bors commit, not just "first parents". This is crucial to make
-    // this logic work when the user has currently checked out a subtree sync branch.
-    // At the same time, we use this logic in CI where only a tiny part of the history
-    // is even checked out, making this kind of history search very fragile. It turns
-    // out that by adding `--diff-merges=first-parent`, we get a usable reply
-    // even for sparse checkouts: it will just return the most recent bors commit.
     git.args([
         "rev-list",
         &format!("--author={}", config.git_merge_commit_email),
         "-n1",
-        "--diff-merges=first-parent",
+        "--first-parent",
         &merge_base,
     ]);