Skip to content

Retarget cdac projects to NetCoreAppMinimum (net10) - #131551

Merged
noahfalk merged 4 commits into
mainfrom
juhoyosa/cdac-netcoreappminimum-tfm
Jul 31, 2026
Merged

noahfalk merged 4 commits into
mainfrom
juhoyosa/cdac-netcoreappminimum-tfm

Conversation

@hoyosjs

@hoyosjs hoyosjs commented Jul 29, 2026 •

Copy link
Copy Markdown
Member

What

Moves all cdac product, tooling, and test projects under src/native/managed/cdac
from $(NetCoreAppToolCurrent) (net11) to $(NetCoreAppMinimum) (net10):

  • Microsoft.Diagnostics.DataContractReader (+ Abstractions, Contracts, Legacy)
  • mscordaccore_universal (NativeAOT component)
  • scripts/cdac-dump-inspect
  • tests: TestInfrastructure, DumpTests, StressTests, DataGenerator.Tests, UnitTests

Why

The cdac stack is source-shared with tools that can only build using released SDKs.
Targeting NetCoreAppMinimum (a released TFM) lets the whole stack build there.

Unchanged: debuggee target apps (CrossModuleLib + Debuggees) and
gen/DataGenerator (netstandard2.0).

Note

This PR was created with the assistance of GitHub Copilot.

Move all cdac product, tooling, and test projects under src/native/managed/cdac
from NetCoreAppToolCurrent to NetCoreAppMinimum so the whole stack targets a
released TFM and can be source-shared with a 10.0-only SDK repo.

At net10 the AOT component mscordaccore_universal uses the SDK-provided released
ILCompiler pack (live in-repo ILC is gated to net11), which is what the
source-share consumer wants.

Co-authored-by: Copilot App <[email protected]>
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
12 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.

Pull request overview

Retargets multiple cDAC projects under src/native/managed/cdac from $(NetCoreAppToolCurrent) to $(NetCoreAppMinimum) (net10) to enable building with a released .NET SDK.

Changes:

  • Updated cDAC product projects (Microsoft.Diagnostics.DataContractReader*) to target $(NetCoreAppMinimum).
  • Updated NativeAOT component mscordaccore_universal to target $(NetCoreAppMinimum).
  • Updated cDAC test projects and the cdac-dump-inspect tool script project to target $(NetCoreAppMinimum).

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader/Microsoft.Diagnostics.DataContractReader.csproj Retargets main DataContractReader project to $(NetCoreAppMinimum).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Microsoft.Diagnostics.DataContractReader.Abstractions.csproj Retargets Abstractions transport package to $(NetCoreAppMinimum).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Microsoft.Diagnostics.DataContractReader.Contracts.csproj Retargets Contracts transport package to $(NetCoreAppMinimum).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Microsoft.Diagnostics.DataContractReader.Legacy.csproj Retargets Legacy project to $(NetCoreAppMinimum).
src/native/managed/cdac/mscordaccore_universal/mscordaccore_universal.csproj Retargets NativeAOT runtime component project to $(NetCoreAppMinimum).
src/native/managed/cdac/scripts/cdac-dump-inspect.csproj Retargets dump inspection tool project to $(NetCoreAppMinimum).
src/native/managed/cdac/tests/TestInfrastructure/Microsoft.Diagnostics.DataContractReader.TestInfrastructure.csproj Retargets shared test infrastructure library to $(NetCoreAppMinimum).
src/native/managed/cdac/tests/UnitTests/Microsoft.Diagnostics.DataContractReader.Tests.csproj Retargets unit test project to $(NetCoreAppMinimum).
src/native/managed/cdac/tests/DumpTests/Microsoft.Diagnostics.DataContractReader.DumpTests.csproj Retargets dump test project to $(NetCoreAppMinimum).
src/native/managed/cdac/tests/StressTests/Microsoft.Diagnostics.DataContractReader.StressTests.csproj Retargets stress test project to $(NetCoreAppMinimum).
src/native/managed/cdac/tests/DataGenerator/Microsoft.Diagnostics.DataContractReader.DataGenerator.Tests.csproj Retargets generator test project to $(NetCoreAppMinimum).

CdacUnitTests CI runs in an environment that currently has only the net11 shared
framework available under the local .dotnet layout. Running the retargeted
net10 UnitTests fails before test execution with a missing Microsoft.NETCore.App
10.0 runtime.

Leave UnitTests on NetCoreAppToolCurrent for now so the required diagnostics
check remains green while the rest of the cdac stack in this PR stays on
NetCoreAppMinimum.

Co-authored-by: Copilot App <[email protected]>
Copilot AI review requested due to automatic review settings July 29, 2026 22:00

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.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

…stMajor

RollForward=LatestMajor lets the net10 test assembly run on the net11
runtime installed in CI, without requiring a net10 runtime to be present.

Co-authored-by: Copilot App <[email protected]>
Copilot AI review requested due to automatic review settings July 29, 2026 22:18

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.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (5)

src/native/managed/cdac/tests/DumpTests/Microsoft.Diagnostics.DataContractReader.DumpTests.csproj:9

  • Only the UnitTests project sets LatestMajor. If RollForward is required to run these tests on machines that don't have the net10 runtime installed (but do have newer runtimes), DumpTests should set the same RollForward so it can launch consistently.
  <PropertyGroup>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <TargetFramework>$(NetCoreAppMinimum)</TargetFramework>
    <Nullable>enable</Nullable>
    <IsTestProject>true</IsTestProject>
    <JsonSerializerIsReflectionEnabledByDefault>false</JsonSerializerIsReflectionEnabledByDefault>
    <NoWarn>$(NoWarn);xUnit1004</NoWarn>
  </PropertyGroup>

src/native/managed/cdac/tests/DataGenerator/Microsoft.Diagnostics.DataContractReader.DataGenerator.Tests.csproj:7

  • Only the UnitTests project sets LatestMajor. If RollForward is intentional for running net10-targeting tests on newer checkouts/runtimes, DataGenerator.Tests should also set it for consistency.
  <PropertyGroup>
    <TargetFramework>$(NetCoreAppMinimum)</TargetFramework>
    <Nullable>enable</Nullable>
    <IsTestProject>true</IsTestProject>
    <JsonSerializerIsReflectionEnabledByDefault>false</JsonSerializerIsReflectionEnabledByDefault>
  </PropertyGroup>

src/native/managed/cdac/scripts/cdac-dump-inspect.csproj:9

  • cdac-dump-inspect is an executable and was retargeted to $(NetCoreAppMinimum). If the goal is to make it runnable on checkouts that may not have the net10 runtime installed (but do have newer runtimes), consider setting LatestMajor here as well for consistency with the UnitTests project.
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>$(NetCoreAppMinimum)</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <NoWarn>$(NoWarn);NETCDAC0001</NoWarn>
  </PropertyGroup>

src/native/managed/cdac/tests/UnitTests/Microsoft.Diagnostics.DataContractReader.Tests.csproj:5

  • The PR description says all cDAC product/tooling/test projects under src/native/managed/cdac are moved off $(NetCoreAppToolCurrent), but there are still projects in this folder tree targeting $(NetCoreAppToolCurrent) (e.g. tests/UsageTests/Microsoft.Diagnostics.DataContractReader.Usage.Tests.csproj, tools/CdacUsageGraph/src/CdacUsageGraph/CdacUsageGraph.csproj, tools/CdacUsageGraph/tests/CdacUsageGraph.Tests/CdacUsageGraph.Tests.csproj). Either retarget those as well or clarify in the PR description which projects are intentionally excluded (and why).
    <TargetFramework>$(NetCoreAppMinimum)</TargetFramework>
    <RollForward>LatestMajor</RollForward>

src/native/managed/cdac/tests/StressTests/Microsoft.Diagnostics.DataContractReader.StressTests.csproj:7

  • Only the UnitTests project sets LatestMajor. If the intent is to make cDAC tests runnable on checkouts where the target runtime (net10.0) isn't installed (common when building with a newer SDK/runtime), the other test projects should set the same RollForward to avoid partial success (UnitTests runs, but other test assemblies fail to launch).
  <PropertyGroup>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <TargetFramework>$(NetCoreAppMinimum)</TargetFramework>
    <Nullable>enable</Nullable>
    <IsTestProject>true</IsTestProject>
  </PropertyGroup>

DataGenerator.Tests, DumpTests, and StressTests also generate a
runtimeconfig.json that pins net10.0. The CI Helix machines only have
net11.0 installed, so without RollForward=LatestMajor the host refuses
to launch the test runner.

Co-authored-by: Copilot App <[email protected]>
Copilot AI review requested due to automatic review settings July 29, 2026 23:51

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.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (2)

src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader/Microsoft.Diagnostics.DataContractReader.csproj:5

  • The PR description claims all cdac product/tooling/test projects under src/native/managed/cdac were moved from $(NetCoreAppToolCurrent) to $(NetCoreAppMinimum), but there are still projects in this subtree targeting $(NetCoreAppToolCurrent) (e.g., tests/UsageTests/Microsoft.Diagnostics.DataContractReader.Usage.Tests.csproj, tools/CdacUsageGraph/src/CdacUsageGraph/CdacUsageGraph.csproj, and its test csproj). Either those projects should be retargeted as well, or the PR description should be narrowed to match the actual scope.
  <PropertyGroup>
    <TargetFramework>$(NetCoreAppMinimum)</TargetFramework>
    <RootNamespace>Microsoft.Diagnostics.DataContractReader</RootNamespace>

src/native/managed/cdac/scripts/cdac-dump-inspect.csproj:6

  • cdac-dump-inspect is an executable that the PowerShell wrapper runs via dotnet run (scripts/cdac-dump-inspect.ps1). After retargeting to $(NetCoreAppMinimum) it will fail to run on repo checkouts whose installed runtime is newer (e.g., net11 toolset in global.json) unless you set RollForward (same pattern already used by the cdac test projects).
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>$(NetCoreAppMinimum)</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>

@noahfalk
noahfalk merged commit c77d463 into main Jul 31, 2026
72 checks passed
@noahfalk
noahfalk deleted the juhoyosa/cdac-netcoreappminimum-tfm branch July 31, 2026 09:21
@am11

am11 commented Jul 31, 2026

Copy link
Copy Markdown
Member

This broke OpenBSD CI. Bootstrap legs didn't ran as part of this PR but main is broken.

@jkotas, @MichalStrehovsky, I think this breaks our "always newest AOT in runtime repo" as it will keep using .NET 10's AOT package for next year or so to publish cDAC. Is this want we want? How would we onboard new platform to cDAC; wait two years after enabling AOTSupported?

@jkotas

jkotas commented Aug 1, 2026

Copy link
Copy Markdown
Member

From the PR description

The cdac stack is source-shared with tools that can only build using released SDKs.
Targeting NetCoreAppMinimum (a released TFM) lets the whole stack build there.

We do not plan to ship cdac binaries from dotnet/runtime. The cdac binaries built in dotnet/runtime are really just for testing. It should be fine to target NetCoreAppToolCurrent when NetCoreAppMinimum is not available.

@am11

am11 commented Aug 1, 2026

Copy link
Copy Markdown
Member

The discussion around toolAot.targets LKG work was that it will pick a single AOT toolchain for the entire runtime repo. This PR is changing that two years later. It is unclear if it's unintentional (i.e. the ILCompiler part in all cDAC shared lib publishing is an invariant where latest framework shouldn't matter), or intentional that it does matter for some compliance/subjective reasoning? @hoyosjs, please fix #131680 as you see fit.

@jkotas

jkotas commented Aug 1, 2026

Copy link
Copy Markdown
Member

I am going to revert this change for now so that this is not failing in every other PR

jkotas added a commit that referenced this pull request Aug 2, 2026
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-rc1 milestone Aug 2, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants