Repository navigation
Expand file tree
/
Copy pathnightly-extended.yml
More file actions
333 lines (290 loc) · 12.5 KB
/
Copy pathnightly-extended.yml
File metadata and controls
333 lines (290 loc) · 12.5 KB
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
325
326
327
328
329
330
331
332
333
trigger: none
pr: none
schedules:
# Runs after nightly.yml (23:00 UTC) so the two pipelines don't compete for parallel jobs.
- cron: "0 1 * * 2-6"
displayName: Nightly Extended Build
branches:
include:
- master
always: true
parameters:
# Number of parallel jobs the Win32 sanitizer validation tests are split across.
- name: win32ValidationShards
type: number
default: 4
values: [1, 2, 3, 4, 6, 8]
variables:
# Absorb transient npm registry / CDN flakes during `npm install` in Apps/CMakeLists.txt.
npm_config_fetch_retries: 5
# Slow, non-blocking nightly jobs. Nothing consumes this pipeline's artifacts, so a failure here
# doesn't affect the packages that nightly.yml publishes for Babylon.js.
# Includes native Win32/macOS sanitizer builds and standalone runtime sanitizer coverage.
jobs:
- job: Win32_x64_D3D11_Sanitizers_Build
displayName: Win32 x64 D3D11 V8 Sanitizers Build
pool:
vmImage: 'windows-2022'
timeoutInMinutes: 90
steps:
- checkout: self
- script: |
cmake -G "Visual Studio 17 2022" -B build/Win32_x64_V8 -A x64 -D NAPI_JAVASCRIPT_ENGINE=V8 -D BX_CONFIG_DEBUG=ON -D GRAPHICS_API=D3D11 -D BABYLON_DEBUG_TRACE=ON -D BABYLON_NATIVE_PLUGIN_NATIVEDRACO=ON -D BABYLON_NATIVE_PLUGIN_NATIVEMESHOPT=ON -D ENABLE_SANITIZERS=ON
displayName: 'Generate solution'
- script: |
cmake --build build/Win32_x64_V8 --config RelWithDebInfo -- /m
displayName: 'Build'
- task: CopyFiles@2
inputs:
sourceFolder: 'build\Win32_x64_V8\Apps\Playground\RelWithDebInfo'
contents: |
**
!**\*.ilk
!**\*.lib
!**\*.exp
targetFolder: '$(Build.ArtifactStagingDirectory)\Playground'
cleanTargetFolder: true
displayName: 'Stage Playground'
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)\Playground'
artifact: Win32_x64_V8-sanitizer-playground
displayName: 'Publish Playground for validation shards'
- script: |
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\UnitTests.exe" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\UnitTests.exe" /v DumpType /t REG_DWORD /d 2 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\UnitTests.exe" /v DumpCount /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\UnitTests.exe" /v DumpFolder /t REG_SZ /d "$(Build.ArtifactStagingDirectory)/Dumps" /f
displayName: 'Enable Crash Dump'
- powershell: |
$vs = vswhere -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
$msvc = Get-ChildItem "$vs\VC\Tools\MSVC" | Sort-Object Name -Descending | Select-Object -First 1
$asanPath = "$($msvc.FullName)\bin\Hostx64\x64"
Write-Host "Adding ASAN runtime folder to PATH: $asanPath"
Write-Host "##vso[task.prependpath]$asanPath"
displayName: 'Add ASAN runtime DLLs to PATH'
- script: |
for /f %%i in ('vswhere -property instanceId') do (
reg add HKCU\Software\Microsoft\VisualStudio\Debugger\JIT\{F200A7E7-DEA5-11D0-B854-00A0244A1DE2}\%%i /f /v Disabled /t REG_DWORD /d 1
)
displayName: 'Disable JIT Debugger for Script'
- script: |
UnitTests
workingDirectory: 'build\Win32_x64_V8\Apps\UnitTests\RelWithDebInfo'
displayName: 'Unit Tests'
- script: JsRuntimeHostUnitTests.exe
workingDirectory: 'build\Win32_x64_V8\Dependencies\JsRuntimeHost\Tests\UnitTests\RelWithDebInfo'
displayName: 'JsRuntimeHost Unit Tests'
- script: UrlLibTests.exe
workingDirectory: 'build\Win32_x64_V8\Dependencies\UrlLib\Tests\RelWithDebInfo'
displayName: 'UrlLib Unit Tests'
- task: CopyFiles@2
inputs:
sourceFolder: 'build\Win32_x64_V8\Apps\UnitTests\RelWithDebInfo'
contents: UnitTests.*
targetFolder: "$(Build.ArtifactStagingDirectory)/Dumps"
cleanTargetFolder: false
displayName: "Stage UnitTests Crash Dump"
condition: failed()
- task: PublishBuildArtifacts@1
inputs:
artifactName: "Win32 Sanitizers UnitTests Crash Dumps"
pathtoPublish: "$(Build.ArtifactStagingDirectory)/Dumps"
displayName: "Publish Crash Dumps"
condition: failed()
# Visual validation is the slowest part of the sanitizer build (~75 minutes in a single job), so
# run it in parallel jobs. Each job takes every Nth config.json entry (interleaved, so slow tests
# spread out) via the Playground --test-index option.
- job: Win32_x64_D3D11_Sanitizers_Validation
displayName: Win32 x64 D3D11 V8 Sanitizers Validation
dependsOn: Win32_x64_D3D11_Sanitizers_Build
pool:
vmImage: 'windows-2022'
# Sized for win32ValidationShards=1 (the whole suite in one job, ~75 minutes).
timeoutInMinutes: 120
strategy:
parallel: ${{ parameters.win32ValidationShards }}
variables:
PlaygroundDirectory: '$(Pipeline.Workspace)\Playground'
steps:
- checkout: none
- task: DownloadPipelineArtifact@2
inputs:
buildType: current
artifactName: Win32_x64_V8-sanitizer-playground
targetPath: '$(PlaygroundDirectory)\RelWithDebInfo'
displayName: 'Download Playground'
- script: |
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\Playground.exe" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\Playground.exe" /v DumpType /t REG_DWORD /d 2 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\Playground.exe" /v DumpCount /t REG_DWORD /d 1 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\Playground.exe" /v DumpFolder /t REG_SZ /d "$(Build.ArtifactStagingDirectory)/Dumps" /f
displayName: 'Enable Crash Dump'
- powershell: |
$vs = vswhere -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
$msvc = Get-ChildItem "$vs\VC\Tools\MSVC" | Sort-Object Name -Descending | Select-Object -First 1
$asanPath = "$($msvc.FullName)\bin\Hostx64\x64"
Write-Host "Adding ASAN runtime folder to PATH: $asanPath"
Write-Host "##vso[task.prependpath]$asanPath"
displayName: 'Add ASAN runtime DLLs to PATH'
- script: |
for /f %%i in ('vswhere -property instanceId') do (
reg add HKCU\Software\Microsoft\VisualStudio\Debugger\JIT\{F200A7E7-DEA5-11D0-B854-00A0244A1DE2}\%%i /f /v Disabled /t REG_DWORD /d 1
)
displayName: 'Disable JIT Debugger for Script'
- powershell: |
$shard = [int]$env:SYSTEM_JOBPOSITIONINPHASE - 1
$shardCount = [int]$env:SYSTEM_TOTALJOBSINPHASE
$testCount = (Get-Content -Raw Scripts\config.json | ConvertFrom-Json).tests.Count
$indices = @(0..($testCount - 1) | Where-Object { $_ % $shardCount -eq $shard })
if ($indices.Count -eq 0) {
Write-Host "No tests for shard $($shard + 1) of $shardCount."
exit 0
}
Write-Host "Shard $($shard + 1) of ${shardCount}: $($indices.Count) of $testCount config entries."
.\Playground.exe "--test-index=$($indices -join ',')" app:///Scripts/validation_native.js
exit $LASTEXITCODE
workingDirectory: '$(PlaygroundDirectory)\RelWithDebInfo'
displayName: 'Validation Tests'
- task: PublishBuildArtifacts@1
displayName: Upload Rendered Pictures
condition: succeededOrFailed()
inputs:
PathtoPublish: '$(PlaygroundDirectory)\Results'
ArtifactName: Win32_x64_V8-sanitizer-rendered-pictures-$(System.JobPositionInPhase)
continueOnError: true
- task: PublishBuildArtifacts@1
displayName: Upload Error Pictures
condition: failed()
inputs:
PathtoPublish: '$(PlaygroundDirectory)\Errors'
ArtifactName: Win32_x64_V8-sanitizer-error-pictures-$(System.JobPositionInPhase)
continueOnError: true
- task: CopyFiles@2
inputs:
sourceFolder: '$(PlaygroundDirectory)\RelWithDebInfo'
contents: Playground.*
targetFolder: "$(Build.ArtifactStagingDirectory)/Dumps"
cleanTargetFolder: false
displayName: "Stage Playground Crash Dump"
condition: failed()
- task: PublishBuildArtifacts@1
inputs:
artifactName: "Win32 Sanitizers Crash Dumps $(System.JobPositionInPhase)"
pathtoPublish: "$(Build.ArtifactStagingDirectory)/Dumps"
displayName: "Publish Crash Dumps"
condition: failed()
- job: MacOS_Sanitizers
displayName: macOS Sanitizers
pool:
vmImage: 'macOS-26'
timeoutInMinutes: 60
variables:
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1:symbolize=1
ASAN_OPTIONS: abort_on_error=1
steps:
- checkout: self
- script: sudo xcode-select --switch /Applications/Xcode_26.4.app/Contents/Developer
displayName: 'Select Xcode 26.4'
- script: |
cmake -G Xcode -B build/macOS \
-D BABYLON_DEBUG_TRACE=ON \
-D BABYLON_NATIVE_PLUGIN_NATIVEDRACO=ON \
-D BABYLON_NATIVE_PLUGIN_NATIVEMESHOPT=ON \
-D ENABLE_SANITIZERS=ON \
-D BABYLON_NATIVE_TESTS_USE_NOOP_METAL_DEVICE=ON
displayName: 'Generate macOS solution'
- script: cmake --build build/macOS --target Playground --config RelWithDebInfo
displayName: 'Build Playground macOS'
- script: cmake --build build/macOS --target UnitTests JsRuntimeHostUnitTests UrlLibTests --config RelWithDebInfo
displayName: 'Build UnitTests and component tests macOS'
- script: sudo sysctl -w kern.corefile=%N.core.%P
displayName: 'Enable Core Dump'
- script: |
ulimit -c unlimited
./UnitTests
workingDirectory: build/macOS/Apps/UnitTests/RelWithDebInfo
displayName: 'Run UnitTests macOS'
- script: |
ulimit -c unlimited
./JsRuntimeHostUnitTests
workingDirectory: build/macOS/Dependencies/JsRuntimeHost/Tests/UnitTests/RelWithDebInfo
displayName: 'JsRuntimeHost Unit Tests macOS'
- script: |
ulimit -c unlimited
./UrlLibTests
workingDirectory: build/macOS/Dependencies/UrlLib/Tests/RelWithDebInfo
displayName: 'UrlLib Unit Tests macOS'
- task: PublishBuildArtifacts@1
displayName: Upload UnitTests Core Dumps
condition: failed()
inputs:
PathtoPublish: 'build/macOS/Apps/UnitTests/RelWithDebInfo'
ArtifactName: macos-Xcode-default-sanitizer-core-dumps
- job: Linux_Runtime_Sanitizers
displayName: Linux runtime sanitizers
pool:
vmImage: 'ubuntu-24.04'
timeoutInMinutes: 60
strategy:
matrix:
AddressUndefined:
EnableSanitizers: 'ON'
EnableThreadSanitizer: 'OFF'
Thread:
EnableSanitizers: 'OFF'
EnableThreadSanitizer: 'ON'
variables:
UBSAN_OPTIONS: halt_on_error=1:print_stacktrace=1:symbolize=1
ASAN_OPTIONS: abort_on_error=1
steps:
- checkout: self
- script: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y libjavascriptcoregtk-4.1-dev libcurl4-openssl-dev ninja-build clang
displayName: Install runtime dependencies
- script: |
set -euo pipefail
cmake -S Dependencies/JsRuntimeHost -B Build/Runtime -G Ninja \
-D CMAKE_BUILD_TYPE=RelWithDebInfo \
-D CMAKE_C_COMPILER=clang \
-D CMAKE_CXX_COMPILER=clang++ \
-D ENABLE_SANITIZERS=$(EnableSanitizers) \
-D ENABLE_THREAD_SANITIZER=$(EnableThreadSanitizer)
cmake --build Build/Runtime --target UnitTests --parallel
displayName: Build runtime tests
- script: |
set -euo pipefail
ulimit -c unlimited
if [ "$(EnableThreadSanitizer)" = "ON" ]; then
export TSAN_OPTIONS="suppressions=$(Build.SourcesDirectory)/.github/tsan_suppressions.txt"
# JSC's Linux concurrent collector deadlocks under TSan's signal interception.
export JSC_useConcurrentGC=0
fi
./UnitTests
workingDirectory: Build/Runtime/Tests/UnitTests
displayName: Run runtime tests
- job: MacOS_Runtime_ThreadSanitizer
displayName: macOS runtime thread sanitizer
pool:
vmImage: 'macOS-26'
timeoutInMinutes: 60
steps:
- checkout: self
- script: sudo xcode-select --switch /Applications/Xcode_26.4.app/Contents/Developer
displayName: Select Xcode 26.4
- script: |
set -euo pipefail
cmake -S Dependencies/JsRuntimeHost -B Build/Runtime -G Xcode \
-D ENABLE_THREAD_SANITIZER=ON
cmake --build Build/Runtime --target UnitTests --config RelWithDebInfo
displayName: Build runtime tests
- script: |
set -euo pipefail
ulimit -c unlimited
./UnitTests
workingDirectory: Build/Runtime/Tests/UnitTests/RelWithDebInfo
env:
TSAN_OPTIONS: suppressions=$(Build.SourcesDirectory)/.github/tsan_suppressions.txt
displayName: Run runtime tests