Change:
The "Install MSYS2" step of failed, but the build kept going and failed later with obscure errors. We should fix this so that if msys2 installation fails the build fails immediately!

Discussion:
# one is MSI installers and one is EXE, but they're not used so frequently at # this point anyway so perhaps it's a wash! - script: | <del> powershell -Command "$ProgressPreference = 'SilentlyContinue'; iwr -outf is-install.exe https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/2017-08-22-is.exe" is-install.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- </del> echo ##vso[task.prependpath]C:Program Files (x86)Inno Setup 5 <ins> curl.exe -o is-install.exe https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/2017-08-22-is.exe is-install.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- </ins> displayName: Install InnoSetup condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))

# FIXME: we should probe the default azure image and see if we can use the MSYS2 # toolchain there. (if there's even one there). For now though this gets the job # done. <del> - script: | set MSYS_PATH=%CD%citoolsmsys64 choco install msys2 --params="/InstallDir:%MSYS_PATH% /NoPath" -y set PATH=%MSYS_PATH%usrbin;%PATH% pacman -S --noconfirm --needed base-devel ca-certificates make diffutils tar IF "%MINGW_URL%"=="" ( IF "%MSYS_BITS%"=="32" pacman -S --noconfirm --needed mingw-w64-i686-toolchain mingw-w64-i686-cmake mingw-w64-i686-gcc mingw-w64-i686-python2 IF "%MSYS_BITS%"=="64" pacman -S --noconfirm --needed mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc mingw-w64-x86_64-python2 ) where rev rev --help where make echo ##vso[task.setvariable variable=MSYS_PATH]%MSYS_PATH% echo ##vso[task.prependpath]%MSYS_PATH%usrbin </del> <ins> - bash: | set -e choco install msys2 --params="/InstallDir:$(System.Workfolder)/msys2 /NoPath" -y --no-progress echo "##vso[task.prependpath]$(System.Workfolder)/msys2/usr/bin" mkdir -p "$(System.Workfolder)/msys2/home/$USERNAME" </ins> displayName: Install msys2 condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) <ins> - bash: pacman -S --noconfirm --needed base-devel ca-certificates make diffutils tar displayName: Install msys2 base deps condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) </ins> # If we need to download a custom MinGW, do so here and set the path # appropriately. #

# # Note that we don't literally overwrite the gdb.exe binary because it appears # to just use gdborig.exe, so that's the binary we deal with instead. <del> - script: | powershell -Command "$ProgressPreference = 'SilentlyContinue'; iwr -outf %MINGW_ARCHIVE% %MINGW_URL%/%MINGW_ARCHIVE%" 7z x -y %MINGW_ARCHIVE% > nul powershell -Command "$ProgressPreference = 'SilentlyContinue'; iwr -outf 2017-04-20-%MSYS_BITS%bit-gdborig.exe %MINGW_URL%/2017-04-20-%MSYS_BITS%bit-gdborig.exe" mv 2017-04-20-%MSYS_BITS%bit-gdborig.exe %MINGW_DIR%bingdborig.exe echo ##vso[task.prependpath]%CD%%MINGW_DIR%bin </del> <ins> - bash: | set -e curl -o mingw.7z $MINGW_URL/$MINGW_ARCHIVE 7z x -y mingw.7z > /dev/null curl -o $MINGW_DIR/bin/gdborig.exe $MINGW_URL/2017-04-20-${MSYS_BITS}bit-gdborig.exe echo "##vso[task.prependpath]`pwd`/$MINGW_DIR/bin" </ins> condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), ne(variables['MINGW_URL'],'')) displayName: Download custom MinGW <del> # Otherwise pull in the MinGW installed on appveyor - script: | echo ##vso[task.prependpath]%MSYS_PATH%mingw%MSYS_BITS%bin </del> <ins> # Otherwise install MinGW through `pacman` - bash: | set -e arch=i686 if [ "$MSYS_BITS" = "64" ]; then arch=x86_64 fi pacman -S --noconfirm --needed mingw-w64-$arch-toolchain mingw-w64-$arch-cmake mingw-w64-$arch-gcc mingw-w64-$arch-python2 echo "##vso[task.prependpath]$(System.Workfolder)/msys2/mingw$MSYS_BITS/bin" </ins> condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['MINGW_URL'],'')) <del> displayName: Add MinGW to path </del> <ins> displayName: Download standard MinGW </ins> # 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. <del> - script: | copy C:Python27amd64python.exe C:Python27amd64python2.7.exe echo ##vso[task.prependpath]C:Python27amd64 </del> <ins> - bash: | set -e cp C:/Python27amd64/python.exe C:/Python27amd64/python2.7.exe echo "##vso[task.prependpath]C:/Python27amd64" </ins> displayName: Prefer the "native" Python as LLVM has trouble building with MSYS sometimes condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT')) # Note that this is originally from the github releases patch of Ninja <del> - script: | md ninja powershell -Command "$ProgressPreference = 'SilentlyContinue'; iwr -outf 2017-03-15-ninja-win.zip https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/2017-03-15-ninja-win.zip" 7z x -oninja 2017-03-15-ninja-win.zip del 2017-03-15-ninja-win.zip set RUST_CONFIGURE_ARGS=%RUST_CONFIGURE_ARGS% --enable-ninja echo ##vso[task.setvariable variable=RUST_CONFIGURE_ARGS]%RUST_CONFIGURE_ARGS% echo ##vso[task.prependpath]%CD%ninja </del> <ins> - bash: | set -e mkdir ninja curl -o ninja.zip https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/2017-03-15-ninja-win.zip 7z x -oninja ninja.zip rm ninja.zip echo "##vso[task.setvariable variable=RUST_CONFIGURE_ARGS]$RUST_CONFIGURE_ARGS --enable-ninja" echo "##vso[task.prependpath]`pwd`/ninja" </ins> displayName: Download and install ninja condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))