Skip to content

Commit 6dd074a

Browse files
committed
ci: extract parts of windows-build-deps into scripts
1 parent 1c0d764 commit 6dd074a

File tree

5 files changed

+68
-35
lines changed

5 files changed

+68
-35
lines changed

src/ci/azure-pipelines/steps/install-windows-build-deps.yml

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,4 @@
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-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/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-
echo ##vso[task.prependpath]C:\Program Files (x86)\Inno Setup 5
22-
curl.exe -o is-install.exe https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/2017-08-22-is.exe
23-
is-install.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
24-
displayName: Install InnoSetup
25-
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
26-
27-
# We've had issues with the default drive in use running out of space during a
28-
# build, and it looks like the `C:` drive has more space than the default `D:`
29-
# drive. We should probably confirm this with the azure pipelines team at some
30-
# point, but this seems to fix our "disk space full" problems.
31-
- script: |
32-
mkdir c:\MORE_SPACE
33-
mklink /J build c:\MORE_SPACE
34-
displayName: "Ensure build happens on C:/ instead of D:/"
35-
condition: and(succeeded(), eq(variables['Agent.OS'], 'Windows_NT'))
36-
372
- bash: git config --replace-all --global core.autocrlf false
383
displayName: "Disable git automatic line ending conversion (on C:/)"
394

src/ci/azure-pipelines/steps/run.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@ steps:
6969
displayName: Switch to Xcode 9.3
7070
condition: and(succeeded(), not(variables.SKIP_JOB))
7171

72+
- bash: src/ci/scripts/install-wix.sh
73+
env:
74+
AGENT_OS: $(Agent.OS)
75+
displayName: Install wix
76+
condition: and(succeeded(), not(variables.SKIP_JOB))
77+
78+
- bash: src/ci/scripts/install-innosetup.sh
79+
env:
80+
AGENT_OS: $(Agent.OS)
81+
displayName: Install InnoSetup
82+
condition: and(succeeded(), not(variables.SKIP_JOB))
83+
84+
- bash: src/ci/scripts/windows-symlink-build-dir.sh
85+
env:
86+
AGENT_OS: $(Agent.OS)
87+
displayName: Ensure the build happens on C:\ instead of D:\
88+
condition: and(succeeded(), not(variables.SKIP_JOB))
89+
7290
- template: install-windows-build-deps.yml
7391

7492
# Looks like docker containers have IPv6 disabled by default, so let's turn it

src/ci/scripts/install-innosetup.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
# We use InnoSetup and its `iscc` program to also create combined installers.
3+
# Honestly at this point WIX above and `iscc` are just holdovers from
4+
# oh-so-long-ago and are required for creating installers on Windows. I think
5+
# one is MSI installers and one is EXE, but they're not used so frequently at
6+
# this point anyway so perhaps it's a wash!
7+
8+
set -euo pipefail
9+
IFS=$'\n\t'
10+
11+
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
12+
13+
if isWindows; then
14+
curl.exe -o is-install.exe https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/2017-08-22-is.exe
15+
is-install.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-
16+
17+
ciCommandAddPath "C:\\Program Files (x86)\\Inno Setup 5"
18+
fi

src/ci/scripts/install-wix.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
# We use the WIX toolset to create combined installers for Windows, and these
3+
# binaries are downloaded from https://github.com/wixtoolset/wix3 originally
4+
5+
set -euo pipefail
6+
IFS=$'\n\t'
7+
8+
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
9+
10+
if isWindows; then
11+
curl -O https://rust-lang-ci-mirrors.s3-us-west-1.amazonaws.com/rustc/wix311-binaries.zip
12+
mkdir -p wix/bin
13+
cd wix/bin
14+
7z x ../../wix311-binaries.zip
15+
16+
ciCommandSetEnv WIX "$(pwd)/wix"
17+
fi
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
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+
7+
set -euo pipefail
8+
IFS=$'\n\t'
9+
10+
source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
11+
12+
if isWindows; then
13+
cmd //c "mkdir c:\\MORE_SPACE"
14+
cmd //c "mklink /J build c:\\MORE_SPACE"
15+
fi

0 commit comments

Comments
 (0)