Repository navigation
Retarget cdac projects to NetCoreAppMinimum (net10) - #131551
Conversation
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: 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. |
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
There was a problem hiding this comment.
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_universalto target$(NetCoreAppMinimum). - Updated cDAC test projects and the
cdac-dump-inspecttool 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]>
…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]>
There was a problem hiding this comment.
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]>
There was a problem hiding this comment.
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/cdacwere 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 setRollForward(same pattern already used by the cdac test projects).
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>$(NetCoreAppMinimum)</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
|
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? |
|
From the PR description
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. |
|
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. |
|
I am going to revert this change for now so that this is not failing in every other PR |
What
Moves all cdac product, tooling, and test projects under
src/native/managed/cdacfrom
$(NetCoreAppToolCurrent)(net11) to$(NetCoreAppMinimum)(net10):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) andgen/DataGenerator(netstandard2.0).Note
This PR was created with the assistance of GitHub Copilot.