-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[wasm] Add missing properties to PropertiesThatTriggerRelinking for WASM and WASI #117983
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
base: main
Are you sure you want to change the base?
Conversation
… WASI Co-authored-by: ilonatommy <[email protected]>
Co-authored-by: ilonatommy <[email protected]>
@copilot, we have to document the changes. Candidates for placing documentation:
|
…ASI builds Co-authored-by: ilonatommy <[email protected]>
Added comprehensive documentation for properties that trigger relinking in both
This covers the newly added properties ( Commit: 8540857 |
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 adds missing properties to PropertiesThatTriggerRelinking
for WASM and WASI builds to ensure native components are properly rebuilt when configuration changes occur. The changes ensure that when developers modify important build properties like threading, AOT compilation, or trimming settings, the native runtime artifacts are correctly regenerated.
Key changes:
- Added 4 new properties to WASM builds:
EmccInitialHeapSize
,WasmEnableThreads
,RunAOTCompilation
,PublishTrimmed
- Added 3 new properties to WASI builds:
WasmEnableThreads
,RunAOTCompilation
,PublishTrimmed
- Enhanced test coverage and added comprehensive documentation for relinking behavior
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/mono/browser/browser.proj | Added 4 properties to PropertiesThatTriggerRelinking JSON for WASM builds |
src/mono/wasi/wasi.proj | Added 3 properties to PropertiesThatTriggerRelinking JSON for WASI builds |
src/mono/wasm/Wasm.Build.Tests/WasmNativeDefaultsTests.cs | Added WasmEnableThreads to test coverage with explanatory comments |
src/mono/browser/README.md | Added comprehensive documentation section explaining relinking properties and behavior |
src/mono/wasi/README.md | Added comprehensive documentation section explaining relinking properties and behavior for WASI |
Tagging subscribers to 'arch-wasm': @lewing |
Co-authored-by: ilonatommy <[email protected]>
…rRelinking Co-authored-by: ilonatommy <[email protected]>
Co-authored-by: ilonatommy <[email protected]>
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.
All feedback applied.
This PR addresses the missing properties in
PropertiesThatTriggerRelinking
for WASM and WASI builds as identified in the issue discussion.Problem
Several important properties that affect the native build output were not marked as triggering relinking, which could lead to inconsistent builds when these properties change. This means developers might change configuration properties but not see their changes take effect because the native components weren't rebuilt.
Solution
Added the following properties to
PropertiesThatTriggerRelinking
:WASM-only (browser.proj):
EmccInitialHeapSize
- Controls memory layout together withEmccMaximumHeapSize
. Heap size configuration applies only for browser scenarios, same asExceptionHandling
.Both WASM and WASI:
WasmEnableThreads
- Affects memory layout (e.g., usage ofSharedArrayBuffer
in browser orDISABLE_THREADS
switches in runtime)RunAOTCompilation
- Native objects and linked outputs are no longer valid for new values and must be rebuiltPublishTrimmed
- The set of assemblies and code passed to the native linker changes significantlyChanges
src/mono/browser/browser.proj
to include all 4 properties in the generatedwasm-props.json
src/mono/wasi/wasi.proj
to include the 3 shared properties in the generatedwasm-props.json
WasmEnableThreads
to the existing test framework inWasmNativeDefaultsTests.cs
Behavior
When any of these properties differs from the runtime pack default value, the build system will:
_ChangedPropertiesThatTriggerRelinking
comparison_WasmBuildNativeRequired=true
WasmBuildNative=true
to trigger native relinkingThis ensures developers get proper native rebuilds when changing these important configuration properties that affect memory layout, threading model, AOT compilation, or IL trimming.
Fixes #105135.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.