about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-07-19 15:49:18 +0000
committerbors <bors@rust-lang.org>2019-07-19 15:49:18 +0000
commite3cebcb3bd4ffaf86bb0cdfd2af5b7e698717b01 (patch)
tree1fa755afded0bf5bf1f472743f1c89ad16b4951b /src
parent527dce7137f7a3c7bf47d9a503abf25f88ea22de (diff)
parent9b4f6de7a47c87f78f88a70397cf222d8e359e35 (diff)
downloadrust-e3cebcb3bd4ffaf86bb0cdfd2af5b7e698717b01.tar.gz
rust-e3cebcb3bd4ffaf86bb0cdfd2af5b7e698717b01.zip
Auto merge of #62690 - alexcrichton:azure-update, r=pietroalbini
azure: Prepare configuration for 4-core machines

This commit updates some of our assorted Azure/CI configuration to
prepare for some 4-core machines coming online. We're still in the
process of performance testing them to get final numbers, but some
changes are worth landing ahead of this. The updates here are:

* Use `C:/` instead of `D:/` for submodule checkout since it should have
  plenty of space and the 4-core machines won't have `D:/`

* Update `lzma-sys` to 0.1.14 which has support for VS2019, where 0.1.10
  doesn't.

* Update `src/ci/docker/run.sh` to work when it itself is running inside
  of a docker container (see the comment in the file for more info)

* Print step timings on the `try` branch in addition to the `auto`
  branch in. The logs there should be seen by similarly many humans (not
  many) and can be useful for performance analysis after a `try` build
  runs.

* Install the WIX and InnoSetup tools manually on Windows instead of
  relying on pre-installed copies on the VM. This gives us more control
  over what's being used on the Azure cloud right now (we control the
  version) and in the 4-core machines these won't be pre-installed. Note
  that on AppVeyor we actually already were installing InnoSetup, we
  just didn't carry that over on Azure!
Diffstat (limited to 'src')
-rwxr-xr-xsrc/ci/docker/run.sh46
-rwxr-xr-xsrc/ci/run.sh2
2 files changed, 41 insertions, 7 deletions
diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh
index dea41bee6e0..7d3f013ea01 100755
--- a/src/ci/docker/run.sh
+++ b/src/ci/docker/run.sh
@@ -125,26 +125,60 @@ fi
 # goes ahead and sets it for all builders.
 args="$args --privileged"
 
-exec docker \
+# Things get a little weird if this script is already running in a docker
+# container. If we're already in a docker container then we assume it's set up
+# to do docker-in-docker where we have access to a working `docker` command.
+#
+# If this is the case (we check via the presence of `/.dockerenv`)
+# then we can't actually use the `--volume` argument. Typically we use
+# `--volume` to efficiently share the build and source directory between this
+# script and the container we're about to spawn. If we're inside docker already
+# though the `--volume` argument maps the *host's* folder to the container we're
+# about to spawn, when in fact we want the folder in this container itself. To
+# work around this we use a recipe cribbed from
+# https://circleci.com/docs/2.0/building-docker-images/#mounting-folders to
+# create a temporary container with a volume. We then copy the entire source
+# directory into this container, and then use that copy in the container we're
+# about to spawn. Finally after the build finishes we re-extract the object
+# directory.
+#
+# Note that none of this is necessary if we're *not* in a docker-in-docker
+# scenario. If this script is run on a bare metal host then we share a bunch of
+# data directories to share as much data as possible. Note that we also use
+# `LOCAL_USER_ID` (recognized in `src/ci/run.sh`) to ensure that files are all
+# read/written as the same user as the bare-metal user.
+if [ -f /.dockerenv ]; then
+  docker create -v /checkout --name checkout alpine:3.4 /bin/true
+  docker cp . checkout:/checkout
+  args="$args --volumes-from checkout"
+else
+  args="$args --volume $root_dir:/checkout:ro"
+  args="$args --volume $objdir:/checkout/obj"
+  args="$args --volume $HOME/.cargo:/cargo"
+  args="$args --volume $HOME/rustsrc:$HOME/rustsrc"
+  args="$args --env LOCAL_USER_ID=`id -u`"
+fi
+
+docker \
   run \
-  --volume "$root_dir:/checkout:ro" \
-  --volume "$objdir:/checkout/obj" \
   --workdir /checkout/obj \
   --env SRC=/checkout \
   $args \
   --env CARGO_HOME=/cargo \
   --env DEPLOY \
   --env DEPLOY_ALT \
-  --env LOCAL_USER_ID=`id -u` \
   --env CI \
   --env TF_BUILD \
   --env BUILD_SOURCEBRANCHNAME \
   --env TOOLSTATE_REPO_ACCESS_TOKEN \
   --env TOOLSTATE_REPO \
   --env CI_JOB_NAME="${CI_JOB_NAME-$IMAGE}" \
-  --volume "$HOME/.cargo:/cargo" \
-  --volume "$HOME/rustsrc:$HOME/rustsrc" \
   --init \
   --rm \
   rust-ci \
   /checkout/src/ci/run.sh
+
+if [ -f /.dockerenv ]; then
+  rm -rf $objdir
+  docker cp checkout:/checkout/obj $objdir
+fi
diff --git a/src/ci/run.sh b/src/ci/run.sh
index b40bef77665..1039343827d 100755
--- a/src/ci/run.sh
+++ b/src/ci/run.sh
@@ -25,7 +25,7 @@ source "$ci_dir/shared.sh"
 
 branch_name=$(getCIBranch)
 
-if [ ! isCI ] || [ "$branch_name" = "auto" ]; then
+if [ ! isCI ] || [ "$branch_name" = "auto" ] || [ "$branch_name" = "try" ]; then
     RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.print-step-timings --enable-verbose-tests"
 fi