Set MSBUILDDEBUGPATH in CI so MSBuild crash diagnostics are preserved#126012
Set MSBUILDDEBUGPATH in CI so MSBuild crash diagnostics are preserved#126012danmoseley wants to merge 1 commit intodotnet:mainfrom
Conversation
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>
|
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
There was a problem hiding this comment.
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
MSBUILDDEBUGPATHpipeline variable in the global build job template. - Point
MSBUILDDEBUGPATHatartifacts/log/<config>/MsbuildDebugLogsto align with existing log publishing.
|
|
||
| # Capture MSBuild crash diagnostics so they are published with build logs | ||
| - name: MSBUILDDEBUGPATH | ||
| value: $(Build.SourcesDirectory)/artifacts/log/${{ parameters.buildConfig }}/MsbuildDebugLogs |
There was a problem hiding this comment.
parameters.buildConfig is typically passed as lowercase (e.g., release), while the build/publish infrastructure uses the cased $(_BuildConfig) (e.g., Release) for artifacts/log/$(_BuildConfig). On macOS/Linux this would send MSBuild crash diagnostics to artifacts/log/release/..., which won’t be swept by the existing log-gathering step (and may create a parallel directory). Consider basing this path on $(_BuildConfig)/$(buildConfigUpper) instead, and ensure the target directory exists before the build so MSBuild can write the failure files.
| value: $(Build.SourcesDirectory)/artifacts/log/${{ parameters.buildConfig }}/MsbuildDebugLogs | |
| value: $(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/MsbuildDebugLogs |
Note
This PR was generated with the help of GitHub Copilot.
Set
MSBUILDDEBUGPATHin CI so MSBuild crash diagnostics are preserved in more build types.When MSBuild worker nodes crash during CI builds (see #92290), diagnostic
MSBuild_*.failure.txtfiles 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 setMSBUILDDEBUGPATHtoartifacts/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
MSBUILDDEBUGPATHas a job-level pipeline variable inglobal-build-job.yml, pointing to the sameartifacts/log/<config>/MsbuildDebugLogspath. The existingcondition: always()log publishing step injob.ymlalready sweepsartifacts/log/, so the failure diagnostics will be automatically published as build artifacts the next time a crash occurs.