File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -892,13 +892,17 @@ def update_submodules(self):
892892 filtered_submodules = []
893893 submodules_names = []
894894 llvm_checked_out = os .path .exists (os .path .join (self .rust_root , "src/llvm-project/.git" ))
895+ external_llvm_provided = self .get_toml ('llvm-config' ) or self .downloading_llvm ()
896+ llvm_needed = not self .get_toml ('codegen-backends' , 'rust' ) \
897+ or "llvm" in self .get_toml ('codegen-backends' , 'rust' )
895898 for module in submodules :
896899 if module .endswith ("llvm-project" ):
897- # Don't sync the llvm-project submodule either if an external LLVM
898- # was provided, or if we are downloading LLVM. Also, if the
899- # submodule has been initialized already, sync it anyways so that
900- # it doesn't mess up contributor pull requests.
901- if self .get_toml ('llvm-config' ) or self .downloading_llvm ():
900+ # Don't sync the llvm-project submodule if an external LLVM was
901+ # provided, if we are downloading LLVM or if the LLVM backend is
902+ # not being built. Also, if the submodule has been initialized
903+ # already, sync it anyways so that it doesn't mess up contributor
904+ # pull requests.
905+ if external_llvm_provided or not llvm_needed :
902906 if self .get_toml ('lld' ) != 'true' and not llvm_checked_out :
903907 continue
904908 check = self .check_submodule (module , slow_submodules )
You can’t perform that action at this time.
0 commit comments