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(
174174 LlvmBuildStatus :: ShouldBuild ( Meta { stamp, res, out_dir, root : root. into ( ) } )
175175}
176176
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+
177185/// Detect whether LLVM sources have been modified locally or not.
178186pub ( crate ) fn detect_llvm_freshness ( config : & Config , is_git : bool ) -> PathFreshness {
179187 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 )
186189 } else if let Some ( info) = crate :: utils:: channel:: read_commit_info_file ( & config. src ) {
187190 PathFreshness :: LastModifiedUpstream { upstream : info. sha . trim ( ) . to_owned ( ) }
188191 } else {
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ use tracing::{instrument, span};
2323
2424use crate :: core:: build_steps:: compile:: CODEGEN_BACKEND_PREFIX ;
2525use crate :: core:: build_steps:: llvm;
26+ use crate :: core:: build_steps:: llvm:: LLVM_INVALIDATION_PATHS ;
2627pub use crate :: core:: config:: flags:: Subcommand ;
2728use crate :: core:: config:: flags:: { Color , Flags , Warnings } ;
2829use crate :: core:: download:: is_download_ci_available;
@@ -3105,7 +3106,7 @@ impl Config {
31053106 self . update_submodule ( "src/llvm-project" ) ;
31063107
31073108 // Check for untracked changes in `src/llvm-project`.
3108- let has_changes = self . has_changes_from_upstream ( & [ "src/llvm-project" ] ) ;
3109+ let has_changes = self . has_changes_from_upstream ( LLVM_INVALIDATION_PATHS ) ;
31093110
31103111 // Return false if there are untracked changes, otherwise check if CI LLVM is available.
31113112 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;
1111use super :: { ChangeIdWrapper , Config , RUSTC_IF_UNCHANGED_ALLOWED_PATHS } ;
1212use crate :: core:: build_steps:: clippy:: { LintConfig , get_clippy_rules_in_order} ;
1313use crate :: core:: build_steps:: llvm;
14+ use crate :: core:: build_steps:: llvm:: LLVM_INVALIDATION_PATHS ;
1415use crate :: core:: config:: { LldMode , Target , TargetSelection , TomlConfig } ;
1516
1617pub ( crate ) fn parse ( config : & str ) -> Config {
@@ -39,7 +40,7 @@ fn download_ci_llvm() {
3940
4041 let if_unchanged_config = parse ( "llvm.download-ci-llvm = \" if-unchanged\" " ) ;
4142 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 ) ;
4344
4445 assert ! (
4546 !has_changes,
You can’t perform that action at this time.
0 commit comments