@@ -14,7 +14,6 @@ use std::path::{Path, PathBuf};
14
14
use std:: sync:: OnceLock ;
15
15
use std:: { env, fs} ;
16
16
17
- use build_helper:: ci:: CiEnv ;
18
17
use build_helper:: git:: get_closest_merge_commit;
19
18
#[ cfg( feature = "tracing" ) ]
20
19
use tracing:: instrument;
@@ -206,10 +205,9 @@ pub(crate) fn detect_llvm_sha(config: &Config, is_git: bool) -> String {
206
205
207
206
/// Returns whether the CI-found LLVM is currently usable.
208
207
///
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 {
213
211
// This is currently all tier 1 targets and tier 2 targets with host tools
214
212
// (since others may not have CI artifacts)
215
213
// 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 {
254
252
return false ;
255
253
}
256
254
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
-
262
255
true
263
256
}
264
257
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
-
292
258
#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
293
259
pub struct Llvm {
294
260
pub target : TargetSelection ,
0 commit comments