Skip to content

Commit f4643f5

Browse files
authored
Rollup merge of #104953 - jyn514:fewer-submodule-updates, r=Mark-Simulacrum
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 affecting `cargo metadata` somehow. This is based on #104952 for convenience to avoid merge conflicts, but doesn't depend on that PR.
2 parents 4b6010c + ab89c17 commit f4643f5

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);
@@ -674,7 +676,7 @@ impl Build {
674676

675677
/// If any submodule has been initialized already, sync it unconditionally.
676678
/// This avoids contributors checking in a submodule change by accident.
677-
pub fn maybe_update_submodules(&self) {
679+
pub fn update_existing_submodules(&self) {
678680
// Avoid running git when there isn't a git checkout.
679681
if !self.config.submodules(&self.rust_info()) {
680682
return;
@@ -703,8 +705,6 @@ impl Build {
703705
job::setup(self);
704706
}
705707

706-
self.maybe_update_submodules();
707-
708708
if let Subcommand::Format { check, paths } = &self.config.cmd {
709709
return format::format(&builder::Builder::new(&self), *check, &paths);
710710
}

0 commit comments

Comments
 (0)