@@ -1791,8 +1791,7 @@ impl Config {
17911791 config. llvm_link_shared . set ( Some ( true ) ) ;
17921792 }
17931793 } else {
1794- config. llvm_from_ci = config. channel == "dev"
1795- && crate :: core:: build_steps:: llvm:: is_ci_llvm_available ( & config, false ) ;
1794+ config. llvm_from_ci = config. parse_download_ci_llvm ( None , false ) ;
17961795 }
17971796
17981797 if let Some ( t) = toml. target {
@@ -2337,29 +2336,30 @@ impl Config {
23372336 download_ci_llvm : Option < StringOrBool > ,
23382337 asserts : bool ,
23392338 ) -> bool {
2339+ let if_unchanged = || {
2340+ // Git is needed to track modifications here, but tarball source is not available.
2341+ // If not modified here or built through tarball source, we maintain consistency
2342+ // with '"if available"'.
2343+ if !self . rust_info . is_from_tarball ( )
2344+ && self
2345+ . last_modified_commit ( & [ "src/llvm-project" ] , "download-ci-llvm" , true )
2346+ . is_none ( )
2347+ {
2348+ // there are some untracked changes in the the given paths.
2349+ false
2350+ } else {
2351+ llvm:: is_ci_llvm_available ( & self , asserts)
2352+ }
2353+ } ;
23402354 match download_ci_llvm {
2341- None => self . channel == "dev" && llvm :: is_ci_llvm_available ( & self , asserts ) ,
2355+ None => self . channel == "dev" && if_unchanged ( ) ,
23422356 Some ( StringOrBool :: Bool ( b) ) => b,
23432357 // FIXME: "if-available" is deprecated. Remove this block later (around mid 2024)
23442358 // to not break builds between the recent-to-old checkouts.
23452359 Some ( StringOrBool :: String ( s) ) if s == "if-available" => {
23462360 llvm:: is_ci_llvm_available ( & self , asserts)
23472361 }
2348- Some ( StringOrBool :: String ( s) ) if s == "if-unchanged" => {
2349- // Git is needed to track modifications here, but tarball source is not available.
2350- // If not modified here or built through tarball source, we maintain consistency
2351- // with '"if available"'.
2352- if !self . rust_info . is_from_tarball ( )
2353- && self
2354- . last_modified_commit ( & [ "src/llvm-project" ] , "download-ci-llvm" , true )
2355- . is_none ( )
2356- {
2357- // there are some untracked changes in the the given paths.
2358- false
2359- } else {
2360- llvm:: is_ci_llvm_available ( & self , asserts)
2361- }
2362- }
2362+ Some ( StringOrBool :: String ( s) ) if s == "if-unchanged" => if_unchanged ( ) ,
23632363 Some ( StringOrBool :: String ( other) ) => {
23642364 panic ! ( "unrecognized option for download-ci-llvm: {:?}" , other)
23652365 }
0 commit comments