about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-03-24 09:11:54 +0100
committerJakub Beránek <berykubik@gmail.com>2025-04-20 09:35:42 +0200
commitc32c076f346cdc8a4adbd72ac55b64a636b08b45 (patch)
treee454ad625fa23bb63e2b939b733822cfc10cf335
parent6ca2a0dd26f2bea3cb681cc98fbc92f34e85209b (diff)
downloadrust-c32c076f346cdc8a4adbd72ac55b64a636b08b45.tar.gz
rust-c32c076f346cdc8a4adbd72ac55b64a636b08b45.zip
Return `PathFreshness::MissingUpstream` from `detect_[gcc|llvm]_freshness` functions
-rw-r--r--src/bootstrap/src/core/build_steps/gcc.rs11
-rw-r--r--src/bootstrap/src/core/build_steps/llvm.rs6
-rw-r--r--src/bootstrap/src/core/download.rs5
3 files changed, 10 insertions, 12 deletions
diff --git a/src/bootstrap/src/core/build_steps/gcc.rs b/src/bootstrap/src/core/build_steps/gcc.rs
index 339eec18406..ee8bd8286da 100644
--- a/src/bootstrap/src/core/build_steps/gcc.rs
+++ b/src/bootstrap/src/core/build_steps/gcc.rs
@@ -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
     }
 }
diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs
index 1a6247c42d7..86af956535e 100644
--- a/src/bootstrap/src/core/build_steps/llvm.rs
+++ b/src/bootstrap/src/core/build_steps/llvm.rs
@@ -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
     }
 }
 
diff --git a/src/bootstrap/src/core/download.rs b/src/bootstrap/src/core/download.rs
index 57a674c1dd7..b95d07356c1 100644
--- a/src/bootstrap/src/core/download.rs
+++ b/src/bootstrap/src/core/download.rs
@@ -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);
             }
         };