about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.azure-pipelines/auto.yml9
-rw-r--r--.azure-pipelines/pr.yml3
-rw-r--r--.azure-pipelines/steps/install-clang.yml40
-rw-r--r--.azure-pipelines/steps/install-sccache.yml21
-rw-r--r--.azure-pipelines/steps/install-windows-build-deps.yml (renamed from .azure-pipelines/steps/windows.yml)103
-rw-r--r--.azure-pipelines/steps/linux.yml35
-rw-r--r--.azure-pipelines/steps/macos.yml47
-rw-r--r--.azure-pipelines/steps/run-script.yml35
-rw-r--r--.azure-pipelines/steps/run.yml108
-rw-r--r--.azure-pipelines/steps/show-disk-usage.yml5
-rw-r--r--.azure-pipelines/steps/show-environment-variables.yml3
-rw-r--r--.azure-pipelines/steps/verify-publish-toolstate.yml9
-rw-r--r--.azure-pipelines/try.yml61
-rwxr-xr-xsrc/ci/init_repo.sh2
-rwxr-xr-xsrc/ci/run.sh2
15 files changed, 249 insertions, 234 deletions
diff --git a/.azure-pipelines/auto.yml b/.azure-pipelines/auto.yml
index 05d33e2f9d5..3b6cfed7071 100644
--- a/.azure-pipelines/auto.yml
+++ b/.azure-pipelines/auto.yml
@@ -11,11 +11,10 @@ variables:
 
 jobs:
 - job: Linux
-  timeoutInMinutes: 180
   pool:
     vmImage: ubuntu-16.04
   steps:
-  - template: steps/linux.yml
+  - template: steps/run.yml
   strategy:
     matrix:
       x86_64-gnu-llvm-6.0:
@@ -151,13 +150,12 @@ jobs:
         IMAGE: mingw-check
 
 - job: macOS
-  timeoutInMinutes: 180
   pool:
     vmImage: macos-10.13
   steps:
   - checkout: self
     fetchDepth: 2
-  - template: steps/macos.yml
+  - template: steps/run.yml
   strategy:
     matrix:
       # OSX builders running tests, these run the full test suite.
@@ -216,11 +214,10 @@ jobs:
 
 
 - job: Windows
-  timeoutInMinutes: 180
   pool:
     vmImage: 'vs2017-win2016'
   steps:
-  - template: steps/windows.yml
+  - template: steps/run.yml
   strategy:
     matrix:
 #      # 32/64 bit MSVC tests
diff --git a/.azure-pipelines/pr.yml b/.azure-pipelines/pr.yml
index fe20e35e344..84c9454fee5 100644
--- a/.azure-pipelines/pr.yml
+++ b/.azure-pipelines/pr.yml
@@ -8,11 +8,10 @@ pr:
 
 jobs:
 - job: Linux
-  timeoutInMinutes: 180
   pool:
     vmImage: ubuntu-16.04
   steps:
-    - template: steps/linux.yml
+    - template: steps/run.yml
   strategy:
     matrix:
       x86_64-gnu-llvm-6.0:
diff --git a/.azure-pipelines/steps/install-clang.yml b/.azure-pipelines/steps/install-clang.yml
new file mode 100644
index 00000000000..26a223282cd
--- /dev/null
+++ b/.azure-pipelines/steps/install-clang.yml
@@ -0,0 +1,40 @@
+steps:
+
+- bash: |
+    set -e
+    curl -f http://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-apple-darwin.tar.xz | tar xJf -
+
+    export CC=`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang
+    echo "##vso[task.setvariable variable=CC]$CC"
+
+    export CXX=`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang++
+    echo "##vso[task.setvariable variable=CXX]$CXX"
+
+    # Configure `AR` specifically so rustbuild doesn't try to infer it as
+    # `clang-ar` by accident.
+    echo "##vso[task.setvariable variable=AR]ar"
+  displayName: Install clang (OSX)
+  condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
+
+# If we're compiling for MSVC then we, like most other distribution builders,
+# switch to clang as the compiler. This'll allow us eventually to enable LTO
+# amongst LLVM and rustc. Note that we only do this on MSVC as I don't think
+# clang has an output mode compatible with MinGW that we need. If it does we
+# should switch to clang for MinGW as well!
+#
+# Note that the LLVM installer is an NSIS installer
+#
+# Original downloaded here came from
+# http://releases.llvm.org/7.0.0/LLVM-7.0.0-win64.exe
+- script: |
+    powershell -Command "iwr -outf %TEMP%\LLVM-7.0.0-win64.exe https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/LLVM-7.0.0-win64.exe"
+    set CLANG_DIR=%CD%\citools\clang-rust
+    %TEMP%\LLVM-7.0.0-win64.exe /S /NCRC /D=%CLANG_DIR%
+    set RUST_CONFIGURE_ARGS=%RUST_CONFIGURE_ARGS% --set llvm.clang-cl=%CLANG_DIR%\bin\clang-cl.exe
+    echo ##vso[task.setvariable variable=RUST_CONFIGURE_ARGS]%RUST_CONFIGURE_ARGS%
+  condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['MINGW_URL'],''))
+  displayName: Install clang (Windows)
+
+# Note that we don't install clang on Linux since its compiler story is just so
+# different. Each container has its own toolchain configured appropriately
+# already.
diff --git a/.azure-pipelines/steps/install-sccache.yml b/.azure-pipelines/steps/install-sccache.yml
new file mode 100644
index 00000000000..39f58002a73
--- /dev/null
+++ b/.azure-pipelines/steps/install-sccache.yml
@@ -0,0 +1,21 @@
+steps:
+
+- bash: |
+    set -e
+    curl -fo /usr/local/bin/sccache https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2018-04-02-sccache-x86_64-apple-darwin
+    chmod +x /usr/local/bin/sccache
+  displayName: Install sccache (OSX)
+  condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
+
+- script: |
+    md sccache
+    powershell -Command "iwr -outf sccache\sccache.exe https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2018-04-26-sccache-x86_64-pc-windows-msvc"
+    echo ##vso[task.prependpath]%CD%\sccache
+  displayName: Install sccache (Windows)
+  condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
+
+# Note that we don't install sccache on Linux since it's installed elsewhere
+# through all the containers.
+#
+# FIXME: we should probably install sccache outside the containers and then
+# mount it inside the containers so we can centralize all installation here.
diff --git a/.azure-pipelines/steps/windows.yml b/.azure-pipelines/steps/install-windows-build-deps.yml
index 5fb1da2083f..45ce01fee75 100644
--- a/.azure-pipelines/steps/windows.yml
+++ b/.azure-pipelines/steps/install-windows-build-deps.yml
@@ -1,19 +1,17 @@
 steps:
-- checkout: self
-  fetchDepth: 2
-
-- bash: |
-    set -x
-    git submodule
-    export SUBMODULES_EXCLUDES=$(git submodule | grep -Eow 'src/[^ ]+' | sed 's/\(.*\)/--exclude=\1\/\.git/')
-    echo "##vso[task.setvariable variable=SUBMODULES_EXCLUDES;]$SUBMODULES_EXCLUDES"
-
-- script: |
-    REM echo hack as drive D is too small
-    IF NOT "%DISABLE_DISK_SPACE_HACK%"=="1" (
-      mkdir c:\MORE_SPACE
-      mklink /J build c:\MORE_SPACE
-    )
+# FIXME: are these still needed?
+# - bash: |
+#     set -x
+#     git submodule
+#     export SUBMODULES_EXCLUDES=$(git submodule | grep -Eow 'src/[^ ]+' | sed 's/\(.*\)/--exclude=\1\/\.git/')
+#     echo "##vso[task.setvariable variable=SUBMODULES_EXCLUDES;]$SUBMODULES_EXCLUDES"
+#
+# - script: |
+#     REM echo hack as drive D is too small
+#     IF NOT "%DISABLE_DISK_SPACE_HACK%"=="1" (
+#       mkdir c:\MORE_SPACE
+#       mklink /J build c:\MORE_SPACE
+#     )
 
 - script: |
     set MSYS_PATH=%CD%\citools\msys64
@@ -31,6 +29,7 @@ steps:
     echo ##vso[task.setvariable variable=MSYS_PATH]%MSYS_PATH%
     echo ##vso[task.prependpath]%MSYS_PATH%\usr\bin
   displayName: Install msys2
+  condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
 
 # If we need to download a custom MinGW, do so here and set the path
 # appropriately.
@@ -44,28 +43,9 @@ steps:
     powershell -Command "iwr -outf %MINGW_ARCHIVE% %MINGW_URL%/%MINGW_ARCHIVE%"
     7z x -y %MINGW_ARCHIVE% > nul
     echo ##vso[task.prependpath]%CD%\%MINGW_DIR%\bin
-  condition: and(succeeded(), ne(variables['MINGW_URL'],''))
+  condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), ne(variables['MINGW_URL'],''))
   displayName: Download custom MinGW
 
-# If we're compiling for MSVC then we, like most other distribution builders,
-# switch to clang as the compiler. This'll allow us eventually to enable LTO
-# amongst LLVM and rustc. Note that we only do this on MSVC as I don't think
-# clang has an output mode compatible with MinGW that we need. If it does we
-# should switch to clang for MinGW as well!
-#
-# Note that the LLVM installer is an NSIS installer
-#
-# Original downloaded here came from
-# http://releases.llvm.org/7.0.0/LLVM-7.0.0-win64.exe
-- script: |
-    powershell -Command "iwr -outf %TEMP%\LLVM-7.0.0-win64.exe https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/LLVM-7.0.0-win64.exe"
-    set CLANG_DIR=%CD%\citools\clang-rust
-    %TEMP%\LLVM-7.0.0-win64.exe /S /NCRC /D=%CLANG_DIR%
-    set RUST_CONFIGURE_ARGS=%RUST_CONFIGURE_ARGS% --set llvm.clang-cl=%CLANG_DIR%\bin\clang-cl.exe
-    echo ##vso[task.setvariable variable=RUST_CONFIGURE_ARGS]%RUST_CONFIGURE_ARGS%
-  condition: and(succeeded(), eq(variables['MINGW_URL'],''))
-  displayName: Download clang
-
 # Here we do a pretty heinous thing which is to mangle the MinGW installation
 # we just had above. Currently, as of this writing, we're using MinGW-w64
 # builds of gcc, and that's currently at 6.3.0. We use 6.3.0 as it appears to
@@ -87,28 +67,20 @@ steps:
     echo ON
     powershell -Command "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%\bin\gdborig.exe
-  condition: and(succeeded(), ne(variables['MINGW_URL'],''))
+  condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), ne(variables['MINGW_URL'],''))
   displayName: Override with 6.3.0 gdb with 6.2.0 gdb
 
 # Otherwise pull in the MinGW installed on appveyor
 - script: |
-    echo Find mingw
-    set PATH | findstr /i msys
-    set PATH | findstr /i mingw
     echo ##vso[task.prependpath]%MSYS_PATH%\mingw%MSYS_BITS%\bin
-  condition: and(succeeded(), eq(variables['MINGW_URL'],''))
+  condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'), eq(variables['MINGW_URL'],''))
   displayName: Add MinGW to path
 
 - script: |
     copy C:\Python27amd64\python.exe C:\Python27amd64\python2.7.exe
     echo ##vso[task.prependpath]C:\Python27amd64
   displayName: Prefer the "native" Python as LLVM has trouble building with MSYS sometimes
-
-- script: |
-    md sccache
-    powershell -Command "iwr -outf sccache\sccache.exe https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2018-04-26-sccache-x86_64-pc-windows-msvc"
-    echo ##vso[task.prependpath]%CD%\sccache
-  displayName: Download and install sccache
+  condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
 
 # Note that this is originally from the github releases patch of Ninja
 - script: |
@@ -120,41 +92,4 @@ steps:
     echo ##vso[task.setvariable variable=RUST_CONFIGURE_ARGS]%RUST_CONFIGURE_ARGS%
     echo ##vso[task.prependpath]%CD%\ninja
   displayName: Download and install ninja
-
-- script: |
-    mkdir handle
-    powershell -Command "iwr -outf 2017-05-15-Handle.zip https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-05-15-Handle.zip"
-    7z x -ohandle 2017-05-15-Handle.zip
-    del 2017-05-15-Handle.zip
-    set PATH=%PATH%;%CD%\handle
-    handle.exe -accepteula -help
-    echo ##vso[task.setvariable variable=PATH]%PATH%
-  displayName: Help debug handle issues
-
-- template: show-environment-variables.yml
-
-- script: |
-    REM echo force the specific VS version
-    IF "%VCVARS_BAT%" NEQ "" (
-      CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\%VCVARS_BAT%"
-    )
-
-    where sccache
-    where rev
-    set | findstr /v SCCACHE_AZURE_CONNECTION_STRING
-
-    if not exist D:\cache\rustsrc\NUL mkdir D:\cache\rustsrc
-
-    sh src/ci/init_repo.sh . /d/cache/rustsrc
-    sh src/ci/run.sh
-  env:
-    CI: true
-    CI_JOB_NAME: $(System.JobDisplayName)
-    SRC: .
-    NO_CCACHE: 1
-
-    # explicitly decrypt secret variables
-    # see https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch
-    AWS_ACCESS_KEY_ID: $(SCCACHE_AWS_ACCESS_KEY_ID)
-    AWS_SECRET_ACCESS_KEY: $(SCCACHE_AWS_SECRET_ACCESS_KEY)
-  displayName: Run script
+  condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
diff --git a/.azure-pipelines/steps/linux.yml b/.azure-pipelines/steps/linux.yml
deleted file mode 100644
index 36f980cf992..00000000000
--- a/.azure-pipelines/steps/linux.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-steps:
-- checkout: self
-  fetchDepth: 2
-
-- template: show-environment-variables.yml
-- template: show-disk-usage.yml
-
-- bash: |
-    sudo apt install gdb
-
-    curl -fo $HOME/stamp https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-03-17-stamp-x86_64-unknown-linux-musl
-    chmod +x $HOME/stamp
-
-    export PATH=$PATH:$HOME/.local/bin:$HOME/Library/Python/2.7/bin/:$HOME
-    echo "##vso[task.prependpath]$HOME/.local/bin"
-    echo "##vso[task.prependpath]$HOME/Library/Python/2.7/bin"
-    echo "##vso[task.prependpath]$HOME"
-
-    mkdir -p $HOME/rustsrc
-  displayName:  Prep
-
-- bash: |
-    export RUN_SCRIPT="$BUILD_SOURCESDIRECTORY/src/ci/init_repo.sh . $HOME/rustsrc && src/ci/docker/run.sh $IMAGE"
-    echo "##vso[task.setvariable variable=IMAGE]$IMAGE"
-    echo "##vso[task.setvariable variable=RUN_SCRIPT]$RUN_SCRIPT"
-  displayName: Prepare run script
-
-- template: show-environment-variables.yml
-
-- bash: sudo sh -c 'echo "/checkout/obj/cores/core.%p.%E" > /proc/sys/kernel/core_pattern'
-  displayName: Enable core dump
-
-- template: verify-publish-toolstate.yml
-
-- template: run-script.yml
diff --git a/.azure-pipelines/steps/macos.yml b/.azure-pipelines/steps/macos.yml
deleted file mode 100644
index d1adc340392..00000000000
--- a/.azure-pipelines/steps/macos.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-steps:
-- template: show-disk-usage.yml
-
-- bash: |
-    export PATH=$PATH:$HOME/.local/bin:$HOME/Library/Python/2.7/bin/
-    mkdir -p $HOME/rustsrc
-    echo "##vso[task.setvariable variable=PATH;]$PATH"
-
-    curl -fo /usr/local/bin/sccache https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2018-04-02-sccache-x86_64-apple-darwin
-    chmod +x /usr/local/bin/sccache
-
-    curl -fo /usr/local/bin/stamp https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror/2017-03-17-stamp-x86_64-apple-darwin
-    chmod +x /usr/local/bin/stamp
-
-    export CC=`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang
-    echo "##vso[task.setvariable variable=CC]$CC"
-
-    export CXX=`pwd`/clang+llvm-7.0.0-x86_64-apple-darwin/bin/clang++
-    echo "##vso[task.setvariable variable=CXX]$CXX"
-
-    echo "##vso[task.setvariable variable=AR]ar"
-  displayName: Prep
-
-- bash: brew install gnu-tar
-  displayName: install a tar that works well
-
-- bash: |
-    curl -f http://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-apple-darwin.tar.xz | tar xJf -
-  displayName: Download clang
-
-- bash: |
-    brew update
-    brew install xz
-    brew install swig
-  condition: and(succeeded(), eq(variables['RUST_CHECK_TARGET'],'dist'))
-  displayName: Install xz and swigw
-
-- bash: |
-    export RUN_SCRIPT="$BUILD_SOURCESDIRECTORY/src/ci/init_repo.sh . $HOME/rustsrc && src/ci/run.sh"
-    echo "##vso[task.setvariable variable=RUN_SCRIPT]$RUN_SCRIPT"
-  displayName: Prepare run script (init and run)
-
-- template: show-environment-variables.yml
-
-- template: verify-publish-toolstate.yml
-
-- template: run-script.yml
diff --git a/.azure-pipelines/steps/run-script.yml b/.azure-pipelines/steps/run-script.yml
deleted file mode 100644
index bf18518e6b1..00000000000
--- a/.azure-pipelines/steps/run-script.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-steps:
-
-- bash: |
-    # Log time information from this machine and an external machine for insight into possible
-    # clock drift. Timezones don't matter since relative deltas give all the necessary info.
-    date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
-
-    which sccache
-    stamp sh -x -c "$RUN_SCRIPT"
-
-    date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
-  env:
-    CI: true
-    CI_JOB_NAME: $(IMAGE)
-    SRC: .
-
-    # Explicitly decrypt secret variables
-    # See https://docs.microsoft.com/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#secret-variables
-    AWS_ACCESS_KEY_ID: $(SCCACHE_AWS_ACCESS_KEY_ID)
-    AWS_SECRET_ACCESS_KEY: $(SCCACHE_AWS_SECRET_ACCESS_KEY)
-  displayName: Run script
-
-- bash: |
-    deploy_dir=rustc-builds
-    if [ "$DEPLOY_ALT" == "1" ]; then
-        deploy_dir=rustc-builds-alt
-    fi
-    aws s3 cp --no-progress --recursive --acl public-read ./deploy s3://$DEPLOY_BUCKET/$deploy_dir
-  env:
-    # Explicitly decrypt secret variables
-    # See https://docs.microsoft.com/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#secret-variables
-    AWS_ACCESS_KEY_ID: $(SCCACHE_AWS_ACCESS_KEY_ID)
-    AWS_SECRET_ACCESS_KEY: $(SCCACHE_AWS_SECRET_ACCESS_KEY)
-  condition: and(succeeded(), or(eq(variables.DEPLOY, '1'), eq(variables.DEPLOY_ALT, '1')))
-  displayName: Upload artifacts
diff --git a/.azure-pipelines/steps/run.yml b/.azure-pipelines/steps/run.yml
new file mode 100644
index 00000000000..dfe54e65e4e
--- /dev/null
+++ b/.azure-pipelines/steps/run.yml
@@ -0,0 +1,108 @@
+# FIXME(linux): need to configure core dumps, enable them, and then dump
+# backtraces on failure from all core dumps:
+#
+# - bash: sudo apt install gdb
+# - bash: sudo sh -c 'echo "/checkout/obj/cores/core.%p.%E" > /proc/sys/kernel/core_pattern'
+#
+# Check travis config for `gdb --batch` command to print all crash logs
+
+steps:
+
+- checkout: self
+  fetchDepth: 2
+
+- bash: printenv | sort
+  displayName: Show environment variables
+
+- bash: |
+    set -e
+    df -h
+    du . | sort -nr | head -n100
+  displayName: Show disk usage
+  # FIXME: this hasn't been tested, but maybe it works on Windows? Should test!
+  condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
+
+- template: install-sccache.yml
+- template: install-clang.yml
+
+# Install some dependencies needed to build LLDB/Clang, currently only needed
+# during the `dist` target
+- bash: |
+    set -e
+    brew update
+    brew install xz
+    brew install swig
+  displayName: Install build dependencies (OSX)
+  condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'), eq(variables['RUST_CHECK_TARGET'],'dist'))
+
+- template: install-windows-build-deps.yml
+
+# Check out all our submodules, but more quickly than using git by using one of
+# our custom scripts
+- bash: |
+    set -e
+    mkdir -p $HOME/rustsrc
+    $BUILD_SOURCESDIRECTORY/src/ci/init_repo.sh . $HOME/rustsrc
+  condition: and(succeeded(), ne(variables['Agent.OS'], 'Windows_NT'))
+  displayName: Check out submodules (Unix)
+- script: |
+    if not exist D:\cache\rustsrc\NUL mkdir D:\cache\rustsrc
+    sh src/ci/init_repo.sh . /d/cache/rustsrc
+  condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
+  displayName: Check out submodules (Windows)
+
+# Ensure the `aws` CLI is installed so we can deploy later on, cache docker
+# images, etc.
+- bash: |
+    set -e
+    sudo apt-get install -y python3-setuptools
+    pip3 install awscli --upgrade --user
+    echo "##vso[task.prependpath]$HOME/.local/bin"
+  displayName: Install awscli (Linux)
+  condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
+- script: pip install awscli
+  displayName: Install awscli (non-Linux)
+  condition: and(succeeded(), ne(variables['Agent.OS'], 'Linux'))
+
+# Configure our CI_JOB_NAME variable which log analyzers can use for the main
+# step to see what's going on.
+- bash: echo "##vso[task.setvariable variable=CI_JOB_NAME]$SYSTEM_JOBNAME"
+  displayName: Configure Job Name
+
+# As a quick smoke check on the otherwise very fast mingw-check linux builder
+# check our own internal scripts.
+- bash: |
+    set -e
+    git clone --depth=1 https://github.com/rust-lang-nursery/rust-toolstate.git
+    cd rust-toolstate
+    python2.7 "$BUILD_SOURCESDIRECTORY/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "" ""
+    cd ..
+    rm -rf rust-toolstate
+  condition: and(succeeded(), eq(variables['IMAGE'], 'mingw-check'))
+  displayName: Verify the publish_toolstate script works
+
+- bash: |
+    set -e
+    if [ "$IMAGE" = "" ]; then
+      src/ci/run.sh
+    else
+      src/ci/docker/run.sh $IMAGE
+    fi
+  timeoutInMinutes: 180
+  env:
+    CI: true
+    SRC: .
+    AWS_SECRET_ACCESS_KEY: $(SCCACHE_AWS_SECRET_ACCESS_KEY)
+  displayName: Run build
+
+- bash: |
+    set -e
+    deploy_dir=rustc-builds
+    if [ "$DEPLOY_ALT" == "1" ]; then
+        deploy_dir=rustc-builds-alt
+    fi
+    aws s3 cp --no-progress --recursive --acl public-read ./deploy s3://$DEPLOY_BUCKET/$deploy_dir
+  env:
+    AWS_SECRET_ACCESS_KEY: $(SCCACHE_AWS_SECRET_ACCESS_KEY)
+  condition: and(succeeded(), or(eq(variables.DEPLOY, '1'), eq(variables.DEPLOY_ALT, '1')))
+  displayName: Upload artifacts
diff --git a/.azure-pipelines/steps/show-disk-usage.yml b/.azure-pipelines/steps/show-disk-usage.yml
deleted file mode 100644
index 902d8036471..00000000000
--- a/.azure-pipelines/steps/show-disk-usage.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-steps:
-- bash: |
-    df -h
-    du . | sort -nr | head -n100
-  displayName: Show disk usage
diff --git a/.azure-pipelines/steps/show-environment-variables.yml b/.azure-pipelines/steps/show-environment-variables.yml
deleted file mode 100644
index f6ed063ec6b..00000000000
--- a/.azure-pipelines/steps/show-environment-variables.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-steps:
-- bash: printenv | sort
-  displayName: Show environment variables
\ No newline at end of file
diff --git a/.azure-pipelines/steps/verify-publish-toolstate.yml b/.azure-pipelines/steps/verify-publish-toolstate.yml
deleted file mode 100644
index 5531c90e090..00000000000
--- a/.azure-pipelines/steps/verify-publish-toolstate.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-steps:
-- bash: |
-    git clone --depth=1 https://github.com/rust-lang-nursery/rust-toolstate.git
-    cd rust-toolstate
-    python2.7 "$BUILD_SOURCESDIRECTORY/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "" ""
-    cd ..
-    rm -rf rust-toolstate
-  condition: and(succeeded(), eq(variables['IMAGE'], 'mingw-check'))
-  displayName: Verify the publish_toolstate script works
diff --git a/.azure-pipelines/try.yml b/.azure-pipelines/try.yml
index bdd36e8555d..47470a2aa34 100644
--- a/.azure-pipelines/try.yml
+++ b/.azure-pipelines/try.yml
@@ -11,7 +11,6 @@ variables:
 
 jobs:
 - job: Linux
-  timeoutInMinutes: 180
   pool:
     vmImage: ubuntu-16.04
   strategy:
@@ -19,12 +18,62 @@ jobs:
       dist-x86_64-linux:
         IMAGE: dist-x86_64-linux
         DEPLOY: 1
-
-      # "alternate" deployments, these are "nightlies" but have LLVM assertions
-      # turned on, they're deployed to a different location primarily for
-      # additional testing.
       dist-x86_64-linux-alt:
         IMAGE: dist-x86_64-linux
         DEPLOY_ALT: 1
+      test-various:
+        IMAGE: test-various
+  steps:
+  - template: steps/run.yml
+
+- job: macOS
+  pool:
+    vmImage: macos-10.13
+  strategy:
+    matrix:
+      x86_64-apple:
+        RUST_CHECK_TARGET: check
+        RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc
+        RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
+        MACOSX_DEPLOYMENT_TARGET: 10.8
+        MACOSX_STD_DEPLOYMENT_TARGET: 10.7
+        NO_LLVM_ASSERTIONS: 1
+        NO_DEBUG_ASSERTIONS: 1
+
+      dist-x86_64-apple:
+        RUST_CHECK_TARGET: dist
+        RUST_CONFIGURE_ARGS: --target=aarch64-apple-ios,armv7-apple-ios,armv7s-apple-ios,i386-apple-ios,x86_64-apple-ios --enable-full-tools --enable-sanitizers --enable-profiler --enable-lldb --set rust.jemalloc
+        DEPLOY: 1
+        RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
+        MACOSX_DEPLOYMENT_TARGET: 10.7
+        NO_LLVM_ASSERTIONS: 1
+        NO_DEBUG_ASSERTIONS: 1
+        DIST_REQUIRE_ALL_TOOLS: 1
+  steps:
+  - template: steps/run.yml
+
+- job: Windows
+  pool:
+    vmImage: 'vs2017-win2016'
+  strategy:
+    matrix:
+     x86_64-msvc-1:
+       RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
+       SCRIPT: make ci-subset-1
+       NO_DEBUG_ASSERTIONS: 1
+       NO_LLVM_ASSERTIONS: 1
+     x86_64-msvc-2:
+       RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-msvc --enable-profiler
+       SCRIPT: make ci-subset-2
+
+     dist-x86_64-msvc:
+       RUST_CONFIGURE_ARGS: >
+         --build=x86_64-pc-windows-msvc
+         --target=x86_64-pc-windows-msvc,aarch64-pc-windows-msvc
+         --enable-full-tools
+         --enable-profiler
+       SCRIPT: python x.py dist
+       DIST_REQUIRE_ALL_TOOLS: 1
+       DEPLOY: 1
   steps:
-  - template: steps/linux.yml
+  - template: steps/run.yml
diff --git a/src/ci/init_repo.sh b/src/ci/init_repo.sh
index 3dfd3381576..b1e4f931c44 100755
--- a/src/ci/init_repo.sh
+++ b/src/ci/init_repo.sh
@@ -46,7 +46,7 @@ function fetch_github_commit_archive {
     rm $cached
 }
 
-included="src/llvm-project src/llvm-emscripten src/doc/book src/doc/rust-by-example"
+included="src/llvm-project src/llvm-emscripten src/doc/book src/doc/rust-by-example src/tools/rustfmt"
 modules="$(git config --file .gitmodules --get-regexp '\.path$' | cut -d' ' -f2)"
 modules=($modules)
 use_git=""
diff --git a/src/ci/run.sh b/src/ci/run.sh
index a51c2da3cbd..c996dcb14af 100755
--- a/src/ci/run.sh
+++ b/src/ci/run.sh
@@ -141,4 +141,4 @@ else
   do_make "$RUST_CHECK_TARGET"
 fi
 
-sccache --show-stats
+sccache --show-stats || true