Uh oh!
There was an error while loading. Please reload this page.
Enable runtime-async for shared framework source projects in net11.0+ and remove RuntimeAsync config knob - #125406
Conversation
…e-net11, browser/wasm, and mobile Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the libraries build infrastructure to automatically enable the runtime-async compiler feature for shared-framework source projects targeting net11.0+, while excluding platforms where the feature isn’t supported and allowing per-project opt-out via UseRuntimeAsync=false.
Changes:
- Replace the explicit
UseRuntimeAsync=trueopt-in gate with an auto-enable condition scoped toIsNETCoreAppSrcandnet11.0+. - Add platform/runtime exclusions (browser, wasi, android, Apple mobile, Mono) to match existing test gating logic.
Uh oh!
There was an error while loading. Please reload this page.
jtschuster
commented
Mar 10, 2026
We should probably also remove the runtime/eng/testing/tests.targets Lines 3 to 15 in 4466dad Also, we should follow up to remove the RuntimeAsync jobs in the |
jtschuster
commented
Mar 10, 2026
/azp run runtime-coreclr crossgen2 |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Uh oh!
There was an error while loading. Please reload this page.
You may want to submit a test-only job to dotnet/dotnet with this change and trigger full CI run |
Uh oh!
There was an error while loading. Please reload this page.
jkotas
commented
Mar 11, 2026
@copilot Delete |
…PPORTED_RuntimeAsync config and DOTNET_RuntimeAsync env var Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
... Removed the
Done in 6ffe3ab — removed the |
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
… use targetAddress Agent-Logs-Url: https://github.com/dotnet/runtime/sessions/092c6e3f-2886-45ac-a780-6fdd3ccf61c3 Co-authored-by: agocke <515774+agocke@users.noreply.github.com>
Done in 0ca2899 — removed the |
The two Debug.Assert calls in PutRiscV64AuipcCombo fire during crossgen2 R2R compilation for RISC-V because the target memory already contains nonzero relocation bits. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🤖 Copilot Code Review — PR #125406Note This review was generated by Copilot and should be treated as an automated analysis, not a definitive assessment. Holistic AssessmentMotivation: Enabling runtime-async by default for shared framework source projects and removing the config knob is well-justified — the feature has matured beyond the preview stage and the prior opt-in Approach: The Summary: Detailed Findings✅ Runtime-Async MSBuild Enablement — Correct and well-structuredThe changes to
✅ Config Knob Removal — Clean and completeThe removal spans all relevant files and is thorough:
Verified: no remaining references to the removed config in the codebase via the commit chain. ✅ PEObjectWriter Relocation Fixes — Correct patternThe RISC-V and LoongArch64 relocation changes in
|
/ba-g browser failures are known and musl/x86 failures are numerics timeouts |
agocke
commented
Mar 28, 2026
/backport to release/11.0-preview3 |
Started backporting to |
@agocke an error occurred while backporting to |
| <EnablePreviewFeatures>true</EnablePreviewFeatures> | ||
| <!-- Define a shared predicate for platforms that support runtime async. --> | ||
| <PropertyGroup Condition="'$(RuntimeAsyncSupported)' == ''"> | ||
| <RuntimeAsyncSupported Condition="'$(TargetOS)' != 'browser' |
There was a problem hiding this comment.
Maybe we can enable asyncV2 for browser+coreCLR ?
cc @radekdoulik
agocke
commented
Mar 30, 2026
/backport to release/11.0-preview3 |
Started backporting to |
@agocke backporting to git am output$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patchCreating an empty commit: Initial planApplying: Enable runtime-async for netcoreapp source projects excluding OOB, pre-net11, browser/wasm, and mobileApplying: Factor RuntimeAsyncSupported, remove TestReadyToRun gate, delete UNSUPPORTED_RuntimeAsync config and DOTNET_RuntimeAsync env varUsing index info to reconstruct a base tree...M eng/testing/tests.targetsFalling back to patching base and 3-way merge...Auto-merging eng/testing/tests.targetsCONFLICT (content): Merge conflict in eng/testing/tests.targetserror: Failed to merge in the changes.hint: Use 'git am --show-current-patch=diff' to see the failed patchhint: When you have resolved this problem, run "git am --continue".hint: If you prefer to skip this patch, run "git am --skip" instead.hint: To restore the original branch and stop patching, run "git am --abort".hint: Disable this message with "git config set advice.mergeConflict false"Patch failed at 0003 Factor RuntimeAsyncSupported, remove TestReadyToRun gate, delete UNSUPPORTED_RuntimeAsync config and DOTNET_RuntimeAsync env varError: The process '/usr/bin/git' failed with exit code 128 |
… 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>
#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>
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.