Skip to content

Commit fcdeefb

Browse files
authored
Merge pull request #903 from dagood/windows/2.1
Fix build on Windows up to Core-Setup, add CI leg
2 parents 3109126 + 14f9893 commit fcdeefb

28 files changed

+470
-230
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
jobs:
2+
- template: matrix.yml
3+
parameters:
4+
windowsPoolName: dotnet-internal-temp

.vsts.pipelines/builds/ci.yml

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,2 @@
1-
# Matrix build types:
2-
# Production: Only runs the build, not a tarball build. Called "production" because it's the part
3-
# used to produce tarballs. Some platforms might not be capable of producing a tarball yet: we
4-
# still call this type of build "production" for consistency.
5-
# Online: The leg produces a tarball then builds it while connected to the internet.
6-
# Offline: The leg produces a tarball then builds it offline. Network disconnected using Docker.
7-
81
jobs:
9-
- template: ../jobs/ci-linux.yml
10-
parameters:
11-
job: centos71
12-
imageName: microsoft/dotnet-buildtools-prereqs:centos-7-b46d863-20180719033416
13-
reportPrebuiltLeaks: true
14-
matrix:
15-
Production: {}
16-
Online: { type: Online }
17-
Offline: { type: Offline }
18-
Offline Portable: { type: Offline Portable }
19-
20-
- template: ../jobs/ci-linux.yml
21-
parameters:
22-
job: debian82
23-
imageName: microsoft/dotnet-buildtools-prereqs:debian-8.2-4e6e894-20181023212416
24-
matrix:
25-
Production: {}
26-
Online: { type: Online }
27-
28-
- template: ../jobs/ci-linux.yml
29-
parameters:
30-
job: fedora29
31-
imageName: microsoft/dotnet-buildtools-prereqs:fedora-29-2f0798a-20181105183801
32-
matrix:
33-
Production: {}
34-
Online: { type: Online }
35-
Offline: { type: Offline }
36-
Offline Portable: { type: Offline Portable }
37-
38-
- template: ../jobs/ci-linux.yml
39-
parameters:
40-
job: ubuntu1604
41-
imageName: microsoft/dotnet-buildtools-prereqs:ubuntu-16.04-c103199-20180628134544
42-
43-
- template: ../jobs/ci-osx.yml
2+
- template: matrix.yml

.vsts.pipelines/builds/matrix.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Matrix build types:
2+
# Production: Only runs the build, not a tarball build. Called "production" because it's the part
3+
# used to produce tarballs. Some platforms might not be capable of producing a tarball yet: we
4+
# still call this type of build "production" for consistency.
5+
# Online: The leg produces a tarball then builds it while connected to the internet.
6+
# Offline: The leg produces a tarball then builds it offline. Network disconnected using Docker.
7+
8+
parameters:
9+
windowsPoolName: dotnet-external-temp
10+
11+
jobs:
12+
- template: ../jobs/ci-linux.yml
13+
parameters:
14+
job: centos71
15+
imageName: microsoft/dotnet-buildtools-prereqs:centos-7-b46d863-20180719033416
16+
reportPrebuiltLeaks: true
17+
matrix:
18+
Production: {}
19+
Online: { type: Online }
20+
Offline: { type: Offline }
21+
Offline Portable: { type: Offline Portable }
22+
23+
- template: ../jobs/ci-linux.yml
24+
parameters:
25+
job: debian82
26+
imageName: microsoft/dotnet-buildtools-prereqs:debian-8.2-4e6e894-20181023212416
27+
matrix:
28+
Production: {}
29+
Online: { type: Online }
30+
31+
- template: ../jobs/ci-linux.yml
32+
parameters:
33+
job: fedora29
34+
imageName: microsoft/dotnet-buildtools-prereqs:fedora-29-2f0798a-20181105183801
35+
matrix:
36+
Production: {}
37+
Online: { type: Online }
38+
Offline: { type: Offline }
39+
Offline Portable: { type: Offline Portable }
40+
41+
- template: ../jobs/ci-linux.yml
42+
parameters:
43+
job: ubuntu1604
44+
imageName: microsoft/dotnet-buildtools-prereqs:ubuntu-16.04-c103199-20180628134544
45+
46+
- template: ../jobs/ci-local.yml
47+
parameters:
48+
job: osx
49+
pool:
50+
name: Hosted macOS
51+
buildScript: ./build.sh
52+
setupMac: true
53+
54+
- template: ../jobs/ci-local.yml
55+
parameters:
56+
job: windows
57+
pool:
58+
name: ${{ parameters.windowsPoolName }}
59+
buildScript: build.cmd
60+
setupWindows: true
61+
skipSmokeTest: true
62+
failOnPrebuiltBaselineError: false

.vsts.pipelines/jobs/ci-linux.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
steps:
4040
- template: ../steps/docker-cleanup-linux.yml
41-
- template: ../steps/calculate-config-flags-linux.yml
41+
- template: ../steps/calculate-config-flags.yml
4242

4343
# Create working directory and copy source into it.
4444
- script: |
@@ -50,7 +50,7 @@ jobs:
5050
cp -r . /root/sb/source-build'
5151
displayName: Clean sb directory and copy source from cloned directory
5252
53-
- template: ../steps/init-submodules-sh.yml
53+
- template: ../steps/init-submodules.yml
5454
parameters:
5555
commandPrefix: $(docker.run) $(docker.src.map) $(docker.src.work) $(imageName)
5656

.vsts.pipelines/jobs/ci-local.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
parameters:
2+
job: null
3+
matrix:
4+
Production: {}
5+
pool: null
6+
buildScript: null
7+
setupMac: false
8+
setupWindows: false
9+
skipSmokeTest: false
10+
failOnPrebuiltBaselineError: true
11+
12+
jobs:
13+
- job: ${{ parameters.job }}
14+
strategy:
15+
matrix: ${{ parameters.matrix }}
16+
pool: ${{ parameters.pool }}
17+
timeoutInMinutes: 240
18+
variables:
19+
args.build: >
20+
/p:Configuration=$(sb.configuration)
21+
/p:PortableBuild=$(sb.portable)
22+
/p:FailOnPrebuiltBaselineError=$(failOnPrebuiltBaselineError)
23+
/p:ProdConBlobFeedUrlPrefix=$(prodConBlobFeedUrlPrefix)
24+
args.smokeTest: >
25+
/t:RunSmokeTest
26+
/p:Configuration=$(sb.configuration)
27+
/p:ProdConBlobFeedUrlPrefix=$(prodConBlobFeedUrlPrefix)
28+
# Prefix to distinguish artifacts from different legs.
29+
artifactName: ${{ format('{0} $(type)', parameters.job) }}
30+
failOnPrebuiltBaselineError: ${{ parameters.failOnPrebuiltBaselineError }}
31+
logsDirectory: $(Build.ArtifactStagingDirectory)/logs
32+
SOURCE_BUILD_SKIP_SUBMODULE_CHECK: true
33+
# Default type, can be overridden by matrix legs.
34+
type: Production
35+
36+
steps:
37+
- checkout: self
38+
clean: true
39+
40+
# Make sure submodules from other branches are removed: pass extra f.
41+
- script: git clean -xdff
42+
displayName: Clean leftover submodules
43+
44+
- template: ../steps/check-space-powershell.yml
45+
46+
- ${{ if eq(parameters.setupMac, true) }}:
47+
- template: ../steps/setup-macos-native.yml
48+
- ${{ if eq(parameters.setupWindows, true) }}:
49+
- template: ../steps/setup-windows-bash.yml
50+
51+
- template: ../steps/calculate-config-flags.yml
52+
53+
- template: ../steps/init-submodules.yml
54+
55+
- template: ../steps/check-space-powershell.yml
56+
57+
# Build source-build.
58+
- script: ${{ format('{0} $(args.build)', parameters.buildScript) }}
59+
displayName: Build source-build
60+
timeoutInMinutes: 150
61+
62+
- template: ../steps/check-space-powershell.yml
63+
64+
# Run smoke tests.
65+
- ${{ if ne(parameters.skipSmokeTest, true) }}:
66+
- bash: ${{ format('{0} $(args.smokeTest)', parameters.buildScript) }}
67+
displayName: Run smoke-test
68+
69+
# Gather artifacts. Uses git bash on Windows.
70+
- bash: |
71+
set -x
72+
copyWithParents="cp {} --parents"
73+
if command -v rsync; then
74+
# On Mac, "--parents" isn't supported, but we can use rsync.
75+
copyWithParents="rsync -R {}"
76+
fi
77+
# Clean up previous build's staging dir, in case VSTS didn't do it.
78+
rm -rf "$(logsDirectory)"
79+
# Copy all these files to the logs dir, preserving relative path.
80+
mkdir -p "$(logsDirectory)"
81+
find . \( \
82+
-path './bin/*-report/*' -o \
83+
-path './bin/msbuild-debug/*' -o \
84+
-iname '*.binlog' -o \
85+
-iname '*.log' \) \
86+
-exec $copyWithParents "$(logsDirectory)" \;
87+
displayName: Copy logs to staging directory
88+
condition: always()
89+
continueOnError: true
90+
91+
# Publish artifacts.
92+
- task: PublishBuildArtifacts@1
93+
displayName: Publish Logs artifact
94+
condition: always()
95+
continueOnError: true
96+
inputs:
97+
PathtoPublish: $(logsDirectory)
98+
ArtifactName: Logs $(artifactName)
99+
ArtifactType: Container

.vsts.pipelines/jobs/ci-osx.yml

Lines changed: 0 additions & 105 deletions
This file was deleted.

.vsts.pipelines/steps/calculate-config-flags-linux.yml renamed to .vsts.pipelines/steps/calculate-config-flags.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
steps:
2-
- script: |
2+
- bash: |
33
setvariable() {
44
echo "Setting '$1' to '$2'"
55
echo "##vso[task.setvariable variable=$1;]$2"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
steps:
2+
- powershell: |
3+
$g = 1024 * 1024 * 1024;
4+
echo "Name`tAvailable (GiB)`tTotal (GiB)"
5+
[System.IO.DriveInfo]::GetDrives() |
6+
%{ echo "$($_.Name)`t$($_.AvailableFreeSpace / $g)`t$($_.TotalSize / $g)" }
7+
displayName: (Diag) Check drive fullness
8+
condition: always()
9+
continueOnError: true

.vsts.pipelines/steps/init-submodules-sh.yml renamed to .vsts.pipelines/steps/init-submodules.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ parameters:
33

44
steps:
55
# Fetch vsts commits if building internally.
6-
- script: |
6+
- bash: |
77
set -x
88
# Ignore failure for the first command. It will intentionally fail if the commit is only
99
# available in VSTS. "submodule update --init" is the simplest way to set up the submodule
@@ -17,7 +17,7 @@ steps:
1717
condition: and(succeeded(), ne(variables['user.PAT'], ''))
1818
1919
# Initialize submodules.
20-
- script: |
20+
- bash: |
2121
set -x
2222
$commandPrefix git submodule update --init --recursive
2323
displayName: Initialize submodules
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
steps:
2+
- script: |
3+
setvariable() {
4+
(
5+
set +x
6+
echo "Setting '$1' to '$2'"
7+
echo "##vso[task.setvariable variable=$1;]$2"
8+
)
9+
}
10+
set -x
11+
# Install macOS native dependencies not present in hosted pool.
12+
# Based on https://github.com/sbomer/coreclr/blob/dc2fa1b96415f87d694e5b6e751e38ca6fbd09a1/unix-pipeline.yml#L36-L39
13+
brew install icu4c openssl
14+
brew link --force icu4c
15+
# Follow https://github.com/dotnet/corefx/blob/master/Documentation/building/unix-instructions.md#user-content-macos
16+
brew install cmake pkgconfig openssl
17+
brew_openssl_paths=$(brew info openssl | cut -d ' ' -f 1 | grep '^/.*/openssl/')
18+
# Use 'for' to get last/latest openssl install dir.
19+
for openssl_path in $brew_openssl_paths; do :; done
20+
setvariable OPENSSL_ROOT_DIR "$openssl_path"
21+
displayName: Install native dependencies

0 commit comments

Comments
 (0)