Skip to content

Commit

Permalink
Rollup merge of rust-lang#42211 - aidanhs:aphs-llvm-clone-hacks, r=Ma…
Browse files Browse the repository at this point in the history
…rk-Simulacrum

Hack around abysmally slow llvm clones

r? @Mark-Simulacrum

(don't r+ yet, let's see what travis says)
  • Loading branch information
Mark-Simulacrum authored May 25, 2017
2 parents 2bca4fa + 47f8b4a commit d429b49
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/ci/init_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ if [ ! -d "$cache_src_dir/.git" ]; then
git clone https://github.com/rust-lang/rust.git $cache_src_dir"
fi
retry sh -c "cd $cache_src_dir && git reset --hard && git pull"
(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"

Expand All @@ -76,6 +77,15 @@ touch "$cache_valid_file"
# http://stackoverflow.com/questions/12641469/list-submodules-in-a-git-repository
modules="$(git config --file .gitmodules --get-regexp '\.path$' | cut -d' ' -f2)"
for module in $modules; do
if [ "$module" = src/llvm ]; then
commit="$(git ls-tree HEAD src/llvm | awk '{print $3}')"
git rm src/llvm
curl -sSL -O "https://github.com/rust-lang/llvm/archive/$commit.tar.gz"
tar -C src/ -xf "$commit.tar.gz"
rm "$commit.tar.gz"
mv "src/llvm-$commit" src/llvm
continue
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"
Expand Down

0 comments on commit d429b49

Please sign in to comment.