]> git.lizzy.rs Git - rust.git/blobdiff - src/ci/init_repo.sh
Rollup merge of #95646 - mgeisler:mention-std-env-var, r=Dylan-DPC
[rust.git] / src / ci / init_repo.sh
index 3c61dcc9d9c7b46a70a56b180355d6af93721707..93af8c26111c2dde2720cfcb6aed0a46037c6919 100755 (executable)
@@ -43,6 +43,11 @@ function fetch_github_commit_archive {
         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
     tar -C $module --strip-components=1 -xf $cached
     rm $cached
 }
@@ -62,6 +67,7 @@ for i in ${!modules[@]}; do
         url=${urls[$i]}
         url=${url/\.git/}
         fetch_github_commit_archive $module "$url/archive/$commit.tar.gz" &
+        bg_pids[${i}]=$!
         continue
     else
         use_git="$use_git $module"
@@ -70,4 +76,9 @@ done
 retry sh -c "git submodule deinit -f $use_git && \
     git submodule sync && \
     git submodule update -j 16 --init --recursive $use_git"
-wait
+STATUS=0
+for pid in ${bg_pids[*]}
+do
+    wait $pid || STATUS=1
+done
+exit ${STATUS}