From 150078f9575799834a27096cae7f6e1eed466400 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 18 Nov 2021 02:54:39 +0000 Subject: [PATCH] Fixes tar on Windows Disable symlink copy for mingw and cygwin that on windows --- tar_from_installation.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tar_from_installation.sh b/tar_from_installation.sh index ec62dbdde..9cb43b315 100755 --- a/tar_from_installation.sh +++ b/tar_from_installation.sh @@ -19,9 +19,6 @@ else INSTALL_DIR=/opt/wasi-sdk fi -PKGDIR=build/wasi-sdk-$VERSION -mkdir -p build - case "$(uname -s)" in Linux*) MACHINE=linux;; Darwin*) MACHINE=macos;; @@ -35,8 +32,14 @@ if [ ! -d $INSTALL_DIR ] ; then exit 1 fi +PKGDIR=build/wasi-sdk-$VERSION rm -rf $PKGDIR -cp -R $INSTALL_DIR $PKGDIR +if [ "$MACHINE" == "cygwin" ] || [ "$MACHINE" == "mingw" ]; then + # Copy with -L to avoid trying to create symlinks on Windows. + cp -R -L $INSTALL_DIR $PKGDIR +else + cp -R $INSTALL_DIR $PKGDIR +fi cd build tar czf $OUTDIR/wasi-sdk-$VERSION\-$MACHINE.tar.gz wasi-sdk-$VERSION