-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Set MSBUILDDEBUGPATH in build scripts for reliable crash diagnostics #126806
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -380,6 +380,14 @@ $arguments += " /clp:ForceNoAlign" | |
| # The later changes are ignored when using the cache. | ||
| $env:DOTNETSDK_ALLOW_TARGETING_PACK_CACHING=0 | ||
|
|
||
| # Set up the directory for MSBuild debug logs, so that if MSBuild crashes (MSB4166) | ||
| # the failure.txt diagnostics are written to a known location under artifacts/log | ||
| # where they'll be captured as build artifacts. | ||
| $msbuildDebugLogsDir = "$PSScriptRoot/../artifacts/log/$((Get-Culture).TextInfo.ToTitleCase($configuration[0]))/MsbuildDebugLogs" | ||
| New-Item -ItemType Directory -Force -Path $msbuildDebugLogsDir | Out-Null | ||
| $env:MSBUILDDEBUGPATH = $msbuildDebugLogsDir | ||
| Write-Host "MSBUILDDEBUGPATH=$msbuildDebugLogsDir" | ||
|
|
||
| if ($bootstrap -eq $True) { | ||
|
|
||
| if ($actionPassedIn) { | ||
|
|
@@ -434,7 +442,15 @@ if ($bootstrap -eq $True) { | |
| $failedBuilds = @() | ||
|
|
||
| foreach ($config in $configuration) { | ||
| $argumentsWithConfig = $arguments + " -configuration $((Get-Culture).TextInfo.ToTitleCase($config))"; | ||
| $titleCaseConfig = $((Get-Culture).TextInfo.ToTitleCase($config)) | ||
|
|
||
| # Update MSBuild debug logs directory for this configuration. | ||
| $msbuildDebugLogsDir = "$PSScriptRoot/../artifacts/log/$titleCaseConfig/MsbuildDebugLogs" | ||
| New-Item -ItemType Directory -Force -Path $msbuildDebugLogsDir | Out-Null | ||
| $env:MSBUILDDEBUGPATH = $msbuildDebugLogsDir | ||
danmoseley marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Write-Host "MSBUILDDEBUGPATH=$msbuildDebugLogsDir" | ||
|
Comment on lines
+445
to
+451
|
||
|
|
||
| $argumentsWithConfig= $arguments + " -configuration $titleCaseConfig"; | ||
| foreach ($singleArch in $arch) { | ||
| $argumentsWithArch = "/p:TargetArchitecture=$singleArch " + $argumentsWithConfig | ||
| Invoke-Expression "& `"$PSScriptRoot/common/build.ps1`" $argumentsWithArch" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -635,6 +635,14 @@ cmakeargs="${cmakeargs// /%20}" | |
| arguments+=("/p:TargetArchitecture=$arch" "/p:BuildArchitecture=$hostArch") | ||
| arguments+=("/p:CMakeArgs=\"$cmakeargs\"" ${extraargs[@]+"${extraargs[@]}"}) | ||
|
|
||
| # Set up the directory for MSBuild debug logs, so that if MSBuild crashes (MSB4166) | ||
| # the failure.txt diagnostics are written to a known location under artifacts/log | ||
| # where they'll be captured as build artifacts. | ||
| MSBUILDDEBUGPATH="$scriptroot/../artifacts/log/${bootstrapConfig:-Debug}/MsbuildDebugLogs" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does this use |
||
| mkdir -p "$MSBUILDDEBUGPATH" | ||
| export MSBUILDDEBUGPATH | ||
| echo "MSBUILDDEBUGPATH=$MSBUILDDEBUGPATH" | ||
|
|
||
| if [[ "$bootstrap" == "1" ]]; then | ||
| # Strip build actions other than -restore and -build from the arguments for the bootstrap build. | ||
| bootstrapArguments=() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.