diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs index 67cde01ccdb63..055accce583d1 100644 --- a/src/bootstrap/src/core/config/config.rs +++ b/src/bootstrap/src/core/config/config.rs @@ -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() {