Skip to content

Commit

Permalink
Update all pre-cloned submodules on startup
Browse files Browse the repository at this point in the history
Fixes #99083
  • Loading branch information
jyn514 committed Aug 1, 2022
1 parent e5a7d8f commit f2164c3
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}
}
Expand Down

0 comments on commit f2164c3

Please sign in to comment.