Return PathFreshness::MissingUpstream from detect_[gcc|llvm]_freshness functions

This commit is contained in:
Jakub Beránek 2025-03-24 09:11:54 +01:00
parent 6ca2a0dd26
commit c32c076f34
3 changed files with 10 additions and 12 deletions

View file

@ -133,7 +133,10 @@ fn try_download_gcc(builder: &Builder<'_>, target: TargetSelection) -> Option<Pa
None
}
PathFreshness::MissingUpstream => {
eprintln!("No upstream commit found, GCC will *not* be downloaded");
eprintln!("error: could not find commit hash for downloading GCC");
eprintln!("HELP: maybe your repository history is too shallow?");
eprintln!("HELP: consider disabling `download-ci-gcc`");
eprintln!("HELP: or fetch enough history to include one upstream commit");
None
}
}
@ -295,10 +298,6 @@ fn detect_gcc_freshness(config: &crate::Config, is_git: bool) -> build_helper::g
} else if let Some(info) = crate::utils::channel::read_commit_info_file(&config.src) {
PathFreshness::LastModifiedUpstream { upstream: info.sha.trim().to_owned() }
} else {
eprintln!("error: could not find commit hash for downloading GCC");
eprintln!("HELP: maybe your repository history is too shallow?");
eprintln!("HELP: consider disabling `download-ci-gcc`");
eprintln!("HELP: or fetch enough history to include one upstream commit");
crate::exit!(1);
PathFreshness::MissingUpstream
}
}

View file

@ -188,11 +188,7 @@ pub(crate) fn detect_llvm_freshness(config: &Config, is_git: bool) -> PathFreshn
} else if let Some(info) = crate::utils::channel::read_commit_info_file(&config.src) {
PathFreshness::LastModifiedUpstream { upstream: info.sha.trim().to_owned() }
} else {
eprintln!("error: could not find commit hash for downloading LLVM");
eprintln!("HELP: maybe your repository history is too shallow?");
eprintln!("HELP: consider disabling `download-ci-llvm`");
eprintln!("HELP: or fetch enough history to include one upstream commit");
crate::exit!(1);
PathFreshness::MissingUpstream
}
}

View file

@ -739,7 +739,10 @@ download-rustc = false
PathFreshness::LastModifiedUpstream { upstream } => upstream,
PathFreshness::HasLocalModifications { upstream } => upstream,
PathFreshness::MissingUpstream => {
eprintln!("No upstream commit for downloading LLVM found");
eprintln!("error: could not find commit hash for downloading LLVM");
eprintln!("HELP: maybe your repository history is too shallow?");
eprintln!("HELP: consider disabling `download-ci-llvm`");
eprintln!("HELP: or fetch enough history to include one upstream commit");
crate::exit!(1);
}
};