Skip to content

Commit 941aa47

Browse files
committed
Do less reinstalling in mingw CI
1 parent 21e6de7 commit 941aa47

File tree

2 files changed

+4
-41
lines changed

2 files changed

+4
-41
lines changed

src/ci/scripts/install-mingw.sh

+2-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
1212
MINGW_ARCHIVE_32="i686-12.2.0-release-posix-dwarf-rt_v10-rev0.7z"
1313
MINGW_ARCHIVE_64="x86_64-12.2.0-release-posix-seh-rt_v10-rev0.7z"
1414

15-
if isWindows; then
15+
if isWindows && isKnownToBeMingwBuild; then
1616
case "${CI_JOB_NAME}" in
1717
*i686*)
1818
bits=32
@@ -39,10 +39,7 @@ if isWindows; then
3939
esac
4040

4141
if [[ "${CUSTOM_MINGW:-0}" == 0 ]]; then
42-
pacboy -S --noconfirm toolchain:p
43-
# According to the comment in the Windows part of install-clang.sh, in the future we might
44-
# want to do this instead:
45-
# pacboy -S --noconfirm clang:p ...
42+
pacman -S --noconfirm --needed mingw-w64-$arch-toolchain
4643
else
4744
mingw_dir="mingw${bits}"
4845

src/ci/scripts/install-msys2.sh

+2-36
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
2-
# Clean up and prepare the MSYS2 installation. MSYS2 is needed primarily for
3-
# the test suite (run-make), but is also used by the MinGW toolchain for assembling things.
2+
# Clean up and prepare the MSYS2 installation.
3+
# MSYS2 is used by the MinGW toolchain for assembling things.
44

55
set -euo pipefail
66
IFS=$'\n\t'
@@ -24,38 +24,4 @@ if isWindows; then
2424
fi
2525
ciCommandAddPath "C:\\hostedtoolcache\\windows\\Python\\${native_python_version}\\x64"
2626
ciCommandAddPath "C:\\hostedtoolcache\\windows\\Python\\${native_python_version}\\x64\\Scripts"
27-
28-
# Install pacboy for easily installing packages
29-
pacman -S --noconfirm pactoys
30-
31-
# Remove these pre-installed tools so we can't accidentally use them, because we are using the
32-
# MSYS2 setup action versions instead. Because `rm -r`-ing them is slow, we mv them off path
33-
# instead.
34-
# Remove pre-installed version of MSYS2
35-
echo "Cleaning up existing tools in PATH"
36-
notpath="/c/NOT/ON/PATH/"
37-
mkdir --parents "$notpath"
38-
mv -t "$notpath" "/c/msys64/"
39-
# Remove Strawberry Perl, which contains a version of mingw
40-
mv -t "$notpath" "/c/Strawberry/"
41-
# Remove these other copies of mingw, I don't even know where they come from.
42-
mv -t "$notpath" "/c/mingw64/"
43-
mv -t "$notpath" "/c/mingw32/"
44-
echo "Finished cleaning up tools in PATH"
45-
46-
if isKnownToBeMingwBuild; then
47-
# Use the mingw version of CMake for mingw builds.
48-
# However, the MSVC build needs native CMake, as it fails with the mingw one.
49-
# Delete native CMake
50-
rm -r "/c/Program Files/CMake/"
51-
# Install mingw-w64-$arch-cmake
52-
pacboy -S --noconfirm cmake:p
53-
54-
# It would be nice to use MSYS's git in MinGW builds so that it's tested and known to
55-
# work. But it makes everything extremely slow, so it's commented out for now.
56-
# # Delete Windows-Git
57-
# rm -r "/c/Program Files/Git/"
58-
# # Install MSYS2 git
59-
# pacman -S --noconfirm git
60-
fi
6127
fi

0 commit comments

Comments
 (0)