about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatt Harding <majaharding@gmail.com>2024-03-11 02:47:51 +0000
committerMatt Harding <majaharding@gmail.com>2024-03-11 02:47:51 +0000
commit2c77140c7dc968aee236e062b1676b4489bba9e0 (patch)
treefecc4e37b73d9b60be5cd84e6eed80b211f720b9
parent61e83dcceef0320205fbe5aac42a01866efca87d (diff)
downloadrust-2c77140c7dc968aee236e062b1676b4489bba9e0.tar.gz
rust-2c77140c7dc968aee236e062b1676b4489bba9e0.zip
mv instead of rm tools off path for msys2 install
-rwxr-xr-xsrc/ci/scripts/install-msys2.sh23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/ci/scripts/install-msys2.sh b/src/ci/scripts/install-msys2.sh
index e3f76744cbe..2ae78235604 100755
--- a/src/ci/scripts/install-msys2.sh
+++ b/src/ci/scripts/install-msys2.sh
@@ -28,16 +28,19 @@ if isWindows; then
     # Install pacboy for easily installing packages
     pacman -S --noconfirm pactoys
 
-    # Delete these pre-installed tools so we can't accidentally use them, because we are using the
-    # MSYS2 setup action versions instead.
-    # Delete pre-installed version of MSYS2
-    echo "Cleaning up tools in PATH"
-    rm -r "/c/msys64/"
-    # Delete Strawberry Perl, which contains a version of mingw
-    rm -r "/c/Strawberry/"
-    # Delete these other copies of mingw, I don't even know where they come from.
-    rm -r "/c/mingw64/"
-    rm -r "/c/mingw32/"
+    # Remove these pre-installed tools so we can't accidentally use them, because we are using the
+    # MSYS2 setup action versions instead. Because `rm -r`-ing them is slow, we mv them off path
+    # instead.
+    # Remove pre-installed version of MSYS2
+    echo "Cleaning up existing tools in PATH"
+    notpath="/c/NOT/ON/PATH/"
+    mkdir --parents "$notpath"
+    mv -t "$notpath" "/c/msys64/"
+    # Remove Strawberry Perl, which contains a version of mingw
+    mv -t "$notpath" "/c/Strawberry/"
+    # Remove these other copies of mingw, I don't even know where they come from.
+    mv -t "$notpath" "/c/mingw64/"
+    mv -t "$notpath" "/c/mingw32/"
     echo "Finished cleaning up tools in PATH"
 
     if isKnownToBeMingwBuild; then