Skip to content

Commit 47f8b4a

Browse files
committed
Hack around abysmally slow llvm clones
1 parent 5b13bff commit 47f8b4a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/ci/init_repo.sh

+10
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ if [ ! -d "$cache_src_dir/.git" ]; then
6464
git clone https://github.com/rust-lang/rust.git $cache_src_dir"
6565
fi
6666
retry sh -c "cd $cache_src_dir && git reset --hard && git pull"
67+
(cd $cache_src_dir && git rm src/llvm)
6768
retry sh -c "cd $cache_src_dir && \
6869
git submodule deinit -f . && git submodule sync && git submodule update --init"
6970

@@ -76,6 +77,15 @@ touch "$cache_valid_file"
7677
# http://stackoverflow.com/questions/12641469/list-submodules-in-a-git-repository
7778
modules="$(git config --file .gitmodules --get-regexp '\.path$' | cut -d' ' -f2)"
7879
for module in $modules; do
80+
if [ "$module" = src/llvm ]; then
81+
commit="$(git ls-tree HEAD src/llvm | awk '{print $3}')"
82+
git rm src/llvm
83+
curl -sSL -O "https://github.com/rust-lang/llvm/archive/$commit.tar.gz"
84+
tar -C src/ -xf "$commit.tar.gz"
85+
rm "$commit.tar.gz"
86+
mv "src/llvm-$commit" src/llvm
87+
continue
88+
fi
7989
if [ ! -d "$cache_src_dir/$module" ]; then
8090
echo "WARNING: $module not found in pristine repo"
8191
retry sh -c "git submodule deinit -f $module && git submodule update --init $module"

0 commit comments

Comments
 (0)