Skip to content

Commit

Permalink
handle last-commit in Config::download_ci_rustc_commit for CI
Browse files Browse the repository at this point in the history
Signed-off-by: onur-ozkan <[email protected]>
  • Loading branch information
onur-ozkan committed Apr 4, 2024
1 parent 9b8b66e commit d7edc43
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2418,13 +2418,16 @@ impl Config {
let compiler = format!("{top_level}/compiler/");
let library = format!("{top_level}/library/");

// If we are running in CI, the current commit will never have artifacts already built.
let tip_commit = if CiEnv::is_ci() { "HEAD^" } else { "HEAD" };

// Look for a version to compare to based on the current commit.
// Only commits merged by bors will have CI artifacts.
let merge_base = output(
self.git()
.arg("rev-list")
.arg(format!("--author={}", self.stage0_metadata.config.git_merge_commit_email))
.args(["-n1", "--first-parent", "HEAD"]),
.args(["-n1", "--first-parent", tip_commit]),
);
let commit = merge_base.trim_end();
if commit.is_empty() {
Expand Down

0 comments on commit d7edc43

Please sign in to comment.