Upload logs on cmake generate/build failure (#5293)
* Upload logs on cmake generate/build failure * Copy relevant files to staging location, clean up after publishing * Update cspell words * Test: break cmake generate in a way that'll produce SOME log files. * Revert "Test: break cmake generate in a way that'll produce SOME log files." This reverts commit d5a300587b3359ed3f2bf7be5abea40868f958a7. * Show failure logs instead of uploading artifacts. Only show log files for vcpkg at this time * Reapply "Test: break cmake generate in a way that'll produce SOME log files." This reverts commit 582629ad587f3c9b652ac1f8a7eda5e12d46843a. * Revert "Reapply "Test: break cmake generate in a way that'll produce SOME log files."" This reverts commit 7a35250c7e598fc6e1c060f896cbc952704e40bf. * Another type of test * Revert inadvertent whitespace changes * Revert "Another type of test" This reverts commit e38013f95b152e4e2a3b9d27ccf1eb9b63fa1817. * More logging
This commit is contained in:
parent
5a70fcabce
commit
ce4f25da23
2
.vscode/cspell.json
vendored
2
.vscode/cspell.json
vendored
@ -201,6 +201,7 @@
|
||||
"rtti",
|
||||
"rwxrw",
|
||||
"sasia",
|
||||
"sbom",
|
||||
"Schonberger",
|
||||
"scus",
|
||||
"SDDL",
|
||||
@ -251,6 +252,7 @@
|
||||
"Wunused",
|
||||
"xbox",
|
||||
"Xclang",
|
||||
"xcode",
|
||||
"XSMB",
|
||||
"zulu"
|
||||
],
|
||||
|
||||
@ -184,6 +184,8 @@ jobs:
|
||||
VcpkgArgs: "$(VcpkgArgs)"
|
||||
Env: "$(CmakeEnvArg)"
|
||||
|
||||
- template: /eng/pipelines/templates/steps/show-failure-logs.yml
|
||||
|
||||
- template: /eng/common/testproxy/test-proxy-tool.yml
|
||||
parameters:
|
||||
runProxy: true
|
||||
|
||||
@ -92,3 +92,5 @@ jobs:
|
||||
GenerateArgs: ${{ cmakeOption.Value }}
|
||||
Env: "$(CmakeEnvArg)"
|
||||
PackageName: ${{ artifact.Name }}
|
||||
|
||||
- template: /eng/pipelines/templates/steps/show-failure-logs.yml
|
||||
|
||||
@ -125,6 +125,8 @@ jobs:
|
||||
BuildArgs: "$(BuildArgs)"
|
||||
Env: "$(CmakeEnvArg)"
|
||||
|
||||
- template: /eng/pipelines/templates/steps/show-failure-logs.yml
|
||||
|
||||
- template: /eng/common/TestResources/build-test-resource-config.yml
|
||||
parameters:
|
||||
SubscriptionConfiguration: ${{ parameters.CloudConfig.SubscriptionConfiguration }}
|
||||
|
||||
@ -24,6 +24,8 @@ steps:
|
||||
env:
|
||||
VCPKG_BINARY_SOURCES: $(VCPKG_BINARY_SOURCES_SECRET)
|
||||
|
||||
# The calling job will attempt to upload logs on failure. To that end this
|
||||
# step should ONLY run on success.
|
||||
- script: rm -rf build
|
||||
workingDirectory: ${{ parameters.CmakeGeneratePath }}
|
||||
displayName: clean build folder for ${{ parameters.PackageName }}
|
||||
|
||||
6
eng/pipelines/templates/steps/show-failure-logs.yml
Normal file
6
eng/pipelines/templates/steps/show-failure-logs.yml
Normal file
@ -0,0 +1,6 @@
|
||||
steps:
|
||||
- task: PowerShell@2
|
||||
condition: failed()
|
||||
displayName: Show build failure logs
|
||||
inputs:
|
||||
filePath: eng/scripts/Show-FailureLogs.ps1
|
||||
25
eng/scripts/Show-FailureLogs.ps1
Normal file
25
eng/scripts/Show-FailureLogs.ps1
Normal file
@ -0,0 +1,25 @@
|
||||
# Only show contents of particular vcpkg log files whose potentially sensitive
|
||||
# information will be redacted by DevOps (if it's included).
|
||||
|
||||
# Before adding other expressions to output ensure that those logs will not
|
||||
# contain sensitive information or that DevOps is properly configured to remove
|
||||
# sensitive information.
|
||||
|
||||
$logFiles = Get-ChildItem -Recurse -Filter *.log
|
||||
$filteredLogs = $logFiles.Where({ $_.Name -in ('vcpkg-bootstrap.log', 'vcpkg-manifest-install.log') })
|
||||
|
||||
if (!$filteredLogs) {
|
||||
Write-Host "No logs found"
|
||||
exit 0
|
||||
}
|
||||
|
||||
foreach ($logFile in $filteredLogs)
|
||||
{
|
||||
Write-Host "//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////"
|
||||
Write-Host "=============================================================================================================================="
|
||||
Write-Host "Log file: $logFile"
|
||||
Write-Host "=============================================================================================================================="
|
||||
Get-Content $logFile | Write-Host
|
||||
}
|
||||
|
||||
exit 0
|
||||
Loading…
Reference in New Issue
Block a user