[devops] Upload MSBuild crash logs. (#21503)

When MSBuild crashes, MSBuild creates a log file and prints:

> error MSB4166: Child node "3" exited prematurely. Shutting down. Diagnostic information may be found in files in "/var/folders/52/tx7jvhs16x19bkdf030_nyww0000gn/T/MSBuildTempbuilder/" and will be named MSBuild_*.failure.txt. This location can be changed by setting the MSBUILDDEBUGPATH environment variable to a different directory.

However, these log files aren't accessible after a CI build has concluded, so
set the MSBUILDDEBUGPATH environment variable to the jenkins-results
directory, which will be uploaded as a build artifact.

This way we can inspect whatever made MSBuild fail in a CI build.
This commit is contained in:
Rolf Bjarne Kvinge 2024-10-24 16:55:06 +02:00 коммит произвёл GitHub
Родитель a6ca85f5fd
Коммит f9c18f4e4d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -42,3 +42,7 @@ steps:
displayName: 'Set Jenkins variables'
env:
BRANCH_NAME: $[ replace(variables['Build.SourceBranch'], 'refs/heads/', '') ]
# Write MSBuild logs into the jenkins-results directory, so they're uploaded after test runs.
- pwsh: Write-Host "##vso[task.setvariable variable=MSBUILDDEBUGPATH]$Env:SYSTEM_DEFAULTWORKINGDIRECTORY/$Env:BUILD_REPOSITORY_TITLE/jenkins-results/MSBuildCrashLogs"
displayName: 'Set MSBuild crash log directory'

Просмотреть файл

@ -59,3 +59,6 @@ variables:
# point to the vsdrops that we will be using for the diff uploads.
- name: VSDropsPrefix
value: 'https://vsdrop.corp.microsoft.com/file/v1/xamarin-macios/device-tests'
- name: BUILD_REPOSITORY_TITLE
value: 'xamarin-macios'