Repository navigation
Remove browser TZDIR support and allow custom relinked data - #137381
Open
jkoritzinsky wants to merge 5 commits into
Open
jkoritzinsky wants to merge 5 commits into
jkoritzinsky wants to merge 5 commits into
Conversation
Embed custom browser time zone data during native relinking while preserving WASI behavior. Co-authored-by: Copilot App <[email protected]>
|
Azure Pipelines: Successfully started running 4 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-datetime |
jkotas
reviewed
Nov 11, 2026
Member
|
How does this interact with InvariantTimezone? |
This was referenced Nov 12, 2026
Open
Member
Author
|
InvariantTimezone takes priority over this |
Replace TARGET_BROWSER/TARGET_WASI #if blocks with a constant-folded UseEmbeddedTzDatabase property so ILLink trims the filesystem paths on browser while keeping a single code shape. Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
A literal backslash in the timezone output path on Linux/macOS places the generated header outside the compiler’s include directory, blocking custom-data relinking.
1 open issue
What changed in this PR
This PR makes browser time zone lookup rely on embedded data rather than TZDIR or runtime filesystem access. It adds build-time database replacement for Mono and CoreCLR browser apps while preserving WASI’s TZDIR support.
Changes:
- Use embedded time zone data unconditionally in browser apps.
- Add
WasmCustomTimezoneDataDirectory, validation, packaging, and incremental native relinking. - Document replacement behavior and add browser/WASI startup and custom-data regression tests.
| File | Description |
|---|---|
src/tasks/WasmAppBuilder/GenerateWasmTimezoneData.cs |
Generates embedding configuration and tracks input files. |
src/mono/wasm/Wasm.Build.Tests/InvariantTimezoneTests.cs |
Tests custom databases, rebuilds, restoration, and invalid settings. |
src/mono/wasm/testassets/EntryPoints/CustomTimezone.cs |
Reports zone lookup and enumeration results. |
src/mono/wasm/features.md |
Documents browser database replacement and restrictions. |
src/mono/nuget/Microsoft.NET.Runtime.WebAssembly.Sdk/Microsoft.NET.Runtime.WebAssembly.Sdk.pkgproj |
Packages timezone targets and native sources. |
src/mono/browser/build/BrowserWasmApp.Timezone.targets |
Validates settings and compiles custom timezone data. |
src/mono/browser/build/BrowserWasmApp.targets |
Integrates custom data into Mono relinking. |
src/mono/browser/build/BrowserWasmApp.CoreCLR.targets |
Integrates custom data into CoreCLR relinking. |
src/libraries/System.Runtime/tests/System.Runtime.Tests/TimeZoneDirectory/TimeZoneDirectoryTests.cs |
Tests browser and WASI startup behavior with TZDIR. |
src/libraries/System.Runtime/tests/System.Runtime.Tests/TimeZoneDirectory/System.Runtime.TimeZoneDirectory.Tests.csproj |
Configures isolated startup tests and environment variables. |
src/libraries/System.Runtime/tests/System.Runtime.Tests/System/TimeZoneInfoTests.cs |
Tests browser lookup ignoring filesystem overrides. |
src/libraries/System.Runtime/System.Runtime.slnx |
Registers the startup test project. |
src/libraries/System.Private.CoreLib/src/System/TimeZoneInfo.Unix.NonAndroid.cs |
Uses embedded browser data while retaining WASI filesystem support. |
Review effort: Balanced
This was referenced Nov 18, 2026
Co-authored-by: Copilot App <[email protected]>
jkoritzinsky
marked this pull request as ready for review
November 18, 2026 19:36
jkoritzinsky
requested review from
akoeplinger,
ilonatommy,
lewing and
maraf
as code owners
November 18, 2026 19:36
pavelsavara
reviewed
Nov 19, 2026
Co-authored-by: Copilot App <[email protected]>
Open
3 tasks
pavelsavara
reviewed
Nov 24, 2026
This branch has not been deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

As part of our effort to reduce VFS usage that can't be linked away, remove support for TZDIR in browser app scenarios.
Browser apps should use embedded time zone data rather than consult
TZDIRor the filesystem at runtime. Apps that need a different database can instead select it at native relinking time.TZDIRbehavior.WasmCustomTimezoneDataDirectoryfor Mono and CoreCLR browser apps. It embeds a complete compiled TZif directory withzone.tab, enables relinking automatically, and rejects incompatible settings.Validation
./build.cmd tasks -c Releaseand./build.cmd -os browser -arch wasm -c Release -subset clr+libs+host+packs: passed.TZDIRand embedded data.Note
This pull request was prepared with GitHub Copilot.