ci: split install-msys2 step into two separate scripts

This commit is contained in:
Pietro Albini 2019-10-22 16:40:54 +02:00
parent 9d15336149
commit db0078706b
No known key found for this signature in database
GPG key ID: 3E06ABE80BAAF19C
3 changed files with 32 additions and 14 deletions

View file

@ -98,6 +98,13 @@ steps:
displayName: Install msys2
condition: and(succeeded(), not(variables.SKIP_JOB))
- bash: src/ci/scripts/install-msys2-packages.sh
env:
AGENT_OS: $(Agent.OS)
SYSTEM_WORKFOLDER: $(System.Workfolder)
displayName: Install msys2 packages
condition: and(succeeded(), not(variables.SKIP_JOB))
- bash: src/ci/scripts/install-mingw.sh
env:
AGENT_OS: $(Agent.OS)

View file

@ -0,0 +1,25 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
if isWindows; then
pacman -S --noconfirm --needed base-devel ca-certificates make diffutils tar
# FIXME(#65767): workaround msys bug, step 2
arch=i686
if [ "$MSYS_BITS" = "64" ]; then
arch=x86_64
fi
pacman -U --noconfirm --noprogressbar mingw-w64-$arch-ca-certificates-20180409-1-any.pkg.tar.xz
rm mingw-w64-$arch-ca-certificates-20180409-1-any.pkg.tar.xz
# Make sure we use the native python interpreter instead of some msys equivalent
# one way or another. The msys interpreters seem to have weird path conversions
# baked in which break LLVM's build system one way or another, so let's use the
# native version which keeps everything as native as possible.
cp C:/Python27amd64/python.exe C:/Python27amd64/python2.7.exe
ciCommandAddPath "C:\\Python27amd64"
fi

View file

@ -23,18 +23,4 @@ if isWindows; then
mkdir -p "${SYSTEM_WORKFOLDER}/msys2/home/${USERNAME}"
ciCommandAddPath "${SYSTEM_WORKFOLDER}/msys2/usr/bin"
export PATH="${SYSTEM_WORKFOLDER}/msys2/usr/bin:${PATH}"
pacman -S --noconfirm --needed base-devel ca-certificates make diffutils tar
# FIXME(#65767): workaround msys bug, step 2
pacman -U --noconfirm --noprogressbar mingw-w64-$arch-ca-certificates-20180409-1-any.pkg.tar.xz
rm mingw-w64-$arch-ca-certificates-20180409-1-any.pkg.tar.xz
# Make sure we use the native python interpreter instead of some msys equivalent
# one way or another. The msys interpreters seem to have weird path conversions
# baked in which break LLVM's build system one way or another, so let's use the
# native version which keeps everything as native as possible.
cp C:/Python27amd64/python.exe C:/Python27amd64/python2.7.exe
ciCommandAddPath "C:\\Python27amd64"
fi