File tree Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Expand file tree Collapse file tree 3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -174,15 +174,18 @@ pub fn prebuilt_llvm_config(
174
174
LlvmBuildStatus :: ShouldBuild ( Meta { stamp, res, out_dir, root : root. into ( ) } )
175
175
}
176
176
177
+ /// Paths whose changes invalidate LLVM downloads.
178
+ pub const LLVM_INVALIDATION_PATHS : & [ & str ] = & [
179
+ "src/llvm-project" ,
180
+ "src/bootstrap/download-ci-llvm-stamp" ,
181
+ // the LLVM shared object file is named `LLVM-<LLVM-version>-rust-{version}-nightly`
182
+ "src/version" ,
183
+ ] ;
184
+
177
185
/// Detect whether LLVM sources have been modified locally or not.
178
186
pub ( crate ) fn detect_llvm_freshness ( config : & Config , is_git : bool ) -> PathFreshness {
179
187
if is_git {
180
- config. check_path_modifications ( & [
181
- "src/llvm-project" ,
182
- "src/bootstrap/download-ci-llvm-stamp" ,
183
- // the LLVM shared object file is named `LLVM-12-rust-{version}-nightly`
184
- "src/version" ,
185
- ] )
188
+ config. check_path_modifications ( LLVM_INVALIDATION_PATHS )
186
189
} else if let Some ( info) = crate :: utils:: channel:: read_commit_info_file ( & config. src ) {
187
190
PathFreshness :: LastModifiedUpstream { upstream : info. sha . trim ( ) . to_owned ( ) }
188
191
} else {
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ use tracing::{instrument, span};
23
23
24
24
use crate :: core:: build_steps:: compile:: CODEGEN_BACKEND_PREFIX ;
25
25
use crate :: core:: build_steps:: llvm;
26
+ use crate :: core:: build_steps:: llvm:: LLVM_INVALIDATION_PATHS ;
26
27
pub use crate :: core:: config:: flags:: Subcommand ;
27
28
use crate :: core:: config:: flags:: { Color , Flags , Warnings } ;
28
29
use crate :: core:: download:: is_download_ci_available;
@@ -3108,7 +3109,7 @@ impl Config {
3108
3109
self . update_submodule ( "src/llvm-project" ) ;
3109
3110
3110
3111
// Check for untracked changes in `src/llvm-project`.
3111
- let has_changes = self . has_changes_from_upstream ( & [ "src/llvm-project" ] ) ;
3112
+ let has_changes = self . has_changes_from_upstream ( LLVM_INVALIDATION_PATHS ) ;
3112
3113
3113
3114
// Return false if there are untracked changes, otherwise check if CI LLVM is available.
3114
3115
if has_changes { false } else { llvm:: is_ci_llvm_available ( self , asserts) }
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ use super::flags::Flags;
11
11
use super :: { ChangeIdWrapper , Config , RUSTC_IF_UNCHANGED_ALLOWED_PATHS } ;
12
12
use crate :: core:: build_steps:: clippy:: { LintConfig , get_clippy_rules_in_order} ;
13
13
use crate :: core:: build_steps:: llvm;
14
+ use crate :: core:: build_steps:: llvm:: LLVM_INVALIDATION_PATHS ;
14
15
use crate :: core:: config:: { LldMode , Target , TargetSelection , TomlConfig } ;
15
16
16
17
pub ( crate ) fn parse ( config : & str ) -> Config {
@@ -39,7 +40,7 @@ fn download_ci_llvm() {
39
40
40
41
let if_unchanged_config = parse ( "llvm.download-ci-llvm = \" if-unchanged\" " ) ;
41
42
if if_unchanged_config. llvm_from_ci {
42
- let has_changes = if_unchanged_config. has_changes_from_upstream ( & [ "src/llvm-project" ] ) ;
43
+ let has_changes = if_unchanged_config. has_changes_from_upstream ( LLVM_INVALIDATION_PATHS ) ;
43
44
44
45
assert ! (
45
46
!has_changes,
You can’t perform that action at this time.
0 commit comments