File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -998,6 +998,10 @@ def update_submodules(self):
998
998
"library/backtrace" ,
999
999
"library/stdarch"
1000
1000
]
1001
+ # If build.vendor is set in config.toml, we must update rust-analyzer also.
1002
+ # Otherwise, the bootstrap will fail (#96456).
1003
+ if self .use_vendored_sources :
1004
+ submodules .append ("src/tools/rust-analyzer" )
1001
1005
filtered_submodules = []
1002
1006
submodules_names = []
1003
1007
for module in submodules :
Original file line number Diff line number Diff line change @@ -609,14 +609,19 @@ impl Build {
609
609
/// This avoids contributors checking in a submodule change by accident.
610
610
pub fn maybe_update_submodules ( & self ) {
611
611
// WARNING: keep this in sync with the submodules hard-coded in bootstrap.py
612
- const BOOTSTRAP_SUBMODULES : & [ & str ] = & [
612
+ let mut bootstrap_submodules : Vec < & str > = vec ! [
613
613
"src/tools/rust-installer" ,
614
614
"src/tools/cargo" ,
615
615
"src/tools/rls" ,
616
616
"src/tools/miri" ,
617
617
"library/backtrace" ,
618
618
"library/stdarch" ,
619
619
] ;
620
+ // As in bootstrap.py, we include `rust-analyzer` if `build.vendor` was set in
621
+ // `config.toml`.
622
+ if self . config . vendor {
623
+ bootstrap_submodules. push ( "src/tools/rust-analyzer" ) ;
624
+ }
620
625
// Avoid running git when there isn't a git checkout.
621
626
if !self . config . submodules ( & self . rust_info ) {
622
627
return ;
@@ -632,7 +637,7 @@ impl Build {
632
637
// Sample output: `submodule.src/rust-installer.path src/tools/rust-installer`
633
638
let submodule = Path :: new ( line. splitn ( 2 , ' ' ) . nth ( 1 ) . unwrap ( ) ) ;
634
639
// avoid updating submodules twice
635
- if !BOOTSTRAP_SUBMODULES . iter ( ) . any ( |& p| Path :: new ( p) == submodule)
640
+ if !bootstrap_submodules . iter ( ) . any ( |& p| Path :: new ( p) == submodule)
636
641
&& channel:: GitInfo :: new ( false , submodule) . is_git ( )
637
642
{
638
643
self . update_submodule ( submodule) ;
You can’t perform that action at this time.
0 commit comments