Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a62debe

Browse files
committedMay 26, 2024
Auto merge of rust-lang#125546 - ChrisDenton:mingw-ci, r=Mark-Simulacrum
Try to not reinstall tools in mingw CI Reinstalling the tools seems prone to failure (e.g. [latest](rust-lang#125529 (comment))) and is more work. It also seems unnecessary as CI actually uses a vendored tarball for builds. cc `@mati865`
2 parents bd184cc + 2429e1b commit a62debe

File tree

2 files changed

+6
-38
lines changed

2 files changed

+6
-38
lines changed
 

‎src/ci/scripts/install-mingw.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ 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 mingw-w64-$arch-cmake \
43+
mingw-w64-$arch-gcc \
44+
mingw-w64-$arch-python # the python package is actually for python3
45+
ciCommandAddPath "$(ciCheckoutPath)/msys2/mingw${bits}/bin"
4646
else
4747
mingw_dir="mingw${bits}"
4848

‎src/ci/scripts/install-msys2.sh

+2-34
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ IFS=$'\n\t'
77

88
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
99
if isWindows; then
10+
ciCommandAddPath "c:/msys64/usr/bin"
11+
1012
# Detect the native Python version installed on the agent. On GitHub
1113
# Actions, the C:\hostedtoolcache\windows\Python directory contains a
1214
# subdirectory for each installed Python version.
@@ -24,38 +26,4 @@ if isWindows; then
2426
fi
2527
ciCommandAddPath "C:\\hostedtoolcache\\windows\\Python\\${native_python_version}\\x64"
2628
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
6129
fi

0 commit comments

Comments
 (0)
Failed to load comments.