From 31267e80071d689230b7718fa0410a03af99798e Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 28 Feb 2022 06:31:50 -0800 Subject: [PATCH] Fix extracting submodules on windows. --- src/ci/init_repo.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ci/init_repo.sh b/src/ci/init_repo.sh index 217192af2fe69..93af8c26111c2 100755 --- a/src/ci/init_repo.sh +++ b/src/ci/init_repo.sh @@ -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 }