Skip to content

Fix runtime diagnostics SOS test configuration - #133734

Merged
max-charlamb merged 4 commits into
mainfrom
dev/max-charlamb/fix-runtime-diagnostics-sos
Sep 14, 2026
Merged

max-charlamb merged 4 commits into
mainfrom
dev/max-charlamb/fix-runtime-diagnostics-sos

Conversation

@max-charlamb

@max-charlamb max-charlamb commented Sep 11, 2026

Copy link
Copy Markdown
Member

Fix the runtime-diagnostics SOS test configuration so it uses a coherent set of runtime, cDAC, and DBI artifacts.

  • Build the interpreter debuggee assets when interpreter testing is enabled.
  • Publish and restore the cDAC transport package produced by the runtime build, keeping the matching universal cDAC and DBI together.
  • Continue exercising strict cDAC-only mode, with a separate forced-DAC comparison leg.

Strict cDAC-only coverage

The cDAC leg still passes -dacMode cdac. Diagnostics maps this to runtimes --usecdac true, selecting OnlyUseCDac: supported runtimes must use standalone cDAC and SOS may not fall back to a legacy DAC.

DualRuntimes also remains covered in this strict mode. dotnet/diagnostics#6026 updates the test for the expected desktop .NET Framework behavior: selecting the desktop runtime succeeds, but its data-access commands must fail because desktop Framework does not support cDAC and fallback is disabled. This preserves the multi-runtime test without weakening the cDAC-only policy.

The separate DAC leg passes -dacMode dac and provides explicit legacy-DAC comparison coverage.

Matching cDAC transport package

The cDAC and universal DBI must match the runtime being tested. The pipeline keeps them coherent as follows:

  1. The shared runtime job builds CoreCLR, cDAC, and DBI together and produces runtime.win-x64.Microsoft.DotNet.Cdac.Transport.<version>.nupkg.
  2. That job selects exactly one non-symbol transport package and publishes it as BuildArtifacts_windows_x64_Release_cdac.
  3. The strict cDAC job downloads that artifact into a clean workspace, derives the exact package version from its filename, and exposes the downloaded directory as a local NuGet source.
  4. The diagnostics build receives /p:PackageWithCDac=true, the filename-derived runtimewinx64MicrosoftDotNetCdacTransportVersion, and /p:RestoreAdditionalProjectSources=<downloaded artifact>.
  5. Diagnostics' InstallNativePackages.targets restores that exact transport-package version and copies both mscordaccore_universal.dll and mscordbi_universal.dll beside SOS. The runtime itself comes from the corresponding same-build CoreCLR artifact through liveRuntimeDir.

As an artifact-level check, the SHA-256 of mscordaccore_universal.dll inside validation build 1593212's transport package exactly matched the copy in that build's CoreCLR artifact (63E8DFFB...33B27B8). The package also contains the matching same-build mscordbi_universal.dll.

Validation

  • Parsed all modified YAML files successfully.
  • git diff --check passes.
  • Runtime-diagnostics build 1593582 succeeded using this PR with diagnosticsBranch=refs/pull/6026/merge.
  • Both cDAC_windows_x64_release and DAC_windows_x64_release passed.
  • The cDAC leg used strict OnlyUseCDac together with the transport package produced by the same runtime build.

Addresses #133282. Related to #132073 and dotnet/diagnostics#6026.

Note

This pull request description was generated with GitHub Copilot.

Max Charlamb added 3 commits September 11, 2026 13:08
Publish and restore the runtime-produced cDAC transport package so SOS uses a matching universal DAC and DBI pair. Run the diagnostics build and test phases separately to avoid forwarding build switches into the test invocation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7b2ca30d-742d-402c-8ba5-afec8b6d69a1
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 7b2ca30d-742d-402c-8ba5-afec8b6d69a1
Use diagnostics' default PreferCDac policy while restoring the matching cDAC transport package produced by the runtime build. Keep the explicit DAC leg for comparison.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 54f4d112-cbd7-48a7-a105-160bb69fa22d
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The pipeline changes require final human validation of artifact matching and diagnostics execution.

Pull request overview

Updates the runtime-diagnostics SOS pipeline to use matching runtime, cDAC, and DBI artifacts.

Changes:

  • Publishes and restores the runtime-built cDAC transport package.
  • Builds interpreter debuggee assets.
  • Adds PreferCDac and forced-DAC test legs.
  • Separates diagnostics build and test phases.
File summaries
File Summary
eng/pipelines/runtime-diagnostics.yml Publishes cDAC artifacts and updates SOS legs.
eng/pipelines/diagnostics/sos-test-leg.yml Configures matching cDAC package handling.
eng/pipelines/diagnostics/runtime-diag-job.yml Restores dependencies and separates build/test execution.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Lite

Use diagnostics' cDAC-only DualRuntimes coverage while continuing to restore the matching runtime-built cDAC transport package.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 54f4d112-cbd7-48a7-a105-160bb69fa22d

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Test-only/build-only behavior is no longer honored, and the intended PreferCDac leg still forces cdac.

Get a fresh assessment by requesting another Copilot review.

Review details

Suppressed comments (1)

eng/pipelines/diagnostics/runtime-diag-job.yml:239

  • Splitting the old combined invocation into unconditional Build and Test tasks removes the existing testOnly/buildOnly behavior: regardless of those parameters this template now always runs both tasks. Any caller relying on a test-only or build-only diagnostics job will regress; keep the task conditions/arguments keyed off those parameters, or remove the parameters and their validation if this template is intentionally no longer reusable for those modes.
    - powershell: |
        & "$(Build.SourcesDirectory)\eng\build.ps1" `
          -test `
          -skipnative `
          -skipmanaged `
  • Files reviewed: 3/3 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread eng/pipelines/runtime-diagnostics.yml
@max-charlamb

Copy link
Copy Markdown
Member Author

/ba-g fixes most of the SOSTest failures. Last failure will be fixed when dotnet/diagnostics#6026 merges

@max-charlamb
max-charlamb merged commit ca8ebfb into main Sep 14, 2026
182 of 185 checks passed
@max-charlamb
max-charlamb deleted the dev/max-charlamb/fix-runtime-diagnostics-sos branch September 14, 2026 14:46
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants