about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorJoshua Nelson <jnelson@cloudflare.com>2022-11-26 16:11:07 -0500
committerJoshua Nelson <jnelson@cloudflare.com>2022-11-26 16:11:07 -0500
commitab89c171bdb29194baca274decf86acfecd2bb9d (patch)
treed4b2cf2ce8bfd0bf798f0043988038af7216df3c /src/bootstrap
parentb771d901f735aa6d4078aed92b03e30eba35bf5a (diff)
downloadrust-ab89c171bdb29194baca274decf86acfecd2bb9d.tar.gz
rust-ab89c171bdb29194baca274decf86acfecd2bb9d.zip
Ensure required submodules at the same time as updating existing submodules
In practice, this would always happen at the same time, but putting them next to each other makes that more obvious and ensures it doesn't change in the future.
It also avoids the difference avoiding `cargo metadata` somehow.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
index 60ce431cb0c..86b195fb89e 100644
--- a/src/bootstrap/lib.rs
+++ b/src/bootstrap/lib.rs
@@ -579,6 +579,8 @@ impl Build {
             for s in rust_submodules {
                 build.update_submodule(Path::new(s));
             }
+            // Now, update all existing submodules.
+            build.update_existing_submodules();
 
             build.verbose("learning about cargo");
             metadata::build(&mut build);
@@ -660,7 +662,7 @@ 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) {
+    pub fn update_existing_submodules(&self) {
         // Avoid running git when there isn't a git checkout.
         if !self.config.submodules(&self.rust_info()) {
             return;
@@ -689,8 +691,6 @@ impl Build {
             job::setup(self);
         }
 
-        self.maybe_update_submodules();
-
         if let Subcommand::Format { check, paths } = &self.config.cmd {
             return format::format(&builder::Builder::new(&self), *check, &paths);
         }