about summary refs log tree commit diff
diff options
context:
space:
mode:
authorChris Denton <chris@chrisdenton.dev>2024-05-25 12:36:22 +0000
committerChris Denton <chris@chrisdenton.dev>2024-05-26 10:52:31 +0000
commit941aa47433b7702dcba706f6f1d85dfbea7a7792 (patch)
tree86a152c56a2f5f439fe217b922de7c6f13b83e9e
parent21e6de7eb64c09102de3f100420a09edc1a2a8d7 (diff)
downloadrust-941aa47433b7702dcba706f6f1d85dfbea7a7792.tar.gz
rust-941aa47433b7702dcba706f6f1d85dfbea7a7792.zip
Do less reinstalling in mingw CI
-rwxr-xr-xsrc/ci/scripts/install-mingw.sh7
-rwxr-xr-xsrc/ci/scripts/install-msys2.sh38
2 files changed, 4 insertions, 41 deletions
diff --git a/src/ci/scripts/install-mingw.sh b/src/ci/scripts/install-mingw.sh
index 87b835b63db..45541b8b693 100755
--- a/src/ci/scripts/install-mingw.sh
+++ b/src/ci/scripts/install-mingw.sh
@@ -12,7 +12,7 @@ source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
 MINGW_ARCHIVE_32="i686-12.2.0-release-posix-dwarf-rt_v10-rev0.7z"
 MINGW_ARCHIVE_64="x86_64-12.2.0-release-posix-seh-rt_v10-rev0.7z"
 
-if isWindows; then
+if isWindows && isKnownToBeMingwBuild; then
     case "${CI_JOB_NAME}" in
         *i686*)
             bits=32
@@ -39,10 +39,7 @@ if isWindows; then
     esac
 
     if [[ "${CUSTOM_MINGW:-0}" == 0 ]]; then
-        pacboy -S --noconfirm toolchain:p
-        # According to the comment in the Windows part of install-clang.sh, in the future we might
-        # want to do this instead:
-        # pacboy -S --noconfirm clang:p ...
+        pacman -S --noconfirm --needed mingw-w64-$arch-toolchain
     else
         mingw_dir="mingw${bits}"
 
diff --git a/src/ci/scripts/install-msys2.sh b/src/ci/scripts/install-msys2.sh
index 2ae78235604..968b1e572e4 100755
--- a/src/ci/scripts/install-msys2.sh
+++ b/src/ci/scripts/install-msys2.sh
@@ -1,6 +1,6 @@
 #!/bin/bash
-# Clean up and prepare the MSYS2 installation. MSYS2 is needed primarily for
-# the test suite (run-make), but is also used by the MinGW toolchain for assembling things.
+# Clean up and prepare the MSYS2 installation.
+# MSYS2 is used by the MinGW toolchain for assembling things.
 
 set -euo pipefail
 IFS=$'\n\t'
@@ -24,38 +24,4 @@ if isWindows; then
     fi
     ciCommandAddPath "C:\\hostedtoolcache\\windows\\Python\\${native_python_version}\\x64"
     ciCommandAddPath "C:\\hostedtoolcache\\windows\\Python\\${native_python_version}\\x64\\Scripts"
-
-    # Install pacboy for easily installing packages
-    pacman -S --noconfirm pactoys
-
-    # 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
-        # Use the mingw version of CMake for mingw builds.
-        # However, the MSVC build needs native CMake, as it fails with the mingw one.
-        # Delete native CMake
-        rm -r "/c/Program Files/CMake/"
-        # Install mingw-w64-$arch-cmake
-        pacboy -S --noconfirm cmake:p
-
-        # It would be nice to use MSYS's git in MinGW builds so that it's tested and known to
-        # work. But it makes everything extremely slow, so it's commented out for now.
-        # # Delete Windows-Git
-        # rm -r "/c/Program Files/Git/"
-        # # Install MSYS2 git
-        # pacman -S --noconfirm git
-    fi
 fi