Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit c32c076

Browse files
committed
Return PathFreshness::MissingUpstream from detect_[gcc|llvm]_freshness functions
1 parent 6ca2a0d commit c32c076

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

src/bootstrap/src/core/build_steps/gcc.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,10 @@ fn try_download_gcc(builder: &Builder<'_>, target: TargetSelection) -> Option<Pa
133133
None
134134
}
135135
PathFreshness::MissingUpstream => {
136-
eprintln!("No upstream commit found, GCC will *not* be downloaded");
136+
eprintln!("error: could not find commit hash for downloading GCC");
137+
eprintln!("HELP: maybe your repository history is too shallow?");
138+
eprintln!("HELP: consider disabling `download-ci-gcc`");
139+
eprintln!("HELP: or fetch enough history to include one upstream commit");
137140
None
138141
}
139142
}
@@ -295,10 +298,6 @@ fn detect_gcc_freshness(config: &crate::Config, is_git: bool) -> build_helper::g
295298
} else if let Some(info) = crate::utils::channel::read_commit_info_file(&config.src) {
296299
PathFreshness::LastModifiedUpstream { upstream: info.sha.trim().to_owned() }
297300
} else {
298-
eprintln!("error: could not find commit hash for downloading GCC");
299-
eprintln!("HELP: maybe your repository history is too shallow?");
300-
eprintln!("HELP: consider disabling `download-ci-gcc`");
301-
eprintln!("HELP: or fetch enough history to include one upstream commit");
302-
crate::exit!(1);
301+
PathFreshness::MissingUpstream
303302
}
304303
}

src/bootstrap/src/core/build_steps/llvm.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,7 @@ pub(crate) fn detect_llvm_freshness(config: &Config, is_git: bool) -> PathFreshn
188188
} else if let Some(info) = crate::utils::channel::read_commit_info_file(&config.src) {
189189
PathFreshness::LastModifiedUpstream { upstream: info.sha.trim().to_owned() }
190190
} else {
191-
eprintln!("error: could not find commit hash for downloading LLVM");
192-
eprintln!("HELP: maybe your repository history is too shallow?");
193-
eprintln!("HELP: consider disabling `download-ci-llvm`");
194-
eprintln!("HELP: or fetch enough history to include one upstream commit");
195-
crate::exit!(1);
191+
PathFreshness::MissingUpstream
196192
}
197193
}
198194

src/bootstrap/src/core/download.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,10 @@ download-rustc = false
739739
PathFreshness::LastModifiedUpstream { upstream } => upstream,
740740
PathFreshness::HasLocalModifications { upstream } => upstream,
741741
PathFreshness::MissingUpstream => {
742-
eprintln!("No upstream commit for downloading LLVM found");
742+
eprintln!("error: could not find commit hash for downloading LLVM");
743+
eprintln!("HELP: maybe your repository history is too shallow?");
744+
eprintln!("HELP: consider disabling `download-ci-llvm`");
745+
eprintln!("HELP: or fetch enough history to include one upstream commit");
743746
crate::exit!(1);
744747
}
745748
};

0 commit comments

Comments
 (0)