Skip to content

Fix SOS managed hosting runtime selection - #6030

Closed
hoyosjs wants to merge 3 commits into
mainfrom
juhoyosa/sos-host-dependencies
Closed

hoyosjs wants to merge 3 commits into
mainfrom
juhoyosa/sos-host-dependencies

Conversation

@hoyosjs

@hoyosjs hoyosjs commented Sep 14, 2026

Copy link
Copy Markdown
Member

Prioritize .NET 10, then 11, 9, 8, and 12 when selecting a runtime to host SOS managed extensions.

Define the framework assembly overrides shared by the native host and tests. Include System.Diagnostics.DiagnosticSource and System.IO.Pipelines based on their shared-framework introduction, and validate the native SOS layout against every configured host runtime so new version conflicts fail CI.

Prioritize .NET 10, then 11, 9, 8, and 12 when selecting a runtime to host SOS managed extensions.

Define the framework assembly overrides shared by the native host and tests. Include System.Diagnostics.DiagnosticSource and System.IO.Pipelines based on their shared-framework introduction, and validate the native SOS layout against every configured host runtime so new version conflicts fail CI.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 24deab87-ef2a-4528-9796-4890dc51785a
Copilot AI lite review requested due to automatic review settings September 14, 2026 22:36
@hoyosjs
hoyosjs requested a review from a team as a code owner September 14, 2026 22:36

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

Two moderate findings remain regarding runtime-selection coverage and validation of every configured runtime.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR updates SOS managed hosting runtime selection and centralizes framework assembly overrides for the native host and tests.

Changes:

  • Prioritizes .NET 10, 11, 9, 8, then 12.
  • Shares framework assembly override definitions.
  • Adds SOS layout/runtime compatibility validation.
File summaries
File Summary
src/tests/SOS.UnitTests/SOSHostRuntimeTests.cs Validates layout assemblies against host runtimes. Moderate finding: cover each non-single-file configuration instead of grouping by major (3 votes).
src/tests/SOS.UnitTests/SOS.UnitTests.csproj Embeds shared assembly override metadata for tests.
src/SOS/extensions/hostruntimeassemblylist.inc Defines shared framework assembly compatibility ranges.
src/SOS/extensions/hostcoreclr.cpp Updates runtime probing and assembly overrides. Moderate finding: add a test confirming .NET 10 is selected before the other supported runtimes (1 vote).
Review details

Suppressed comments (1)

src/SOS/extensions/hostcoreclr.cpp:75

  • This changes the production runtime-probing precedence, but the added test only validates TPA override metadata; it never asserts which runtime InitializeHosting selects. A regression in this array's order could therefore pass CI, so add a focused integration/unit test that makes multiple supported runtimes available and checks that 10 is selected before 11/9/8/12.
    constexpr RuntimeVersion SupportedHostRuntimeVersions[] = {
        {10, 0},
        {11, 0},
        {9, 0},
        {8, 0},
  • Files reviewed: 4/4 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

hoyosjs and others added 2 commits September 14, 2026 16:03
Validate every configured non-single-file host runtime and keep the production probing order in shared data covered by a focused test.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 24deab87-ef2a-4528-9796-4890dc51785a
Enumerate the runtime configurations generated for the test environment instead of duplicating the production supported-runtime list in test data.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 24deab87-ef2a-4528-9796-4890dc51785a
@hoyosjs hoyosjs closed this Sep 15, 2026
@hoyosjs
hoyosjs deleted the juhoyosa/sos-host-dependencies branch September 15, 2026 19:18
max-charlamb pushed a commit that referenced this pull request Sep 16, 2026
Combine the host-runtime probing and TPA override fixes from #6030 with
target-framework-specific managed SOS payloads. Desktop CLR loads
`net462`, while CoreCLR 8-12 loads `net8.0` and the host selects
packaged framework assemblies only when the installed runtime is too old
to satisfy them.

The split is required for the overrides to be safe: CoreCLR 8 and 9 now
receive DiagnosticSource 10 and Pipelines from the SDK-selected
`lib/net8.0` assets instead of their `netstandard2.0` implementations.
Packaging preserves both payloads under `lib/<tfm>` and fails when
either payload is missing. There are no command or public API breaking
changes; the internal SOS package layout now includes target-framework
subdirectories.

Manually verified HTTP symbol download with the final override payload
on .NET 8.0.29 and .NET 9.0.18. The focused host-runtime override tests
pass for all four configured runtimes.

---------

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: a92a6889-a841-40da-8516-669fdc594b6f
Copilot-Session: 24deab87-ef2a-4528-9796-4890dc51785a
Copilot-Session: 58910d4b-200b-4437-a5bc-d02cfb42bc20
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants