Skip to content

[browser][coreCLR] link out icu/globalization module on InvariantGlobalization flag#129336

Open
pavelsavara wants to merge 1 commit into
dotnet:mainfrom
pavelsavara:fix_native_globalization_link
Open

[browser][coreCLR] link out icu/globalization module on InvariantGlobalization flag#129336
pavelsavara wants to merge 1 commit into
dotnet:mainfrom
pavelsavara:fix_native_globalization_link

Conversation

@pavelsavara

Copy link
Copy Markdown
Member

Fixes #129242

@pavelsavara pavelsavara added this to the 11.0.0 milestone Jun 12, 2026
@pavelsavara pavelsavara self-assigned this Jun 12, 2026
Copilot AI review requested due to automatic review settings June 12, 2026 16:10
@pavelsavara pavelsavara added arch-wasm WebAssembly architecture area-System.Globalization os-browser Browser variant of arch-wasm labels Jun 12, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/area-system-globalization
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 updates the Browser WASM CoreCLR managed-to-native generation + link pipeline to honor InvariantGlobalization=true by excluding libSystem.Globalization.Native P/Invokes from the generated table and conditionally omitting the corresponding globalization/ICU static libraries from the link step.

Changes:

  • Extend the CoreCLR PInvokeTableGenerator pipeline to accept an “ignored modules” list and filter those modules out of the generated P/Invoke table.
  • Update BrowserWasmApp.CoreCLR.targets to (a) stop allowing libSystem.Globalization.Native when InvariantGlobalization=true and (b) stop linking libSystem.Globalization.Native.a and ICU archives in that mode.
  • Add a CoreCLR-only WASM build test asserting GlobalizationNative_* entries and ICU/globalization archives are absent under invariant globalization.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/tasks/WasmAppBuilder/coreclr/PInvokeTableGenerator.cs Adds support for ignoring specified P/Invoke modules during table generation.
src/tasks/WasmAppBuilder/coreclr/ManagedToNativeGenerator.cs Plumbs ignored-module input into generation and records it in the cache file.
src/mono/wasm/Wasm.Build.Tests/InvariantGlobalizationTests.cs Adds regression coverage ensuring invariant CoreCLR builds don’t emit globalization pinvokes or link ICU/globalization archives.
src/mono/browser/build/BrowserWasmApp.CoreCLR.targets Conditions module allowlist and native library linking on InvariantGlobalization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-System.Globalization os-browser Browser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[browser][CoreCLR] GlobalizationNative_* P/Invokes are not trimmed under InvariantGlobalization

2 participants