]> git.lizzy.rs Git - rust.git/blob - .azure-pipelines/steps/install-windows-build-deps.yml
Remove GlobalArenas and use Arena instead
[rust.git] / .azure-pipelines / steps / install-windows-build-deps.yml
1 steps:
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.
6 - script: |
7     mkdir c:\MORE_SPACE
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'))
11
12 # Download and install MSYS2, needed primarily for the test suite (run-make) but
13 # also used by the MinGW toolchain for assembling things.
14 #
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
17 # done.
18 - script: |
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
26     )
27     where rev
28     rev --help
29     where make
30
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'))
35
36 # If we need to download a custom MinGW, do so here and set the path
37 # appropriately.
38 #
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.
44 #
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.
48 #
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.
53 #
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.
56 - script: |
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
64
65 # Otherwise pull in the MinGW installed on appveyor
66 - script: |
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
70
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.
75 - script: |
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'))
80
81 # Note that this is originally from the github releases patch of Ninja
82 - script: |
83     md 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'))