-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[browser][coreCLR] JS modules consistency via gitHash #122801
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
|
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov |
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 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
Co-authored-by: Copilot <[email protected]>
gitHashinto each JS file/module and check the consistency during startup