Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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. See https://github.com/dotnet/runtime/issues/92290
$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) {
Expand Down Expand Up @@ -434,7 +442,14 @@ 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

$argumentsWithConfig = $arguments + " -configuration $titleCaseConfig";
foreach ($singleArch in $arch) {
$argumentsWithArch = "/p:TargetArchitecture=$singleArch " + $argumentsWithConfig
Invoke-Expression "& `"$PSScriptRoot/common/build.ps1`" $argumentsWithArch"
Expand Down
8 changes: 8 additions & 0 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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. See https://github.com/dotnet/runtime/issues/92290
MSBUILDDEBUGPATH="$scriptroot/../artifacts/log/${bootstrapConfig:-Debug}/MsbuildDebugLogs"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this use ${bootstrapConfig:-Debug} ? I would expect it to use actual config for non-bootstrap builds.

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=()
Expand Down
Loading