-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Android][CoreCLR] Add runtimeconfig.json support for test host #117980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…nd values by replacing the template placeholders
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements runtime configuration support for the Android CoreCLR test host by parsing runtimeconfig.json
files and applying the configuration through AppContext keys/values. The change replaces the previous approach of setting environment variables with a more robust template-based system that dynamically generates C code with the appropriate runtime configuration.
Key changes:
- Replaced hardcoded AppContext properties with template placeholders in the CoreCLR C template
- Added JSON parsing logic to extract runtime configuration properties and generate corresponding C code
- Removed redundant environment variable settings from the Android build configuration
- Re-enabled previously failing tests that now pass with proper runtime configuration support
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
src/tasks/AndroidAppBuilder/Templates/monodroid-coreclr.c |
Converted hardcoded AppContext arrays to template placeholders for dynamic generation |
src/tasks/AndroidAppBuilder/ApkBuilder.cs |
Added JSON parsing and template replacement logic to process runtimeconfig.json |
src/mono/msbuild/android/build/AndroidBuild.props |
Removed obsolete environment variable definitions for runtime switches |
src/libraries/tests.proj |
Re-enabled three test projects that now pass with proper runtime config support |
src/libraries/System.Runtime/tests/System.IO.FileSystem.Tests/DisabledFileLockingTests/DisabledFileLockingSwitchTests.cs |
Removed ActiveIssue attribute from a test that now works |
Tagging subscribers to this area: @hoyosjs |
/azp run runtime-android,runtime-androidemulator |
Azure Pipelines successfully started running 2 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
/azp run runtime-android,runtime-androidemulator |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run runtime-android,runtime-androidemulator |
Azure Pipelines successfully started running 2 pipeline(s). |
/azp run runtime-android,runtime-androidemulator |
Azure Pipelines successfully started running 2 pipeline(s). |
Description
In this PR we add support for ALL runtime configuration options for the CoreCLR Android test host by doing the following:
runtimeconfig.json
.monodroid-coreclr.c
template.Why it works
[appname].runtimeconfig.json
file when building the app.json
generation works properlyChanges
monodroid-coreclr.c
templateApkBuilder.cs
, when rendering themonodroid-coreclr.c
template, we parseruntimeconfig.json
and apply it by replacing the template placeholders to set actual AppContext keys and valuesAndroidBuild.props
(became redundant)Newly non-failing tests with execution results
System.Runtime.InvariantTimezone.Tests.csproj
System.Diagnostics.DiagnosticSource.Switches.Tests.csproj
System.IO.FileSystem.DisabledFileLocking.Tests.csproj
System.Text.Encoding.Tests.csproj
Related issues
System.Runtime.InvariantTimezone.Tests.csproj
fails on CoreCLR Android #117658