Skip to content

Commit ab89c17

Browse files
committed
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.
1 parent b771d90 commit ab89c17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bootstrap/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,8 @@ impl Build {
579579
for s in rust_submodules {
580580
build.update_submodule(Path::new(s));
581581
}
582+
// Now, update all existing submodules.
583+
build.update_existing_submodules();
582584

583585
build.verbose("learning about cargo");
584586
metadata::build(&mut build);
@@ -660,7 +662,7 @@ impl Build {
660662

661663
/// If any submodule has been initialized already, sync it unconditionally.
662664
/// This avoids contributors checking in a submodule change by accident.
663-
pub fn maybe_update_submodules(&self) {
665+
pub fn update_existing_submodules(&self) {
664666
// Avoid running git when there isn't a git checkout.
665667
if !self.config.submodules(&self.rust_info()) {
666668
return;
@@ -689,8 +691,6 @@ impl Build {
689691
job::setup(self);
690692
}
691693

692-
self.maybe_update_submodules();
693-
694694
if let Subcommand::Format { check, paths } = &self.config.cmd {
695695
return format::format(&builder::Builder::new(&self), *check, &paths);
696696
}

0 commit comments

Comments
 (0)