Skip to content

Remove regional locale shims from browser images (BLOCKED) - #447

Draft
tnsardesai wants to merge 11 commits into
mainfrom
hypeship/remove-regional-locale-shims
Draft

tnsardesai wants to merge 11 commits into
mainfrom
hypeship/remove-regional-locale-shims

Conversation

@tnsardesai

@tnsardesai tnsardesai commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Removes the locales package and generated en_US, en_GB, en_CA, en_IE, and en_SG POSIX locales from headful and headless images.
  • Removes the en-CA, en-IE, and en-SG copies of en-GB.pak.
  • Keeps tzdata and all font packages.
  • Replaces the legacy combined regionalization test with separate timezone and native-browser locale tests.

Why

The native browser-location implementation can own browser locale behavior without relying on guest POSIX locales or copied Chrome resource packs. Removing the legacy shims reduces duplicated regionalization mechanisms, but only after the native path covers startup behavior and guest-process dependencies are understood.

How

  • Tests timezone behavior on every image under C.UTF-8 using /etc/localtime and Asia/Singapore.
  • Tests locale behavior only on kernel-browser images, both at startup and after a lease-reset/configure update.
  • Verifies en-SG remains observable even when the corresponding POSIX locale is absent.
  • Leaves the timezone database and fonts unchanged.

Context

Caution

Blocked — do not merge. This PR is a tracking implementation stacked on #399 and must be restacked before review or merge.

Required before unblocking:

  1. Deploy kernel-browser fix computer controls hang #92, kernel-images Add browser location bridge and lease convergence #399, and kernel #4208, including the production kernel-images-private browser bump.
  2. Apply native location before browser readiness; the current asynchronous reconciler leaves an initial startup window dependent on --lang and copied packs.
  3. Remove or disprove guest-process dependence on regional LANG/LC_ALL values.
  4. Mirror the cleanup in kernel-images-private.

Removing these files early can regress regional browsers and non-browser guest processes.

Testing & Visuals

  • Built cleaned headful and headless images: no locales package or copied packs; tzdata 2026c and fonts remain.
  • Stock images pass timezone and /etc/localtime tests; native locale tests intentionally skip.
  • Images overlaid with the fix computer controls hang #92 browser artifact pass startup/native regional locale tests, runtime updates, timezone watching, and capability-manifest checks.
  • go build ./..., go vet ./e2e, and git diff --check pass.
  • Open: not tested in kernel-images-private, a production metro/VM, or across all guest processes. Stock CI does not provide native-browser locale coverage.
  • Visuals: not applicable; this PR changes image contents and browser behavior.

…owser location

Send Chromium a monotonic browser generation per accepted bundle and mark a bundle applied only after Chromium reports renderer, worker, host-timezone and network-context acknowledgements for that generation. A Chromium restart clears applied state until the new process acknowledges. Explicit locales and timezones are validated against a capability manifest generated from the Chromium 154 browser in the image instead of ICU component-locale readback.
TestBrowserTimezoneFollowsLocaltime starts Chromium with the production TZ and KERNEL_BROWSER_TIMEZONE environment, checks Chromium runs without TZ, and replaces /etc/localtime A to B at runtime without a restart. TestBrowserLocationCapabilities regenerates or checks the capability manifest. TestBrowserLocationRuntimeUpdate drives reset, configure, retries, stale generations, Chromium restart and a new lease on a kernel-browser image.
…ed live

The launcher initializes /etc/localtime from the accepted bundle the image API persisted, so a restarted Chromium starts in the session's timezone instead of the VM's startup zone. GET /browser/location reports a bundle applied only after the running Chromium confirms that generation with every component acknowledged, so a restarted or unreachable browser is never reported as applied while the upstream change is still being detected. The runtime e2e posts to /configure, the image's configure route.
Drop the locales package, the locale-gen step and the en-CA/en-IE/en-SG copies of en-GB.pak added for regional browser locale. tzdata and fonts stay. The startup regional test is split: timezone coverage runs on every image under C.UTF-8, and locale coverage runs on kernel-browser images, where the browser supplies the regional locale at startup from --lang and at runtime from native location updates.
@tnsardesai
tnsardesai force-pushed the hypeship/browser-location-bridge branch 2 times, most recently from 97d5d94 to 11e86d1 Compare October 15, 2026 19:03
Base automatically changed from hypeship/browser-location-bridge to main October 15, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant