Enable runtime-async for shared framework source projects in net11.0+…#126343
Merged
agocke merged 1 commit intodotnet:release/11.0-preview3from Apr 1, 2026
Merged
Conversation
… and remove RuntimeAsync config knob (dotnet#125406) ## Description Auto-enables `runtime-async` for shared framework (`IsNETCoreAppSrc`) source projects targeting net11.0+, with exclusions for platforms where it's not yet working and for assemblies that ship as OOB NuGet packages. Also fully removes the `UNSUPPORTED_RuntimeAsync` / `DOTNET_RuntimeAsync` config knob and the `runtimeAsync` field/accessor from the runtime, since runtime-async is now unconditionally enabled. Additionally fixes PEObjectWriter relocation handling for RISC-V and LoongArch to properly support non-zero addends. **Conditions for enablement:** - `IsNETCoreAppSrc` — scoped to shared framework only - `IsPackable != true` — excludes OOB NuGet packages (e.g., System.Text.Json, System.Collections.Immutable) to avoid Mono compatibility issues when those packages are referenced in non-CoreCLR environments - `IsTargetFrameworkCompatible(TFM, 'net11.0')` — no pre-net11 TFMs - `RuntimeAsyncSupported` shared property — consolidates platform exclusions (browser, wasi, android, Apple mobile, Mono) into a single predicate used by both library source and test builds - Per-project opt-out via `UseRuntimeAsync=false` **Changes:** - **`src/libraries/Directory.Build.targets`** — Defines `RuntimeAsyncSupported` shared property with platform exclusions. Auto-enables runtime-async for `IsNETCoreAppSrc` source projects on net11.0+ supported platforms, excluding OOB packages (`IsPackable=true`). Replaces the previous explicit `UseRuntimeAsync=true` opt-in gate. - **`eng/testing/tests.targets`** — Defines matching `RuntimeAsyncSupported` property (guarded against redefinition). Removes the `TestReadyToRun` special-case condition since libraries now ship with runtime-async. Simplifies test enablement to use the shared `RuntimeAsyncSupported` property. - **`src/coreclr/inc/clrconfigvalues.h`** — Removes the `UNSUPPORTED_RuntimeAsync` config definition (which mapped to `DOTNET_RuntimeAsync` env var). - **`src/coreclr/vm/eeconfig.h`** — Removes the `runtimeAsync` field and the `RuntimeAsync()` accessor method entirely, since the feature is now unconditionally enabled. - **`src/coreclr/vm/eeconfig.cpp`** — Removes config value read and the `runtimeAsync` field initialization. - **`src/coreclr/vm/method.cpp`** — Removes the dead `g_pConfig->RuntimeAsync()` early-return guard in `ClassifyMethodReturnKind`, since runtime-async is always on. - **`src/tests/Interop/COM/RuntimeAsync/RuntimeAsync.csproj`** — Removes `DOTNET_RuntimeAsync` env variable and the `RequiresProcessIsolation` property that was only needed for it. - **`EnablePreviewFeatures` removed** — Removed `EnablePreviewFeatures=true` from both `eng/testing/tests.targets` and `src/libraries/Directory.Build.targets` since runtime-async is no longer a preview feature. - **`src/coreclr/tools/Common/Compiler/ObjectWriter/PEObjectWriter.cs`** — Fixes RISC-V and LoongArch relocation handling in `ResolveRelocations`: removes the `if (addend != 0) { throw new NotSupportedException(); }` guards and replaces `symbolImageOffset` with `long targetAddress = symbolImageOffset + addend` to properly incorporate addends, consistent with all other relocation types in the method. <!-- START COPILOT CODING AGENT TIPS --> --- 🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. [Learn more about Advanced Security.](https://gh.io/cca-advanced-security) --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: agocke <515774+agocke@users.noreply.github.com> Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com> Co-authored-by: Andy Gocke <angocke@microsoft.com> Co-authored-by: Andy Gocke <andy@commentout.net> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Tagging subscribers to this area: @agocke |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes runtime-async the default for shared framework source projects targeting net11.0+ (on supported platforms), removes the now-unneeded runtime config knob and runtime-side plumbing, and extends PE relocation resolution to correctly handle non-zero addends for RISC-V and LoongArch.
Changes:
- Auto-enable
runtime-async=onforIsNETCoreAppSrcprojects on net11.0+ (excluding unsupported platforms andIsPackable=trueOOB packages), and align test builds with the same platform predicate. - Remove the
UNSUPPORTED_RuntimeAsync/DOTNET_RuntimeAsyncconfig surface and the CoreCLREEConfigfield/accessor/guard that depended on it. - Fix relocation resolution for RISC-V/LoongArch to incorporate addends rather than rejecting them.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/libraries/Directory.Build.targets |
Introduces RuntimeAsyncSupported predicate and auto-enables runtime-async for eligible shared framework source projects. |
eng/testing/tests.targets |
Applies runtime-async to net11.0+ test projects based on RuntimeAsyncSupported and removes preview/knob gating. |
src/coreclr/inc/clrconfigvalues.h |
Removes the UNSUPPORTED_RuntimeAsync config definition. |
src/coreclr/vm/eeconfig.h |
Removes the runtimeAsync config field and accessor. |
src/coreclr/vm/eeconfig.cpp |
Removes initialization and config-reading for runtimeAsync. |
src/coreclr/vm/method.cpp |
Removes the now-dead RuntimeAsync() guard in ClassifyMethodReturnKind. |
src/tests/Interop/COM/RuntimeAsync/RuntimeAsync.csproj |
Drops process-isolation and env-var plumbing for DOTNET_RuntimeAsync. |
src/coreclr/tools/Common/Compiler/ObjectWriter/PEObjectWriter.cs |
Updates LoongArch/RISC-V relocation resolution to include addends. |
src/coreclr/tools/Common/Compiler/DependencyAnalysis/Relocation.cs |
Adjusts RISC-V relocation patching assertions (but see review comment). |
3 tasks
jtschuster
approved these changes
Mar 31, 2026
Member
Author
|
/ba-g failures are timeouts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… and remove RuntimeAsync config knob (#125406)
Description
Auto-enables
runtime-asyncfor shared framework (IsNETCoreAppSrc) source projects targeting net11.0+, with exclusions for platforms where it's not yet working and for assemblies that ship as OOB NuGet packages. Also fully removes theUNSUPPORTED_RuntimeAsync/DOTNET_RuntimeAsyncconfig knob and theruntimeAsyncfield/accessor from the runtime, since runtime-async is now unconditionally enabled. Additionally fixes PEObjectWriter relocation handling for RISC-V and LoongArch to properly support non-zero addends.Conditions for enablement:
IsNETCoreAppSrc— scoped to shared framework onlyIsPackable != true— excludes OOB NuGet packages (e.g., System.Text.Json, System.Collections.Immutable) to avoid Mono compatibility issues when those packages are referenced in non-CoreCLR environmentsIsTargetFrameworkCompatible(TFM, 'net11.0')— no pre-net11 TFMsRuntimeAsyncSupportedshared property — consolidates platform exclusions (browser, wasi, android, Apple mobile, Mono) into a single predicate used by both library source and test buildsUseRuntimeAsync=falseChanges:
src/libraries/Directory.Build.targets— DefinesRuntimeAsyncSupportedshared property with platform exclusions. Auto-enables runtime-async forIsNETCoreAppSrcsource projects on net11.0+ supported platforms, excluding OOB packages (IsPackable=true). Replaces the previous explicitUseRuntimeAsync=trueopt-in gate.eng/testing/tests.targets— Defines matchingRuntimeAsyncSupportedproperty (guarded against redefinition). Removes theTestReadyToRunspecial-case condition since libraries now ship with runtime-async. Simplifies test enablement to use the sharedRuntimeAsyncSupportedproperty.src/coreclr/inc/clrconfigvalues.h— Removes theUNSUPPORTED_RuntimeAsyncconfig definition (which mapped toDOTNET_RuntimeAsyncenv var).src/coreclr/vm/eeconfig.h— Removes theruntimeAsyncfield and theRuntimeAsync()accessor method entirely, since the feature is now unconditionally enabled.src/coreclr/vm/eeconfig.cpp— Removes config value read and theruntimeAsyncfield initialization.src/coreclr/vm/method.cpp— Removes the deadg_pConfig->RuntimeAsync()early-return guard inClassifyMethodReturnKind, since runtime-async is always on.src/tests/Interop/COM/RuntimeAsync/RuntimeAsync.csproj— RemovesDOTNET_RuntimeAsyncenv variable and theRequiresProcessIsolationproperty that was only needed for it.EnablePreviewFeaturesremoved — RemovedEnablePreviewFeatures=truefrom botheng/testing/tests.targetsandsrc/libraries/Directory.Build.targetssince runtime-async is no longer a preview feature.src/coreclr/tools/Common/Compiler/ObjectWriter/PEObjectWriter.cs— Fixes RISC-V and LoongArch relocation handling inResolveRelocations: removes theif (addend != 0) { throw new NotSupportedException(); }guards and replacessymbolImageOffsetwithlong targetAddress = symbolImageOffset + addendto properly incorporate addends, consistent with all other relocation types in the method.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.