]> git.lizzy.rs Git - rust.git/blob - src/ci/scripts/install-msys2.sh
lowering: cleanup some hofs
[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     # Pre-followed the api/v2 URL to the CDN since the API can be a bit flakey
16     curl -sSL https://packages.chocolatey.org/msys2.20190524.0.0.20191030.nupkg > \
17         msys2.nupkg
18     curl -sSL https://packages.chocolatey.org/chocolatey-core.extension.1.3.5.1.nupkg > \
19         chocolatey-core.extension.nupkg
20     choco install -s . msys2 \
21         --params="/InstallDir:$(ciCheckoutPath)/msys2 /NoPath" -y --no-progress
22     rm msys2.nupkg chocolatey-core.extension.nupkg
23     mkdir -p "$(ciCheckoutPath)/msys2/home/${USERNAME}"
24     ciCommandAddPath "$(ciCheckoutPath)/msys2/usr/bin"
25 fi