[browser][coreCLR] JS modules consistency via gitHash#122801
Merged
pavelsavara merged 4 commits intodotnet:mainfrom Jan 5, 2026
Merged
[browser][coreCLR] JS modules consistency via gitHash#122801pavelsavara merged 4 commits intodotnet:mainfrom
pavelsavara merged 4 commits intodotnet:mainfrom
Conversation
Contributor
|
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds git hash consistency checking across JavaScript modules in the browser CoreCLR runtime. The implementation adds a gitHash to each JS module and validates during startup that all modules were built from the same git commit, providing fail-fast detection for scenarios where HTTP caches or build folders contain mismatched versions of JS files.
Key Changes:
- Imports
GitHashfrom "consts:gitHash" in each module and exports it for runtime access - Adds validation logic in
dotnetInitializeModulefunctions to compare the loader's gitHash with each module's gitHash - Updates footer.js files to export the gitHash and exclude it from automatic export iteration
- Changes corerun's gitHash from "corerun" to
nullto skip validation for development builds
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/native/libs/System.Runtime.InteropServices.JavaScript.Native/native/index.ts | Adds gitHash import, export, and consistency check comparing with DOTNET_INTEROP.gitHash |
| src/native/libs/System.Runtime.InteropServices.JavaScript.Native/native/cross-linked.ts | Declares DOTNET_INTEROP as a global constant |
| src/native/libs/System.Runtime.InteropServices.JavaScript.Native/libSystem.Runtime.InteropServices.JavaScript.Native.footer.js | Exports gitHash on DOTNET_INTEROP object and excludes it from export iteration |
| src/native/libs/System.Runtime.InteropServices.JavaScript.Native/interop/index.ts | Adds gitHash import and consistency check, refactors to get runtimeApi earlier for validation |
| src/native/libs/System.Native.Browser/utils/index.ts | Adds gitHash import and consistency check, moves initPolyfills after validation |
| src/native/libs/System.Native.Browser/native/index.ts | Adds gitHash import, export, and consistency check comparing with DOTNET.gitHash |
| src/native/libs/System.Native.Browser/libSystem.Native.Browser.footer.js | Exports gitHash on DOTNET object and excludes it from export iteration |
| src/native/libs/System.Native.Browser/diagnostics/index.ts | Adds gitHash import and consistency check |
| src/native/corehost/browserhost/host/index.ts | Adds gitHash import and consistency check after Object.assign |
| src/coreclr/hosts/corerun/wasm/libCorerun.extpost.js | Changes gitHash from "corerun" string to null to skip validation |
src/native/libs/System.Runtime.InteropServices.JavaScript.Native/native/index.ts
Show resolved
Hide resolved
radekdoulik
reviewed
Jan 5, 2026
radekdoulik
approved these changes
Jan 5, 2026
Member
radekdoulik
left a comment
There was a problem hiding this comment.
LGTM, besides the comment about runtimeApi.runtimeBuildInfo.gitHash.
This was referenced Jan 9, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
gitHashinto each JS file/module and check the consistency during startup