2 # Download and install MSYS2, needed primarily for the test suite (run-make) but
3 # also used by the MinGW toolchain for assembling things.
8 source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
12 mkdir -p "${msys2Path}/home/${USERNAME}"
13 ciCommandAddPath "${msys2Path}/usr/bin"
15 # Detect the native Python version installed on the agent. On GitHub
16 # Actions, the C:\hostedtoolcache\windows\Python directory contains a
17 # subdirectory for each installed Python version.
19 # The -V flag of the sort command sorts the input by version number.
20 native_python_version="$(ls /c/hostedtoolcache/windows/Python | sort -Vr | head -n 1)"
22 # Make sure we use the native python interpreter instead of some msys equivalent
23 # one way or another. The msys interpreters seem to have weird path conversions
24 # baked in which break LLVM's build system one way or another, so let's use the
25 # native version which keeps everything as native as possible.
26 python_home="/c/hostedtoolcache/windows/Python/${native_python_version}/x64"
27 if ! [[ -f "${python_home}/python3.exe" ]]; then
28 cp "${python_home}/python.exe" "${python_home}/python3.exe"
30 ciCommandAddPath "C:\\hostedtoolcache\\windows\\Python\\${native_python_version}\\x64"
31 ciCommandAddPath "C:\\hostedtoolcache\\windows\\Python\\${native_python_version}\\x64\\Scripts"