]> git.lizzy.rs Git - rust.git/blob - src/ci/scripts/install-msys2.sh
Rollup merge of #67507 - Mark-Simulacrum:purge-uninit, r=Centril
[rust.git] / src / ci / scripts / install-msys2.sh
1 #!/bin/bash
2 # Download and install MSYS2, needed primarily for the test suite (run-make) but
3 # also used by the MinGW toolchain for assembling things.
4 #
5 # FIXME: we should probe the default azure image and see if we can use the MSYS2
6 # toolchain there. (if there's even one there). For now though this gets the job
7 # done.
8
9 set -euo pipefail
10 IFS=$'\n\t'
11
12 source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
13
14 if isWindows; then
15     for RETRY_COUNT in 1 2 3 4 5 6 7 8 9 10; do
16         choco install msys2 \
17             --params="/InstallDir:$(ciCheckoutPath)/msys2 /NoPath" -y --no-progress \
18             && mkdir -p "$(ciCheckoutPath)/msys2/home/${USERNAME}" \
19             && ciCommandAddPath "$(ciCheckoutPath)/msys2/usr/bin" && break
20     done
21 fi