about summary refs log tree commit diff
path: root/src/bootstrap/lib.rs
diff options
context:
space:
mode:
authoryungkneez <brendonfederko@outlook.com>2022-04-26 17:01:40 -0700
committeryungkneez <brendonfederko@outlook.com>2022-05-01 17:36:39 -0700
commit2878f98672ea8b5d69c2139a0784e41c90de1d9b (patch)
treef0d0c6c37fe0209d4a3d79cf26b9a86ac10a4480 /src/bootstrap/lib.rs
parent082e4ca49770ebc9cb0ee616f3726a67471be8cb (diff)
downloadrust-2878f98672ea8b5d69c2139a0784e41c90de1d9b.tar.gz
rust-2878f98672ea8b5d69c2139a0784e41c90de1d9b.zip
Initialize rust-analyzer submodule on bootstrap
Diffstat (limited to 'src/bootstrap/lib.rs')
-rw-r--r--src/bootstrap/lib.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 59102ad9f50..f47398d45d4 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -609,7 +609,7 @@ impl Build {
     /// This avoids contributors checking in a submodule change by accident.
     pub fn maybe_update_submodules(&self) {
         // WARNING: keep this in sync with the submodules hard-coded in bootstrap.py
-        const BOOTSTRAP_SUBMODULES: &[&str] = &[
+        let mut bootstrap_submodules: Vec<&str> = vec![
             "src/tools/rust-installer",
             "src/tools/cargo",
             "src/tools/rls",
@@ -617,6 +617,11 @@ impl Build {
             "library/backtrace",
             "library/stdarch",
         ];
+        // As in bootstrap.py, we include `rust-analyzer` if `build.vendor` was set in
+        // `config.toml`.
+        if self.config.vendor {
+            bootstrap_submodules.push("src/tools/rust-analyzer");
+        }
         // Avoid running git when there isn't a git checkout.
         if !self.config.submodules(&self.rust_info) {
             return;
@@ -632,7 +637,7 @@ impl Build {
             // Sample output: `submodule.src/rust-installer.path src/tools/rust-installer`
             let submodule = Path::new(line.splitn(2, ' ').nth(1).unwrap());
             // avoid updating submodules twice
-            if !BOOTSTRAP_SUBMODULES.iter().any(|&p| Path::new(p) == submodule)
+            if !bootstrap_submodules.iter().any(|&p| Path::new(p) == submodule)
                 && channel::GitInfo::new(false, submodule).is_git()
             {
                 self.update_submodule(submodule);