Skip to content

Use released TFM for cDAC projects where supported - #131779

Open
hoyosjs wants to merge 3 commits into
mainfrom
juhoyosa/cdac-netcoreappminimum-tfm
Open

Use released TFM for cDAC projects where supported#131779
hoyosjs wants to merge 3 commits into
mainfrom
juhoyosa/cdac-netcoreappminimum-tfm

Conversation

@hoyosjs

@hoyosjs hoyosjs commented Aug 3, 2026

Copy link
Copy Markdown
Member

What

Defines CDacTfm for cDAC product, tooling, and test projects. It defaults to $(NetCoreAppMinimum) and uses $(NetCoreAppToolCurrent) for source-build and platforms unsupported by the released NativeAOT toolchain.

Runnable net10 outputs use RollForward=LatestMajor so they can run in repo environments containing only the current runtime.

Why

The cDAC stack is source-shared with tools that can only build using released SDKs. Targeting a released TFM where supported lets the stack build in those environments without regressing source-build or unsupported platforms.

Note

This PR was created with the assistance of GitHub Copilot.

hoyosjs added 2 commits August 3, 2026 13:15
Reverts f7a6366 so the released-TFM work can be adjusted for platforms that require the current in-repo NativeAOT toolchain.

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

Copilot-Session: d1410744-b19d-407e-b3e3-c7b4518d61f8
Centralize the cDAC target framework so product and test projects use the released minimum TFM by default while source-build and platforms missing from the released NativeAOT toolchain continue to use the current tool TFM.

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

Copilot-Session: d1410744-b19d-407e-b3e3-c7b4518d61f8
Copilot AI review requested due to automatic review settings August 3, 2026 23:53
@hoyosjs

hoyosjs commented Aug 3, 2026

Copy link
Copy Markdown
Member Author

/azp run runtime

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@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

This PR centralizes the cDAC target framework selection by introducing a CDacTfm property (defaulting to $(NetCoreAppMinimum)) and switches cDAC projects to target $(CDacTfm). It also sets RollForward=LatestMajor for runnable outputs when building against the released (older) TFM so they can execute in repo environments that only have the current runtime installed.

Changes:

  • Introduce CDacTfm in src/native/managed/cdac/Directory.Build.props and default it to $(NetCoreAppMinimum) with overrides for source-build / selected OSes.
  • Update cDAC product/tooling/test projects to use $(CDacTfm) for TargetFramework.
  • Add conditional RollForward=LatestMajor to runnable/test projects when targeting the released TFM.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/native/managed/cdac/Directory.Build.props Defines CDacTfm defaulting logic for the cDAC subtree.
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Microsoft.Diagnostics.DataContractReader.Abstractions.csproj Switches to TargetFramework=$(CDacTfm).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Microsoft.Diagnostics.DataContractReader.Contracts.csproj Switches to TargetFramework=$(CDacTfm).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader/Microsoft.Diagnostics.DataContractReader.csproj Switches to TargetFramework=$(CDacTfm).
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Legacy/Microsoft.Diagnostics.DataContractReader.Legacy.csproj Switches to TargetFramework=$(CDacTfm).
src/native/managed/cdac/mscordaccore_universal/mscordaccore_universal.csproj Switches to TargetFramework=$(CDacTfm) for the NativeAOT component.
src/native/managed/cdac/scripts/cdac-dump-inspect.csproj Switches to TargetFramework=$(CDacTfm) and adds conditional roll-forward for execution on newer runtimes.
src/native/managed/cdac/tests/DataGenerator/Microsoft.Diagnostics.DataContractReader.DataGenerator.Tests.csproj Switches to TargetFramework=$(CDacTfm) and adds conditional roll-forward.
src/native/managed/cdac/tests/DumpTests/Microsoft.Diagnostics.DataContractReader.DumpTests.csproj Switches to TargetFramework=$(CDacTfm) and adds conditional roll-forward.
src/native/managed/cdac/tests/StressTests/Microsoft.Diagnostics.DataContractReader.StressTests.csproj Switches to TargetFramework=$(CDacTfm) and adds conditional roll-forward.
src/native/managed/cdac/tests/TestInfrastructure/Microsoft.Diagnostics.DataContractReader.TestInfrastructure.csproj Switches to TargetFramework=$(CDacTfm).
src/native/managed/cdac/tests/UnitTests/Microsoft.Diagnostics.DataContractReader.Tests.csproj Switches to TargetFramework=$(CDacTfm) and adds conditional roll-forward.

Comment on lines +5 to +7
<!-- Source build and platforms absent from the released ILCompiler pack must use the in-repo NativeAOT toolchain. -->
<CDacTfm Condition="'$(CDacTfm)' == '' and ('$(DotNetBuildSourceOnly)' == 'true' or '$(TargetOS)' == 'haiku' or '$(TargetOS)' == 'illumos' or '$(TargetOS)' == 'openbsd' or '$(TargetOS)' == 'solaris')">$(NetCoreAppToolCurrent)</CDacTfm>
<CDacTfm Condition="'$(CDacTfm)' == ''">$(NetCoreAppMinimum)</CDacTfm>
Copilot AI review requested due to automatic review settings August 4, 2026 01:10

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 12 out of 12 changed files in this pull request and generated no new comments.

Suppressed comments (1)

src/native/managed/cdac/Directory.Build.props:7

  • CDacTfm is defined here, but several cDAC projects under this tree still hardcode $(NetCoreAppToolCurrent) (e.g., tests/UsageTests, tools/CdacUsageGraph (tool + tests), and StressTests debuggee projects). As a result, those projects won’t participate in the new “released TFM where supported” behavior described in the PR, and will continue to require the in-repo toolchain even on supported platforms.

Please either (1) switch the remaining cDAC csproj files to use $(CDacTfm) (adding RollForward where needed for runnable outputs), or (2) document why these specific projects must stay on $(NetCoreAppToolCurrent).

    <PropertyGroup>
      <!-- Source build and platforms absent from the released ILCompiler pack must use the in-repo NativeAOT toolchain. -->
      <CDacTfm Condition="'$(CDacTfm)' == '' and ('$(DotNetBuildSourceOnly)' == 'true' or '$(TargetOS)' == 'haiku' or '$(TargetOS)' == 'illumos' or '$(TargetOS)' == 'openbsd' or '$(TargetOS)' == 'netbsd' or '$(TargetOS)' == 'solaris')">$(NetCoreAppToolCurrent)</CDacTfm>
      <CDacTfm Condition="'$(CDacTfm)' == ''">$(NetCoreAppMinimum)</CDacTfm>

@jkoritzinsky

Copy link
Copy Markdown
Member

Is the plan to ship the cdac built against the released TFM or just validate that it builds against downlevel TFMs?

If it's the second, you can condition the "use current TFM" on "using bootstrap layout" and it will trigger for cases where you can't go downlevel and for the official builds, but not local builds.


<PropertyGroup>
<!-- Source build and platforms absent from the released ILCompiler pack must use the in-repo NativeAOT toolchain. -->
<CDacTfm Condition="'$(CDacTfm)' == '' and ('$(DotNetBuildSourceOnly)' == 'true' or '$(TargetOS)' == 'haiku' or '$(TargetOS)' == 'illumos' or '$(TargetOS)' == 'openbsd' or '$(TargetOS)' == 'netbsd' or '$(TargetOS)' == 'solaris')">$(NetCoreAppToolCurrent)</CDacTfm>

@am11 am11 Aug 4, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

missing freebsd, linux riscv64, loongarch64, s390x and ppc64le:

Suggested change
<CDacTfm Condition="'$(CDacTfm)' == '' and ('$(DotNetBuildSourceOnly)' == 'true' or '$(TargetOS)' == 'haiku' or '$(TargetOS)' == 'illumos' or '$(TargetOS)' == 'openbsd' or '$(TargetOS)' == 'netbsd' or '$(TargetOS)' == 'solaris')">$(NetCoreAppToolCurrent)</CDacTfm>
<CDacTfm Condition="'$(CDacTfm)' == '' and (
'$(DotNetBuildSourceOnly)' == 'true' or
'$(TargetOS)' == 'freebsd' or
'$(TargetOS)' == 'haiku' or
'$(TargetOS)' == 'illumos' or
'$(TargetOS)' == 'netbsd' or
'$(TargetOS)' == 'openbsd' or
'$(TargetOS)' == 'solaris' or
'$(TargetArchitecture)' == 'loongarch64' or
'$(TargetArchitecture)' == 'ppc64le' or
'$(TargetArchitecture)' == 'riscv64' or
'$(TargetArchitecture)' == 's390x')">$(NetCoreAppToolCurrent)</CDacTfm>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In SDK we define community platforms using reverse !(official list) logic https://github.com/dotnet/sdk/blob/c907364019eafdc8521bc82d3cf1acc3fc2197cd/src/Layout/Directory.Build.props#L109-L110. Maybe we should unify on that approach.

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.

4 participants