1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
parameters:
buildConfig: ''
nameSuffix: ''
buildArgs: ''
archType: ''
osGroup: ''
osSubgroup: ''
container: ''
crossBuild: false
crossrootfsDir: ''
variables: []
targetRid: ''
timeoutInMinutes: ''
dependsOn: []
pool: ''
platform: ''
pgoType: ''
condition: true
useContinueOnErrorDuringBuild: false
shouldContinueOnError: false
dependOnEvaluatePaths: false
isOfficialBuild: false
buildingOnSourceBuildImage: false
runtimeFlavor: 'coreclr'
runtimeVariant: ''
helixQueues: ''
enablePublishTestResults: false
testResultsFormat: ''
extraStepsTemplate: ''
extraStepsParameters: {}
enableRichCodeNavigation: false
richCodeNavigationLanguage: 'csharp'
richCodeNavigationEnvironment: 'production'
jobs:
- template: /eng/common/templates/job/job.yml
parameters:
name: ${{ format('build_{0}{1}_{2}_{3}_{4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.nameSuffix) }}
displayName: ${{ format('Build {0}{1} {2} {3} {4}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.nameSuffix) }}
pool: ${{ parameters.pool }}
container: ${{ parameters.container }}
condition: and(succeeded(), ${{ parameters.condition }})
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
enablePublishTestResults: ${{ parameters.enablePublishTestResults }}
testResultsFormat: ${{ parameters.testResultsFormat }}
workspace:
clean: all
enableRichCodeNavigation: ${{ parameters.enableRichCodeNavigation }}
richCodeNavigationLanguage: ${{ parameters.richCodeNavigationLanguage }}
richCodeNavigationEnvironment: ${{ parameters.richCodeNavigationEnvironment }}
${{ if and(ne(parameters.dependOnEvaluatePaths, true),ne(parameters.dependsOn,'')) }}:
dependsOn: ${{ parameters.dependsOn }}
${{ if eq(parameters.dependOnEvaluatePaths, true) }}:
dependsOn:
- evaluate_paths
- ${{ if ne(parameters.dependsOn,'') }}:
- ${{ parameters.dependsOn }}
variables:
- name: _osParameter
value: -os ${{ parameters.osGroup }}
- ${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.osSubGroup, '_musl')) }}:
- name: _osParameter
value: /p:RuntimeOS=linux-musl /p:OutputRid=linux-musl-${{ parameters.archType }}
# Do not rename as it clashes with MSBuild property in libraries/build-native.proj
- name: _crossBuildPropertyArg
value: /p:CrossBuild=${{ parameters.crossBuild }}
- name: _cxx11Parameter
${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.archType, 'arm64')) }}:
value: /p:MonoLLVMUseCxx11Abi=true
${{ if and(eq(parameters.osGroup, 'Linux'), not(eq(parameters.archType, 'arm64'))) }}:
value: /p:MonoLLVMUseCxx11Abi=false
- name: _officialBuildParameter
${{ if eq(parameters.isOfficialBuild, true) }}:
value: /p:OfficialBuildId=$(Build.BuildNumber)
${{ if ne(parameters.isOfficialBuild, true) }}:
value: ''
- name: _buildDarwinFrameworksParameter
${{ if in(parameters.osGroup, 'iOS', 'tvOS', 'MacCatalyst')}}:
value: /p:BuildDarwinFrameworks=true
${{ if notin(parameters.osGroup, 'iOS', 'tvOS', 'MacCatalyst')}}:
value: ''
- name: _richCodeNavigationParam
${{ if eq(parameters.enableRichCodeNavigation, true) }}:
value: /p:EnableRichCodeNavigation=true
${{ if ne(parameters.enableRichCodeNavigation, true) }}:
value: ''
- name: _sclEnableCommand
${{ if eq(parameters.buildingOnSourceBuildImage, true) }}:
value: scl enable llvm-toolset-7.0 --
${{ if ne(parameters.buildingOnSourceBuildImage, true) }}:
value: ''
- ${{ each variable in parameters.variables }}:
- ${{ variable }}
steps:
- checkout: self
clean: true
fetchDepth: $(checkoutFetchDepth)
- ${{ if eq(parameters.isOfficialBuild, true) }}:
- template: /eng/pipelines/common/restore-internal-tools.yml
- ${{ each monoCrossAOTTargetOS in parameters.monoCrossAOTTargetOS }}:
- task: DownloadPipelineArtifact@2
displayName: Download ${{monoCrossAOTTargetOS}} AOT offset files
inputs:
artifact: Mono_Offsets_${{monoCrossAOTTargetOS}}
path: '$(Build.SourcesDirectory)/artifacts/obj/mono/offsetfiles'
- ${{ if eq(parameters.buildingOnSourceBuildImage, true) }}:
- template: /eng/common/templates/steps/source-build.yml
parameters:
platform:
buildScript: $(_sclEnableCommand) $(Build.SourcesDirectory)$(dir)build$(scriptExt)
nonPortable: true
- ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS', 'MacCatalyst') }}:
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh ${{ parameters.osGroup }} ${{ parameters.archType }} azDO
displayName: Install Build Dependencies
- script: |
du -sh $(Build.SourcesDirectory)/*
df -h
displayName: Disk Usage before Build
- ${{ if eq(parameters.nameSuffix, 'Browser_wasm_Windows') }}:
# Update machine certs
- task: PowerShell@2
displayName: Update machine certs
inputs:
filePath: $(Build.SourcesDirectory)/eng/pipelines/mono/update-machine-certs.ps1
- script: $(Build.SourcesDirectory)\eng\common\init-tools-native.cmd -InstallDirectory $(Build.SourcesDirectory)\native-tools -Force
displayName: Install native dependencies
# Build
- ${{ if eq(parameters.buildingOnSourceBuildImage, false) }}:
- script: $(_sclEnableCommand) $(Build.SourcesDirectory)$(dir)build$(scriptExt) -ci -arch ${{ parameters.archType }} $(_osParameter) ${{ parameters.buildArgs }} $(_officialBuildParameter) $(_crossBuildPropertyArg) $(_cxx11Parameter) $(_richCodeNavigationParam) $(_buildDarwinFrameworksParameter)
displayName: Build product
${{ if eq(parameters.useContinueOnErrorDuringBuild, true) }}:
continueOnError: ${{ parameters.shouldContinueOnError }}
- ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS', 'Android') }}:
- script: |
du -sh $(Build.SourcesDirectory)/*
df -h
displayName: Disk Usage after Build
condition: always()
# If intended to send extra steps after regular build add them here.
- ${{ if ne(parameters.extraStepsTemplate, '') }}:
- template: ${{ parameters.extraStepsTemplate }}
parameters:
osGroup: ${{ parameters.osGroup }}
osSubgroup: ${{ parameters.osSubgroup }}
archType: ${{ parameters.archType }}
buildConfig: ${{ parameters.buildConfig }}
runtimeFlavor: ${{ parameters.runtimeFlavor }}
runtimeVariant: ${{ parameters.runtimeVariant }}
helixQueues: ${{ parameters.helixQueues }}
targetRid: ${{ parameters.targetRid }}
nameSuffix: ${{ parameters.nameSuffix }}
platform: ${{ parameters.platform }}
pgoType: ${{ parameters.pgoType }}
shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
${{ insert }}: ${{ parameters.extraStepsParameters }}
- task: PublishBuildArtifacts@1
displayName: Publish Logs
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/'
PublishLocation: Container
ArtifactName: Logs_Build_${{ parameters.osGroup }}_${{ parameters.osSubGroup }}_${{ parameters.archType }}_${{ parameters.buildConfig }}_${{ parameters.nameSuffix }}
continueOnError: true
condition: always()
|