Skip to content

Commit 4fbe53f

Browse files
authored
Rollup merge of #100008 - jyn514:eager-submodules, r=bjorn3
Update all pre-cloned submodules on startup Fixes #99083
2 parents 82feb49 + f2164c3 commit 4fbe53f

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

src/bootstrap/lib.rs

+2-18
Original file line numberDiff line numberDiff line change
@@ -624,20 +624,6 @@ impl Build {
624624
/// If any submodule has been initialized already, sync it unconditionally.
625625
/// This avoids contributors checking in a submodule change by accident.
626626
pub fn maybe_update_submodules(&self) {
627-
// WARNING: keep this in sync with the submodules hard-coded in bootstrap.py
628-
let mut bootstrap_submodules: Vec<&str> = vec![
629-
"src/tools/rust-installer",
630-
"src/tools/cargo",
631-
"src/tools/rls",
632-
"src/tools/miri",
633-
"library/backtrace",
634-
"library/stdarch",
635-
];
636-
// As in bootstrap.py, we include `rust-analyzer` if `build.vendor` was set in
637-
// `config.toml`.
638-
if self.config.vendor {
639-
bootstrap_submodules.push("src/tools/rust-analyzer");
640-
}
641627
// Avoid running git when there isn't a git checkout.
642628
if !self.config.submodules(&self.rust_info) {
643629
return;
@@ -653,10 +639,8 @@ impl Build {
653639
// Look for `submodule.$name.path = $path`
654640
// Sample output: `submodule.src/rust-installer.path src/tools/rust-installer`
655641
let submodule = Path::new(line.splitn(2, ' ').nth(1).unwrap());
656-
// avoid updating submodules twice
657-
if !bootstrap_submodules.iter().any(|&p| Path::new(p) == submodule)
658-
&& channel::GitInfo::new(false, submodule).is_git()
659-
{
642+
// Don't update the submodule unless it's already been cloned.
643+
if channel::GitInfo::new(false, submodule).is_git() {
660644
self.update_submodule(submodule);
661645
}
662646
}

0 commit comments

Comments
 (0)