about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-08-02 23:07:46 +0200
committerGitHub <noreply@github.com>2022-08-02 23:07:46 +0200
commit4fbe53f70b544a41a277c37b017a85d41ba344a0 (patch)
tree3c5cf3d5a56606b30bec92a61cfa1ce7e90a7c04 /src/bootstrap
parent82feb4996cb9195b0979ab6ab1dac379ade7f500 (diff)
parentf2164c324cedfed8e655342b26b2831bdb39c5f2 (diff)
Rollup merge of #100008 - jyn514:eager-submodules, r=bjorn3
Update all pre-cloned submodules on startup

Fixes https://github.com/rust-lang/rust/issues/99083
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/lib.rs20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index cd421c249d8..f84de73297a 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -624,20 +624,6 @@ impl Build {
     /// If any submodule has been initialized already, sync it unconditionally.
     /// 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
-        let mut bootstrap_submodules: Vec<&str> = vec![
-            "src/tools/rust-installer",
-            "src/tools/cargo",
-            "src/tools/rls",
-            "src/tools/miri",
-            "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;
@@ -653,10 +639,8 @@ impl Build {
             // Look for `submodule.$name.path = $path`
             // 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)
-                && channel::GitInfo::new(false, submodule).is_git()
-            {
+            // Don't update the submodule unless it's already been cloned.
+            if channel::GitInfo::new(false, submodule).is_git() {
                 self.update_submodule(submodule);
             }
         }