-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[browser] Generate boot config with hash field instead of integrity #122353
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
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 fixes a regression from #116300 by renaming the integrity field to hash in the boot configuration classes and their usage. The JavaScript runtime expects assets to have a hash field, which was incorrectly changed to integrity in the previous PR.
Key Changes:
- Renamed property from
integritytohashin three asset classes:WasmAsset,GeneralAsset, andVfsAsset - Updated all property assignments in
BootJsonBuilderHelper.csto use thehashfield name - Added test case to verify that assets have integrity/hash values
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonData.cs | Renamed integrity property to hash in WasmAsset, GeneralAsset, and VfsAsset classes |
| src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonBuilderHelper.cs | Updated all property assignments from integrity to hash when creating asset instances |
| src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js | Added new test case "AssetIntegrity" to log integrity values for all assets via resource loader |
| src/mono/wasm/Wasm.Build.Tests/ModuleConfigTests.cs | Added test method to verify that non-JS/non-JSON assets have integrity hash values |
|
/backport to release/10.0 |
|
Started backporting to |
|
@maraf backporting to git am output$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Generate boot config with hash expected by javascript instead of integrity
Using index info to reconstruct a base tree...
M src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js
M src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonBuilderHelper.cs
Falling back to patching base and 3-way merge...
Auto-merging src/mono/wasm/testassets/WasmBasicTestApp/App/wwwroot/main.js
Auto-merging src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonBuilderHelper.cs
CONFLICT (content): Merge conflict in src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/BootJsonBuilderHelper.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: 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 0001 Generate boot config with hash expected by javascript instead of integrity
Error: The process '/usr/bin/git' failed with exit code 128 |
JavaScript part of .NET expects assets to have field
hash. This PR unifies it between internal structure and boot config generated during build. It is a regression from boot config structure change from #116300.This PR will cause failure of some tests once it flows to dotnet/sdk.
This PR will be a candidate for backport to 10.0.
Fixes #121876