Uh oh!
There was an error while loading. Please reload this page.
[cDAC] Use locally-built crossgen2 for dump test debuggees - #127561
Conversation
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Pull request overview
This PR fixes dump-test debuggee ReadyToRun (R2R) version-skew by ensuring the dump-test debuggees are R2R-compiled using the locally-built crossgen2 that matches the runtime under test, and by flowing the runtime build configuration into the debuggee publish step so crossgen2 is resolved from the correct artifacts directory.
Changes:
- Import
eng/targetingpacks.targetsfor DumpTests debuggee projects soUpdateLocalCrossgen2Packredirects crossgen2 to the in-repo build output (instead of the SDK pack). - Pass
/p:RuntimeConfiguration=...to debuggeedotnet publishinvocations so crossgen2 lookup uses the intended CoreCLR artifacts configuration (e.g., checked vs release).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/native/managed/cdac/tests/DumpTests/DumpTests.targets | Threads RuntimeConfiguration into debuggee publish so crossgen2 is resolved from the correct locally-built artifacts layout. |
src/native/managed/cdac/tests/DumpTests/Debuggees/Directory.Build.targets | Imports eng/targetingpacks.targets to activate local crossgen2 pack redirection for debuggee R2R publishing. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Import targetingpacks.targets and tests.readytorun.targets (via AfterMicrosoftNETSdkTargets) in debuggee Directory.Build.targets to ensure R2R publish uses the locally-built crossgen2 instead of the SDK's bundled version. Propagate RuntimeConfiguration, TargetArchitecture, TargetOS, and BuildArchitecture to child dotnet-publish so that crossgen2 and runtime pack paths resolve correctly in cross-build scenarios. Pass RuntimeConfiguration=Checked from the pipeline YAML so that BuildDebuggeesOnly finds crossgen2 under the Checked artifacts path. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6ad3960 to
1bb0e4bComparemax-charlamb
commented
Apr 30, 2026
/ba-g cDAC only change |
Uh oh!
There was an error while loading. Please reload this page.
Note
This PR was created with the assistance of GitHub Copilot (AI-generated content).
Problem
The
AsyncContinuationDumpTests(and potentially other R2R dump tests) fail in CI because the debuggee apps are R2R-compiled with the SDK's bundled crossgen2 instead of the locally-built one. When the locally-built runtime removes or changes types between previews (e.g. PR #127336 removingExecutionAndSyncBlockStore), the SDK's crossgen2 emits R2R thunks referencing types that no longer exist, causingTypeLoadExceptionor null globals at runtime.Root Cause
Two issues prevent the locally-built crossgen2 from being used:
NuGet pack layout mismatch: The SDK's
ResolveReadyToRunCompilerstask expects crossgen2 atPackagePath/tools/crossgen2.exe(NuGet pack layout), but the local build produces a flat layout withcrossgen2.exeat the root ofCrossgen2InBuildDir.targetingpacks.targetsalone cannot fix this because it only updatesPackageDirectorywithout restructuring the layout.Missing property propagation: The child
dotnet publishprocess doesn't inheritRuntimeConfiguration,TargetArchitecture,TargetOS, orBuildArchitecturefrom the outer build, causing crossgen2 and runtime pack paths to resolve incorrectly (especially in cross-build scenarios like building on linux-x64 for linux-arm).Fix
Debuggees/Directory.Build.targetstargetingpacks.targetsfor runtime/targeting pack resolutiontests.readytorun.targetsviaAfterMicrosoftNETSdkTargetsto overrideResolveReadyToRunCompilersafter the SDK defines it, pointing directly at the locally-built crossgen2DumpTests.targets_DebuggeeRuntimeConfigproperty (falls back fromRuntimeConfiguration->Configuration->Debug)_DebuggeePublishPropsto propagateRuntimeConfiguration,TargetArchitecture,TargetOS, andBuildArchitectureto childdotnet publishcallsprepare-cdac-helix-steps.ymlruntimeConfigurationparameter (default:Checked) and pass it toBuildDebuggeesOnlyso crossgen2 is found under the correctCheckedartifacts path