forked from vadimcn/codelldb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
324 lines (282 loc) · 9.99 KB
/
azure-pipelines.yml
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
variables:
lldbBuildId: 2068
lldbBuildProject: 'llvm'
lldbBuildPipeline: 'lldb-build'
rustcVersion: '1.63.0'
cachePrefix: F
AZP_CACHING_CONTENT_FORMAT: SingleTar
AZP_CACHING_TAR: true
setenvLinux: |
export PATH=$HOME/.cargo/bin:$PATH
setenvOSX: |
export PATH=$HOME/.cargo/bin:$PATH
setenvWindows: |
set PATH=%USERPROFILE%\.cargo\bin;%PATH%
set PYTHONPATH=%PYTHONHOME%\Lib;%PYTHONHOME%\DLLs
########################################################################################################################
jobs:
- job: Linux
pool:
vmImage: 'ubuntu-20.04'
strategy:
matrix:
x86_64:
PlatformId: 'x86_64-linux'
Triple: 'x86_64-linux-gnu'
RustTarget: 'x86_64-unknown-linux-gnu'
CrossBuilding: false
arm:
PlatformId: 'arm-linux'
Triple: 'arm-linux-gnueabihf'
RustTarget: 'armv7-unknown-linux-gnueabihf'
CrossBuilding: true
aarch64:
PlatformId: 'aarch64-linux'
Triple: 'aarch64-linux-gnu'
RustTarget: 'aarch64-unknown-linux-gnu'
CrossBuilding: true
container:
image: 'vadimcn/linux-builder:latest'
options: --privileged
steps:
- script: |
rustup self update
rustup toolchain install $(rustcVersion)
rustup default $(rustcVersion)
rustup target add $(RustTarget)
rustup show
displayName: 'Install Rust'
- task: DownloadBuildArtifacts@0
inputs:
buildType: specific
project: $(lldbBuildProject)
pipeline: $(lldbBuildPipeline)
buildId: $(lldbBuildId)
buildVersionToDownload: specific
downloadType: single
artifactName: 'lldb--$(Triple)'
itemPattern: 'lldb--$(Triple)/lldb--$(Triple).zip'
downloadPath: '$(Agent.BuildDirectory)/D'
displayName: 'Download LLDB'
- task: Cache@2
inputs:
key: '$(cachePrefix) | $(Triple) | node_modules | package-lock.json'
path: $(Build.SourcesDirectory)/build/node_modules
continueOnError: true
displayName: Cache node_modules
condition: always()
- script: |
$(setenvLinux)
mkdir build
cd build
cmake -DVERSION_SUFFIX=$(versionSuffix)\
-DCMAKE_BUILD_TYPE=RelWithDebInfo\
-DTEST_TIMEOUT=30000\
-DLLDB_PACKAGE=$(Agent.BuildDirectory)/D/lldb--$(Triple)/lldb--$(Triple).zip\
-DCMAKE_TOOLCHAIN_FILE=$(Build.SourcesDirectory)/cmake/toolchain-$(Triple).cmake\
-DCMAKE_SYSROOT=/stretch\
..
cat CMakeCache.txt
displayName: 'Configure'
- script: |
$(setenvLinux)
cmake --build build --target vsix_bootstrap
cmake -E copy build/codelldb-bootstrap.vsix $(Build.ArtifactStagingDirectory)/codelldb-bootstrap.vsix
cmake -E copy build/package.json $(Build.ArtifactStagingDirectory)/package.json
displayName: 'Build bootstrap package'
condition: not(eq(variables.CrossBuilding, 'true'))
- script: |
$(setenvLinux)
cmake --build build --target vsix_full
cmake -E copy build/codelldb-full.vsix $(Build.ArtifactStagingDirectory)/codelldb-$(PlatformId).vsix
displayName: 'Build'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'codelldb-$(PlatformId)'
- script: |
$(setenvLinux)
cmake --build build --target check
displayName: 'Test'
condition: not(eq(variables.CrossBuilding, 'true'))
- script: |
cd $(Agent.BuildDirectory)
cat /proc/cpuinfo > system.log
cat /proc/meminfo >> system.log
env > env.log
ls -lR $(Agent.BuildDirectory) > build-tree.log
zip --recurse-patterns $(Agent.BuildDirectory)/$(Triple).zip "*.log" "CMakeCache.txt"
echo "##vso[artifact.upload artifactname=logs;]$(Agent.BuildDirectory)/$(Triple).zip"
displayName: 'Logs'
condition: always()
########################################################################################################################
- job: OSX
pool:
vmImage: 'macOS-11'
strategy:
matrix:
x86_64:
DeploymentTarget: '10.10'
PlatformId: 'x86_64-darwin'
Triple: 'x86_64-apple-darwin'
RustTarget: 'x86_64-apple-darwin'
CrossBuilding: false
aarch64:
DeploymentTarget: '11.0'
PlatformId: 'aarch64-darwin'
Triple: 'aarch64-apple-darwin'
RustTarget: 'aarch64-apple-darwin'
CrossBuilding: true
steps:
- task: DownloadBuildArtifacts@0
inputs:
buildType: specific
project: $(lldbBuildProject)
pipeline: $(lldbBuildPipeline)
buildId: $(lldbBuildId)
buildVersionToDownload: specific
downloadType: single
artifactName: 'lldb--$(Triple)'
itemPattern: 'lldb--$(Triple)/lldb--$(Triple).zip'
downloadPath: '$(Agent.BuildDirectory)/D'
displayName: 'Download LLDB'
- task: Cache@2
inputs:
key: '$(cachePrefix) | $(Triple) | node_modules | package-lock.json'
path: $(Build.SourcesDirectory)/build/node_modules
continueOnError: true
displayName: Cache node_modules
condition: always()
- task: NodeTool@0
inputs:
versionSpec: '14.x'
displayName: 'Install Node.js'
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -v -y --profile minimal --default-toolchain none
source $HOME/.cargo/env
rustup toolchain install $(rustcVersion)
rustup default $(rustcVersion)
rustup target add $(RustTarget)
rustup show
displayName: 'Install Rust'
- script: |
$(setenvOSX)
export MACOSX_DEPLOYMENT_TARGET=$(DeploymentTarget)
mkdir build
cd build
xcrun -sdk macosx cmake -DVERSION_SUFFIX=$(versionSuffix)\
-DCMAKE_BUILD_TYPE=RelWithDebInfo\
-DTEST_TIMEOUT=30000\
-DLLDB_PACKAGE=$(Agent.BuildDirectory)/D/lldb--$(Triple)/lldb--$(Triple).zip\
-DCMAKE_TOOLCHAIN_FILE=$(Build.SourcesDirectory)/cmake/toolchain-$(Triple).cmake\
..
cat CMakeCache.txt
displayName: 'Configure'
- script: |
$(setenvOSX)
export MACOSX_DEPLOYMENT_TARGET=$(DeploymentTarget)
xcrun -sdk macosx cmake --build build --target vsix_full
cmake -E copy build/codelldb-full.vsix $(Build.ArtifactStagingDirectory)/codelldb-$(PlatformId).vsix
displayName: 'Build'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'codelldb-$(PlatformId)'
- script: |
$(setenvOSX)
export MACOSX_DEPLOYMENT_TARGET=$(DeploymentTarget)
xcrun -sdk macosx cmake --build build --target check
displayName: 'Test'
condition: not(eq(variables.CrossBuilding, 'true'))
- script: |
cd $(Agent.BuildDirectory)
sysctl -a > system.log
env > env.log
ls -lR $(Agent.BuildDirectory) > build-tree.log
zip --recurse-patterns $(Agent.BuildDirectory)/$(Triple).zip "*.log" "CMakeCache.txt"
echo "##vso[artifact.upload artifactname=logs;]$(Agent.BuildDirectory)/$(Triple).zip"
displayName: 'Logs'
condition: always()
########################################################################################################################
- job: Windows
pool:
vmImage: 'windows-2019'
variables:
PlatformId: 'x86_64-windows'
Triple: 'x86_64-windows-msvc'
steps:
- task: NodeTool@0
inputs:
versionSpec: '14.x'
displayName: 'Install Node.js'
- task: DownloadBuildArtifacts@0
inputs:
buildType: specific
project: $(lldbBuildProject)
pipeline: $(lldbBuildPipeline)
buildId: $(lldbBuildId)
buildVersionToDownload: specific
downloadType: single
artifactName: 'lldb--$(Triple)'
itemPattern: 'lldb--$(Triple)/lldb--$(Triple).zip'
downloadPath: '$(Agent.BuildDirectory)/D'
displayName: 'Download LLDB'
- task: Cache@2
inputs:
key: '$(cachePrefix) | $(Triple) | node_modules | package-lock.json'
path: $(Build.SourcesDirectory)/build/node_modules
continueOnError: true
displayName: Cache node_modules
condition: always()
- task: BatchScript@1
inputs:
filename: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\Common7\\Tools\\VsDevCmd.bat"
arguments: -arch=amd64 -host_arch=amd64
modifyEnvironment: true
displayName: VsDevCmd
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -v -y --profile minimal --default-toolchain none
set PATH=%USERPROFILE%\.cargo\bin;%PATH%
rustup toolchain install $(rustcVersion)-x86_64-pc-windows-gnu
rustup default $(rustcVersion)-x86_64-pc-windows-gnu
rustup target add x86_64-pc-windows-msvc
rustup show
displayName: 'Install Rust'
- script: |
choco install ninja
choco install zip
displayName: 'Install other'
- script: |
$(setenvWindows)
mkdir build
cd build
cmake -GNinja^
-DVERSION_SUFFIX=$(versionSuffix)^
-DCMAKE_BUILD_TYPE=RelWithDebInfo^
-DTEST_TIMEOUT=30000^
-DLLDB_PACKAGE=$(Agent.BuildDirectory)/D/lldb--$(Triple)/lldb--$(Triple).zip^
-DCMAKE_TOOLCHAIN_FILE=$(Build.SourcesDirectory)/cmake/toolchain-x86_64-windows-msvc.cmake^
..
type CMakeCache.txt
displayName: 'Configure'
- script: |
$(setenvWindows)
cmake --build build --target vsix_full
cmake -E copy build/codelldb-full.vsix $(Build.ArtifactStagingDirectory)/codelldb-$(PlatformId).vsix
displayName: 'Build'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'codelldb-$(PlatformId)'
- script: |
$(setenvWindows)
cmake --build build --target check_adapter
displayName: 'Test'
- script: |
cd $(Agent.BuildDirectory)
set > env.log
ls -lR $(Agent.BuildDirectory) > build-tree.log
zip --recurse-patterns $(Agent.BuildDirectory)\$(Triple).zip "*.log" "CMakeCache.txt"
echo ##vso[artifact.upload artifactname=logs;]$(Agent.BuildDirectory)\$(Triple).zip
displayName: 'Logs'
condition: always()