Repository navigation
Parse runtime configuration at app build time - #137926
Merged
Merged
Conversation
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
akoeplinger
requested review from
maraf,
steveisok and
vitek-karas
as code owners
November 19, 2026 15:20
|
Azure Pipelines: Successfully started running 4 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Removing Mono’s binary configuration path silently drops configured AppContext values, while leaving ConfigProperties uninitialized causes valid runtimeconfig files without custom properties to throw.
2 open issues
What changed in this PR
Moves runtime configuration processing into the app-build pipeline, sharing JSON parsing across app builders and linking generated configuration properties into CoreCLR’s WASI host.
Changes:
- Adds shared JSON parsing, reserved-property validation, and C-string escaping.
- Updates Android and Apple CoreCLR builders to generate properties directly from JSON.
- Generates and links per-app WASI property tables, removing binary configuration handling from affected targets and templates.
| File | Description |
|---|---|
| src/tasks/WasmAppBuilder/WasmAppBuilder.csproj | Includes the shared configuration helper. |
| src/tasks/WasmAppBuilder/wasi/WasiAppBuilder.cs | Generates sorted C++ configuration tables. |
| src/tasks/Common/RuntimeConfigProperties.cs | Adds JSON parsing, validation, and string escaping. |
| src/tasks/AppleAppBuilder/Xcode.cs | Generates CoreCLR properties from JSON. |
| src/tasks/AppleAppBuilder/Templates/runtime.m | Removes Mono binary configuration loading. |
| src/tasks/AppleAppBuilder/AppleAppBuilder.csproj | Includes the shared configuration helper. |
| src/tasks/AppleAppBuilder/AppleAppBuilder.cs | Passes the configuration path to project generation. |
| src/tasks/AndroidAppBuilder/Templates/monodroid.c | Removes Mono binary configuration loading. |
| src/tasks/AndroidAppBuilder/Templates/monodroid-coreclr.c | Removes the unused binary configuration filename macro. |
| src/tasks/AndroidAppBuilder/ApkBuilder.cs | Generates sorted, escaped CoreCLR properties from JSON. |
| src/tasks/AndroidAppBuilder/AndroidAppBuilder.csproj | Includes the shared configuration helper. |
| src/tasks/AndroidAppBuilder/AndroidAppBuilder.cs | Passes the configuration path to the APK builder. |
| src/native/corehost/wasihost/wasihost.cpp | Uses linked property tables instead of parsing binary configuration. |
| src/native/corehost/wasihost/CMakeLists.txt | Documents the generated configuration link input. |
| src/mono/wasi/build/WasiApp.targets | Wires source generation and removes binary configuration packaging. |
| src/mono/wasi/build/WasiApp.CoreCLR.targets | Compiles and links generated configuration properties. |
| src/mono/msbuild/apple/build/AppleBuild.targets | Passes JSON directly and removes binary generation. |
| src/mono/msbuild/android/build/AndroidBuild.targets | Passes JSON directly and removes binary generation. |
| eng/testing/tests.wasi.targets | Updates a comment about WASI feature-switch propagation. |
Review effort: Balanced
steveisok
previously approved these changes
Nov 19, 2026
steveisok
left a comment
Member
There was a problem hiding this comment.
Outside of the one copilot review, lgtm
This was referenced Nov 19, 2026
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
pavelsavara
reviewed
Nov 20, 2026
pavelsavara
reviewed
Nov 20, 2026
pavelsavara
approved these changes
Nov 20, 2026
Member
Author
|
/ba-g unrelated infra failures |
lewing
added a commit
to lewing/runtime
that referenced
this pull request
Nov 23, 2026
…allHelpersAsWasm dotnet#137926 compiles a generated runtimeconfig.cpp (the g_runtimeconfig_keys and g_runtimeconfig_values string arrays and g_runtimeconfig_property_count) in the relink, so object mode needed clang again. WasiAppBuilder now writes the same three symbols as a relocatable wasm32 object with the toolchain's encoders when given RuntimeConfigPropertiesObjectPath, and the relink links it next to callhelpers.o. A harness that prints the arrays gives identical output linked against this object and against clang's object for the same runtimeconfig. Co-authored-by: Copilot App <[email protected]>
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.


Summary
runtimeconfig.binwith direct JSON parsing through a shared helperwasihostruntimeconfig.binparsing fromwasihostand obsolete binary-config handling from the app-builder templatesRuntimeConfigParserimplementation and package for the later cleanup sliceThis PR is stacked on
akoeplinger-runtime-test-cleanup.Validation
./build.sh clr+libs+host -rc release -lc release— passed./build.sh tasks— passed./build.sh host.native -os wasi -arch wasm -c Debug— passed./build.sh host.native -os wasi -arch wasm -c Release— passed./build.sh clr+libs+packs -os wasi -arch wasm -c Release— passedNote
This pull request description was generated with GitHub Copilot.