Skip to content

Commit

Permalink
Rollup merge of rust-lang#104953 - jyn514:fewer-submodule-updates, r=…
Browse files Browse the repository at this point in the history
…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 rust-lang#104952 for convenience to avoid merge conflicts, but doesn't depend on that PR.
  • Loading branch information
matthiaskrgr authored Dec 5, 2022
2 parents 4b6010c + ab89c17 commit f4643f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -674,7 +676,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;
Expand Down Expand Up @@ -703,8 +705,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);
}
Expand Down

0 comments on commit f4643f5

Please sign in to comment.