Skip to content

Commit e3cebcb

Browse files
committed
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!
2 parents 527dce7 + 9b4f6de commit e3cebcb

File tree

5 files changed

+71
-13
lines changed

5 files changed

+71
-13
lines changed

Diff for: .azure-pipelines/steps/install-windows-build-deps.yml

+25
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,29 @@
11
steps:
2+
# We use the WIX toolset to create combined installers for Windows, and these
3+
# binaries are downloaded from
4+
# https://github.com/wixtoolset/wix3 originally
5+
- bash: |
6+
set -e
7+
curl -O https://rust-lang-ci2.s3-us-west-1.amazonaws.com/rust-ci-mirror/wix311-binaries.zip
8+
echo "##vso[task.setvariable variable=WIX]`pwd`/wix"
9+
mkdir -p wix/bin
10+
cd wix/bin
11+
7z x ../../wix311-binaries.zip
12+
displayName: Install wix
13+
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
14+
15+
# We use InnoSetup and its `iscc` program to also create combined installers.
16+
# Honestly at this point WIX above and `iscc` are just holdovers from
17+
# oh-so-long-ago and are required for creating installers on Windows. I think
18+
# one is MSI installers and one is EXE, but they're not used so frequently at
19+
# this point anyway so perhaps it's a wash!
20+
- script: |
21+
powershell -Command "$ProgressPreference = 'SilentlyContinue'; iwr -outf is-install.exe https://rust-lang-ci2.s3.amazonaws.com/rust-ci-mirror/2017-08-22-is.exe"
22+
is-install.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
23+
echo ##vso[task.prependpath]C:\Program Files (x86)\Inno Setup 5
24+
displayName: Install InnoSetup
25+
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
26+
227
# We've had issues with the default drive in use running out of space during a
328
# build, and it looks like the `C:` drive has more space than the default `D:`
429
# drive. We should probably confirm this with the azure pipelines team at some

Diff for: .azure-pipelines/steps/run.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ steps:
111111
condition: and(succeeded(), not(variables.SKIP_JOB), ne(variables['Agent.OS'], 'Windows_NT'))
112112
displayName: Check out submodules (Unix)
113113
- script: |
114-
if not exist D:\cache\rustsrc\NUL mkdir D:\cache\rustsrc
115-
sh src/ci/init_repo.sh . /d/cache/rustsrc
114+
if not exist C:\cache\rustsrc\NUL mkdir C:\cache\rustsrc
115+
sh src/ci/init_repo.sh . /c/cache/rustsrc
116116
condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['Agent.OS'], 'Windows_NT'))
117117
displayName: Check out submodules (Windows)
118118

Diff for: Cargo.lock

+3-4
Original file line numberDiff line numberDiff line change
@@ -1547,11 +1547,10 @@ dependencies = [
15471547

15481548
[[package]]
15491549
name = "lzma-sys"
1550-
version = "0.1.10"
1550+
version = "0.1.14"
15511551
source = "registry+https://github.com/rust-lang/crates.io-index"
15521552
dependencies = [
15531553
"cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)",
1554-
"filetime 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
15551554
"libc 0.2.54 (registry+https://github.com/rust-lang/crates.io-index)",
15561555
"pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
15571556
]
@@ -4282,7 +4281,7 @@ name = "xz2"
42824281
version = "0.1.5"
42834282
source = "registry+https://github.com/rust-lang/crates.io-index"
42844283
dependencies = [
4285-
"lzma-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
4284+
"lzma-sys 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
42864285
]
42874286

42884287
[[package]]
@@ -4437,7 +4436,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
44374436
"checksum log_settings 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19af41f0565d7c19b2058153ad0b42d4d5ce89ec4dbf06ed6741114a8b63e7cd"
44384437
"checksum lsp-codec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "169d737ad89cf8ddd82d1804d9122f54568c49377665157277cc90d747b1d31a"
44394438
"checksum lsp-types 0.57.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b62b77309737b1e262b3bbf37ff8faa740562c633b14702afe9be85dbcb6f88a"
4440-
"checksum lzma-sys 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d1eaa027402541975218bb0eec67d6b0412f6233af96e0d096d31dbdfd22e614"
4439+
"checksum lzma-sys 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "16b5c59c57cc4d39e7999f50431aa312ea78af7c93b23fbb0c3567bd672e7f35"
44414440
"checksum mac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4"
44424441
"checksum macro-utils 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2c4deaccc2ead6a28c16c0ba82f07d52b6475397415ce40876e559b0b0ea510"
44434442
"checksum maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43"

Diff for: src/ci/docker/run.sh

+40-6
Original file line numberDiff line numberDiff line change
@@ -125,26 +125,60 @@ fi
125125
# goes ahead and sets it for all builders.
126126
args="$args --privileged"
127127

128-
exec docker \
128+
# Things get a little weird if this script is already running in a docker
129+
# container. If we're already in a docker container then we assume it's set up
130+
# to do docker-in-docker where we have access to a working `docker` command.
131+
#
132+
# If this is the case (we check via the presence of `/.dockerenv`)
133+
# then we can't actually use the `--volume` argument. Typically we use
134+
# `--volume` to efficiently share the build and source directory between this
135+
# script and the container we're about to spawn. If we're inside docker already
136+
# though the `--volume` argument maps the *host's* folder to the container we're
137+
# about to spawn, when in fact we want the folder in this container itself. To
138+
# work around this we use a recipe cribbed from
139+
# https://circleci.com/docs/2.0/building-docker-images/#mounting-folders to
140+
# create a temporary container with a volume. We then copy the entire source
141+
# directory into this container, and then use that copy in the container we're
142+
# about to spawn. Finally after the build finishes we re-extract the object
143+
# directory.
144+
#
145+
# Note that none of this is necessary if we're *not* in a docker-in-docker
146+
# scenario. If this script is run on a bare metal host then we share a bunch of
147+
# data directories to share as much data as possible. Note that we also use
148+
# `LOCAL_USER_ID` (recognized in `src/ci/run.sh`) to ensure that files are all
149+
# read/written as the same user as the bare-metal user.
150+
if [ -f /.dockerenv ]; then
151+
docker create -v /checkout --name checkout alpine:3.4 /bin/true
152+
docker cp . checkout:/checkout
153+
args="$args --volumes-from checkout"
154+
else
155+
args="$args --volume $root_dir:/checkout:ro"
156+
args="$args --volume $objdir:/checkout/obj"
157+
args="$args --volume $HOME/.cargo:/cargo"
158+
args="$args --volume $HOME/rustsrc:$HOME/rustsrc"
159+
args="$args --env LOCAL_USER_ID=`id -u`"
160+
fi
161+
162+
docker \
129163
run \
130-
--volume "$root_dir:/checkout:ro" \
131-
--volume "$objdir:/checkout/obj" \
132164
--workdir /checkout/obj \
133165
--env SRC=/checkout \
134166
$args \
135167
--env CARGO_HOME=/cargo \
136168
--env DEPLOY \
137169
--env DEPLOY_ALT \
138-
--env LOCAL_USER_ID=`id -u` \
139170
--env CI \
140171
--env TF_BUILD \
141172
--env BUILD_SOURCEBRANCHNAME \
142173
--env TOOLSTATE_REPO_ACCESS_TOKEN \
143174
--env TOOLSTATE_REPO \
144175
--env CI_JOB_NAME="${CI_JOB_NAME-$IMAGE}" \
145-
--volume "$HOME/.cargo:/cargo" \
146-
--volume "$HOME/rustsrc:$HOME/rustsrc" \
147176
--init \
148177
--rm \
149178
rust-ci \
150179
/checkout/src/ci/run.sh
180+
181+
if [ -f /.dockerenv ]; then
182+
rm -rf $objdir
183+
docker cp checkout:/checkout/obj $objdir
184+
fi

Diff for: src/ci/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ source "$ci_dir/shared.sh"
2525

2626
branch_name=$(getCIBranch)
2727

28-
if [ ! isCI ] || [ "$branch_name" = "auto" ]; then
28+
if [ ! isCI ] || [ "$branch_name" = "auto" ] || [ "$branch_name" = "try" ]; then
2929
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.print-step-timings --enable-verbose-tests"
3030
fi
3131

0 commit comments

Comments
 (0)