Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clone submodules recursively #42928

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ def update_submodules(self):
(self.get_toml('jemalloc') or self.get_mk('CFG_JEMALLOC_ROOT'))))
]
run(["git", "submodule", "update",
"--init"] + submodules, cwd=self.rust_root, verbose=self.verbose)
"--init", "--recursive"] + submodules, cwd=self.rust_root, verbose=self.verbose)
run(["git", "submodule", "-q", "foreach", "git",
"reset", "-q", "--hard"], cwd=self.rust_root, verbose=self.verbose)
run(["git", "submodule", "-q", "foreach", "git",
Expand Down
7 changes: 4 additions & 3 deletions src/ci/init_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ retry sh -c "rm -rf $cache_src_dir && mkdir -p $cache_src_dir && \
git clone --depth 1 https://github.com/rust-lang/rust.git $cache_src_dir"
(cd $cache_src_dir && git rm src/llvm)
retry sh -c "cd $cache_src_dir && \
git submodule deinit -f . && git submodule sync && git submodule update --init"
git submodule deinit -f . && git submodule sync && git submodule update --init --recursive"

travis_fold end update_cache
travis_time_finish
Expand All @@ -69,11 +69,12 @@ for module in $modules; do
fi
if [ ! -d "$cache_src_dir/$module" ]; then
echo "WARNING: $module not found in pristine repo"
retry sh -c "git submodule deinit -f $module && git submodule update --init $module"
retry sh -c "git submodule deinit -f $module && \
git submodule update --init --recursive $module"
continue
fi
retry sh -c "git submodule deinit -f $module && \
git submodule update --init --reference $cache_src_dir/$module $module"
git submodule update --init --recursive --reference $cache_src_dir/$module $module"
done

travis_fold end update_submodules
Expand Down