Commit e7c4426
Enable runtime-async for shared framework source projects in net11.0+… (#126343)
… and remove RuntimeAsync config knob (#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 <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent d343974 commit e7c4426
9 files changed
Lines changed: 31 additions & 46 deletions
File tree
- eng/testing
- src
- coreclr
- inc
- tools/Common/Compiler
- DependencyAnalysis
- ObjectWriter
- vm
- libraries
- tests/Interop/COM/RuntimeAsync
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
2 | 11 | | |
3 | 12 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 13 | + | |
11 | 14 | | |
12 | | - | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | 718 | | |
722 | 719 | | |
723 | 720 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
572 | | - | |
| 572 | + | |
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
577 | | - | |
| 577 | + | |
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
| |||
Lines changed: 4 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
934 | 934 | | |
935 | 935 | | |
936 | 936 | | |
937 | | - | |
938 | | - | |
939 | | - | |
940 | | - | |
941 | | - | |
| 937 | + | |
| 938 | + | |
942 | 939 | | |
943 | 940 | | |
944 | 941 | | |
| |||
947 | 944 | | |
948 | 945 | | |
949 | 946 | | |
950 | | - | |
951 | | - | |
952 | | - | |
953 | | - | |
954 | | - | |
| 947 | + | |
| 948 | + | |
955 | 949 | | |
956 | 950 | | |
957 | 951 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
233 | 233 | | |
234 | 234 | | |
235 | 235 | | |
236 | | - | |
237 | | - | |
238 | 236 | | |
239 | 237 | | |
240 | 238 | | |
| |||
848 | 846 | | |
849 | 847 | | |
850 | 848 | | |
851 | | - | |
852 | | - | |
853 | 849 | | |
854 | 850 | | |
855 | 851 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
452 | | - | |
453 | | - | |
454 | 452 | | |
455 | 453 | | |
456 | 454 | | |
| |||
654 | 652 | | |
655 | 653 | | |
656 | 654 | | |
657 | | - | |
658 | | - | |
659 | 655 | | |
660 | 656 | | |
661 | 657 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2392 | 2392 | | |
2393 | 2393 | | |
2394 | 2394 | | |
2395 | | - | |
2396 | | - | |
2397 | | - | |
2398 | | - | |
2399 | | - | |
2400 | | - | |
2401 | | - | |
2402 | 2395 | | |
2403 | 2396 | | |
2404 | 2397 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
130 | | - | |
131 | | - | |
132 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
133 | 145 | | |
134 | 146 | | |
135 | 147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | 3 | | |
6 | 4 | | |
7 | 5 | | |
| |||
13 | 11 | | |
14 | 12 | | |
15 | 13 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | 14 | | |
0 commit comments