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

Include extraction in the retrying for submodule download #106680

Closed
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
8 changes: 5 additions & 3 deletions src/ci/scripts/checkout-submodules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ fi
function fetch_github_commit_archive {
local module=$1
local cached="download-${module//\//-}.tar.gz"
retry sh -c "rm -f $cached && \
curl -f -sSL -o $cached $2"
rm -f "${cached}"
rm -rf "${module}"
curl -f -sSL -o "${cached}" "$2"
mkdir $module
touch "$module/.git"
# On Windows, the default behavior is to emulate symlinks by copying
# files. However, that ends up being order-dependent while extracting,
# which can cause a failure if the symlink comes first. This env var
# causes tar to use real symlinks instead, which are allowed to dangle.
export MSYS=winsymlinks:nativestrict
mkdir -p "${module}"
tar -C $module --strip-components=1 -xf $cached
rm $cached
}
Expand All @@ -50,7 +52,7 @@ for i in ${!modules[@]}; do
git rm $module
url=${urls[$i]}
url=${url/\.git/}
fetch_github_commit_archive $module "$url/archive/$commit.tar.gz" &
retry fetch_github_commit_archive $module "$url/archive/$commit.tar.gz" &
bg_pids[${i}]=$!
continue
else
Expand Down