2 # We've had issues with the default drive in use running out of space during a
3 # build, and it looks like the `C:` drive has more space than the default `D:`
4 # drive. We should probably confirm this with the azure pipelines team at some
5 # point, but this seems to fix our "disk space full" problems.
8 mklink /J build c:\MORE_SPACE
9 displayName: "Ensure build happens on C:/ instead of D:/"
10 condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
12 # Download and install MSYS2, needed primarily for the test suite (run-make) but
13 # also used by the MinGW toolchain for assembling things.
15 # FIXME: we should probe the default azure image and see if we can use the MSYS2
16 # toolchain there. (if there's even one there). For now though this gets the job
19 set MSYS_PATH=%CD%\citools\msys64
20 choco install msys2 --params="/InstallDir:%MSYS_PATH% /NoPath" -y
21 set PATH=%MSYS_PATH%\usr\bin;%PATH%
22 pacman -S --noconfirm --needed base-devel ca-certificates make diffutils tar
23 IF "%MINGW_URL%"=="" (
24 IF "%MSYS_BITS%"=="32" pacman -S --noconfirm --needed mingw-w64-i686-toolchain mingw-w64-i686-cmake mingw-w64-i686-gcc mingw-w64-i686-python2
25 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
31 echo ##vso[task.setvariable variable=MSYS_PATH]%MSYS_PATH%
32 echo ##vso[task.prependpath]%MSYS_PATH%\usr\bin
33 displayName: Install msys2
34 condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
36 # If we need to download a custom MinGW, do so here and set the path
39 # Here we also do a pretty heinous thing which is to mangle the MinGW
40 # installation we just downloaded. Currently, as of this writing, we're using
41 # MinGW-w64 builds of gcc, and that's currently at 6.3.0. We use 6.3.0 as it
42 # appears to be the first version which contains a fix for #40546, builds
43 # randomly failing during LLVM due to ar.exe/ranlib.exe failures.
45 # Unfortunately, though, 6.3.0 *also* is the first version of MinGW-w64 builds
46 # to contain a regression in gdb (#40184). As a result if we were to use the
47 # gdb provided (7.11.1) then we would fail all debuginfo tests.
49 # In order to fix spurious failures (pretty high priority) we use 6.3.0. To
50 # avoid disabling gdb tests we download an *old* version of gdb, specifically
51 # that found inside the 6.2.0 distribution. We then overwrite the 6.3.0 gdb
52 # with the 6.2.0 gdb to get tests passing.
54 # Note that we don't literally overwrite the gdb.exe binary because it appears
55 # to just use gdborig.exe, so that's the binary we deal with instead.
57 powershell -Command "iwr -outf %MINGW_ARCHIVE% %MINGW_URL%/%MINGW_ARCHIVE%"
58 7z x -y %MINGW_ARCHIVE% > nul
59 powershell -Command "iwr -outf 2017-04-20-%MSYS_BITS%bit-gdborig.exe %MINGW_URL%/2017-04-20-%MSYS_BITS%bit-gdborig.exe"
60 mv 2017-04-20-%MSYS_BITS%bit-gdborig.exe %MINGW_DIR%\bin\gdborig.exe
61 echo ##vso[task.prependpath]%CD%\%MINGW_DIR%\bin
62 condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), ne(variables['MINGW_URL'],''))
63 displayName: Download custom MinGW
65 # Otherwise pull in the MinGW installed on appveyor
67 echo ##vso[task.prependpath]%MSYS_PATH%\mingw%MSYS_BITS%\bin
68 condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['MINGW_URL'],''))
69 displayName: Add MinGW to path
71 # Make sure we use the native python interpreter instead of some msys equivalent
72 # one way or another. The msys interpreters seem to have weird path conversions
73 # baked in which break LLVM's build system one way or another, so let's use the
74 # native version which keeps everything as native as possible.
76 copy C:\Python27amd64\python.exe C:\Python27amd64\python2.7.exe
77 echo ##vso[task.prependpath]C:\Python27amd64
78 displayName: Prefer the "native" Python as LLVM has trouble building with MSYS sometimes
79 condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
81 # Note that this is originally from the github releases patch of Ninja
84 powershell -Command "iwr -outf 2017-03-15-ninja-win.zip https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/2017-03-15-ninja-win.zip"
85 7z x -oninja 2017-03-15-ninja-win.zip
86 del 2017-03-15-ninja-win.zip
87 set RUST_CONFIGURE_ARGS=%RUST_CONFIGURE_ARGS% --enable-ninja
88 echo ##vso[task.setvariable variable=RUST_CONFIGURE_ARGS]%RUST_CONFIGURE_ARGS%
89 echo ##vso[task.prependpath]%CD%\ninja
90 displayName: Download and install ninja
91 condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))