Skip to content

Commit d7edc43

Browse files
committed
handle last-commit in Config::download_ci_rustc_commit for CI
Signed-off-by: onur-ozkan <[email protected]>
1 parent 9b8b66e commit d7edc43

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -2418,13 +2418,16 @@ impl Config {
24182418
let compiler = format!("{top_level}/compiler/");
24192419
let library = format!("{top_level}/library/");
24202420

2421+
// If we are running in CI, the current commit will never have artifacts already built.
2422+
let tip_commit = if CiEnv::is_ci() { "HEAD^" } else { "HEAD" };
2423+
24212424
// Look for a version to compare to based on the current commit.
24222425
// Only commits merged by bors will have CI artifacts.
24232426
let merge_base = output(
24242427
self.git()
24252428
.arg("rev-list")
24262429
.arg(format!("--author={}", self.stage0_metadata.config.git_merge_commit_email))
2427-
.args(["-n1", "--first-parent", "HEAD"]),
2430+
.args(["-n1", "--first-parent", tip_commit]),
24282431
);
24292432
let commit = merge_base.trim_end();
24302433
if commit.is_empty() {

0 commit comments

Comments
 (0)