Skip to content

Set MSBUILDDEBUGPATH in CI so MSBuild crash diagnostics are preserved#126012

Merged
danmoseley merged 2 commits intodotnet:mainfrom
danmoseley:msbuild-debugpath-ci
Mar 26, 2026
Merged

Set MSBUILDDEBUGPATH in CI so MSBuild crash diagnostics are preserved#126012
danmoseley merged 2 commits intodotnet:mainfrom
danmoseley:msbuild-debugpath-ci

Conversation

@danmoseley
Copy link
Copy Markdown
Member

@danmoseley danmoseley commented Mar 24, 2026

Note

This PR was generated with the help of GitHub Copilot.

Set MSBUILDDEBUGPATH in CI so MSBuild crash diagnostics are preserved in more build types.

When MSBuild worker nodes crash during CI builds (see #92290), diagnostic MSBuild_*.failure.txt files are written to a system temp directory on the ephemeral build agent and lost when the agent is cleaned up. This makes it impossible to determine the root cause of the crashes.

Several component-specific build scripts (src/coreclr/build-runtime.sh, src/tests/build.sh, src/native/corehost/build.sh) already set MSBUILDDEBUGPATH to artifacts/log/<config>/MsbuildDebugLogs, but the top-level build invoked by the pipeline template (global-build-step.yml) does not. Build legs that don't go through one of those component scripts — such as the macOS libs/mono builds currently hitting #92290 — get the default temp dir.

This adds MSBUILDDEBUGPATH as a job-level pipeline variable in global-build-job.yml, pointing to the same artifacts/log/<config>/MsbuildDebugLogs path. The existing condition: always() log publishing step in job.yml already sweeps artifacts/log/, so the failure diagnostics will be automatically published as build artifacts the next time a crash occurs.

When MSBuild worker nodes crash during builds (dotnet#92290),
diagnostic failure.txt files are written to a system temp directory on
the ephemeral agent and lost. This sets MSBUILDDEBUGPATH to a path
under artifacts/log/ so the existing always-on log publishing step
picks them up automatically.

The coreclr build scripts already set this for their specific build
steps, but this covers all build legs including the macOS libs/mono
builds that are currently hitting the issue.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the CI global build job template to set MSBUILDDEBUGPATH so MSBuild crash diagnostics (e.g., MSBuild_*.failure.txt) are written under artifacts/log/... and can be published with build logs instead of being lost in ephemeral agent temp directories.

Changes:

  • Add a job-level MSBUILDDEBUGPATH pipeline variable in the global build job template.
  • Point MSBUILDDEBUGPATH at artifacts/log/<config>/MsbuildDebugLogs to align with existing log publishing.

@danmoseley
Copy link
Copy Markdown
Member Author

@copilot handle feedback

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@danmoseley
Copy link
Copy Markdown
Member Author

/ba-g unrelated build timeout

@danmoseley danmoseley enabled auto-merge (squash) March 26, 2026 13:54
@danmoseley
Copy link
Copy Markdown
Member Author

/ba-g build timeout

@danmoseley danmoseley merged commit 116bd0d into dotnet:main Mar 26, 2026
164 of 172 checks passed
@danmoseley danmoseley deleted the msbuild-debugpath-ci branch March 27, 2026 03:36
danmoseley added a commit to danmoseley/runtime that referenced this pull request Apr 12, 2026
…rash diagnostics

The MSBUILDDEBUGPATH pipeline variable added in PR dotnet#126012 is not reaching
the MSBuild process during Build product steps. Set the env var directly in
the build scripts, matching the existing pattern in build-runtime.sh and
tests/build.sh. Also create the directory with mkdir -p / New-Item -Force
to avoid issues with MSBuild's EnsureDirectoryExists (which has no try/catch
in its static constructor).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants