@@ -14,7 +14,6 @@ use std::path::{Path, PathBuf};
1414use std:: sync:: OnceLock ;
1515use std:: { env, fs} ;
1616
17- use build_helper:: ci:: CiEnv ;
1817use build_helper:: git:: get_closest_merge_commit;
1918#[ cfg( feature = "tracing" ) ]
2019use tracing:: instrument;
@@ -206,10 +205,9 @@ pub(crate) fn detect_llvm_sha(config: &Config, is_git: bool) -> String {
206205
207206/// Returns whether the CI-found LLVM is currently usable.
208207///
209- /// This checks both the build triple platform to confirm we're usable at all,
210- /// and then verifies if the current HEAD matches the detected LLVM SHA head,
211- /// in which case LLVM is indicated as not available.
212- pub ( crate ) fn is_ci_llvm_available ( config : & Config , asserts : bool ) -> bool {
208+ /// This checks the build triple platform to confirm we're usable at all, and if LLVM
209+ /// with/without assertions is available.
210+ pub ( crate ) fn is_ci_llvm_available_for_target ( config : & Config , asserts : bool ) -> bool {
213211 // This is currently all tier 1 targets and tier 2 targets with host tools
214212 // (since others may not have CI artifacts)
215213 // https://doc.rust-lang.org/rustc/platform-support.html#tier-1
@@ -254,41 +252,9 @@ pub(crate) fn is_ci_llvm_available(config: &Config, asserts: bool) -> bool {
254252 return false ;
255253 }
256254
257- if is_ci_llvm_modified ( config) {
258- eprintln ! ( "Detected LLVM as non-available: running in CI and modified LLVM in this change" ) ;
259- return false ;
260- }
261-
262255 true
263256}
264257
265- /// Returns true if we're running in CI with modified LLVM (and thus can't download it)
266- pub ( crate ) fn is_ci_llvm_modified ( config : & Config ) -> bool {
267- // If not running in a CI environment, return false.
268- if !config. is_running_on_ci {
269- return false ;
270- }
271-
272- // In rust-lang/rust managed CI, assert the existence of the LLVM submodule.
273- if CiEnv :: is_rust_lang_managed_ci_job ( ) {
274- assert ! (
275- config. in_tree_llvm_info. is_managed_git_subrepository( ) ,
276- "LLVM submodule must be fetched in rust-lang/rust managed CI builders."
277- ) ;
278- }
279- // If LLVM submodule isn't present, skip the change check as it won't work.
280- else if !config. in_tree_llvm_info . is_managed_git_subrepository ( ) {
281- return false ;
282- }
283-
284- let llvm_sha = detect_llvm_sha ( config, true ) ;
285- let head_sha = crate :: output (
286- helpers:: git ( Some ( & config. src ) ) . arg ( "rev-parse" ) . arg ( "HEAD" ) . as_command_mut ( ) ,
287- ) ;
288- let head_sha = head_sha. trim ( ) ;
289- llvm_sha == head_sha
290- }
291-
292258#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
293259pub struct Llvm {
294260 pub target : TargetSelection ,
0 commit comments