Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[browser][coreCLR] JS modules consistency via gitHash - #122801

#122801
Merged
pavelsavara merged 4 commits into
dotnet:maindotnet/runtime:mainfrom
pavelsavara:browser_git_hashpavelsavara/runtime:browser_git_hashCopy head branch name to clipboard
Jan 5, 2026
Merged

[browser][coreCLR] JS modules consistency via gitHash#122801
pavelsavara merged 4 commits into
dotnet:maindotnet/runtime:mainfrom
pavelsavara:browser_git_hashpavelsavara/runtime:browser_git_hashCopy head branch name to clipboard

Conversation

@pavelsavara

Copy link
Copy Markdown
Member
  • Add gitHash into each JS file/module and check the consistency during startup
  • This is fail fast for scenarios where HTTP cache or build folders contain inconsistent versions of JS files.

@pavelsavara pavelsavara added this to the 11.0.0 milestone Dec 31, 2025
@pavelsavara pavelsavara self-assigned this Dec 31, 2025
@pavelsavara pavelsavara added the arch-wasm WebAssembly architecture label Dec 31, 2025
Copilot AI review requested due to automatic review settings December 31, 2025 14:01
@pavelsavara pavelsavara added area-Host os-browser Browser variant of arch-wasm labels Dec 31, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 GitHash from "consts:gitHash" in each module and exports it for runtime access
  • Adds validation logic in dotnetInitializeModule functions 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 null to 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

Comment thread src/native/libs/System.Native.Browser/native/index.ts
Comment thread src/native/corehost/browserhost/host/index.ts Outdated
pavelsavara and others added 3 commits December 31, 2025 15:19
Comment thread src/native/corehost/browserhost/host/index.ts

@radekdoulik radekdoulik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, besides the comment about runtimeApi.runtimeBuildInfo.gitHash.

@pavelsavara
pavelsavara merged commit babb666 into dotnet:main Jan 5, 2026
115 checks passed
@pavelsavara
pavelsavara deleted the browser_git_hash branch January 5, 2026 14:47
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasm WebAssembly architecture area-Host os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.