Skip to content

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

Draft
tnsardesai wants to merge 1 commit into
hypeship/browser-location-bridgefrom
hypeship/remove-regional-locale-shims
Draft

tnsardesai wants to merge 1 commit into
hypeship/browser-location-bridgefrom
hypeship/remove-regional-locale-shims

Conversation

@tnsardesai

Copy link
Copy Markdown
Contributor

Caution

BLOCKED — do not merge. Removing these shims is unsafe until all of the following hold:

  1. kernel-browser fix computer controls hang #92, kernel-images Add browser location bridge and lease convergence #399 and kernel #4208 are merged and deployed, and production images (kernel-images-private) ship the fix computer controls hang #92 browser.
  2. Native browser location is applied before browser readiness, not only asynchronously after it. Today the API applies it through the reconciler after the browser is returned, so the first page depends on the startup --lang/--accept-lang flags.
  3. Guest-process dependence on regional POSIX LANG/LC_ALL is removed or disproven. Production still sends LANG/LC_ALL=en_SG.UTF-8 and similar for each metro (kernel browserEnvironment), and after this change those locales no longer exist in the image.

summary

Stacked on #399. Removes only the regional locale shims added in #357, from both the headful and headless images:

  • the locales package
  • the locale-gen en_US en_GB en_CA en_IE en_SG step
  • the en-CA/en-IE/en-SG copies of en-GB.pak in the Chrome for Testing install

tzdata and all fonts stay.

test changes

TestRegionalBrowserLocation is replaced by tests that cover the same values honestly after the removal:

  • TestRegionalBrowserTimezone (every image, headful and headless): TZ/KERNEL_BROWSER_TIMEZONE=Asia/Singapore with LANG/LC_ALL=C.UTF-8. Checks locale charmap is UTF-8, the system offset from /etc/localtime (env -u TZ date) is +0800, and the browser timezone is Asia/Singapore.
  • TestRegionalBrowserLocale (kernel-browser images, E2E_KERNEL_BROWSER=1, headful and headless):
    • startup: production's flags (--lang=en-SG --accept-lang=en-SG,en) with LANG/LC_ALL=en_SG.UTF-8. Asserts the regional POSIX locale is absent, then that the first page reports en-SG / en-SG / Asia/Singapore.
    • native: starts in en-US under C.UTF-8, applies an en-SG/Singapore bundle through the lease-reset endpoint, waits for applied, and asserts the OS (UTF-8, +0800) and a new page (en-SG / en-SG / Asia/Singapore).

Why the locale assertions moved off stock images: #399's old test fails on the cleaned Chrome for Testing image (Intl locale en-GB instead of en-SG), so on stock images the pack copies were what made --lang=en-SG work. The kernel-browser build ships its own en-CA/en-IE/en-SG packs.

Warning

Stock CI images (Chrome for Testing 152) skip TestRegionalBrowserLocale, so CI no longer checks regional locale. It was validated locally against the exact #92 artifact (below); CI coverage returns only when CI builds kernel-browser images.

findings from the cleaned images

  • The Chromium browser process starts with no LANG/LC_* variables (the launcher's runuser path drops them), so the browser's locale does not come from guest POSIX locales.
  • The old test's locale charmap check never exercised en_SG: commands run through /process/exec (and the image API, pulseaudio and Xvfb) see LC_ALL=C.UTF-8 even when the container is started with LC_ALL=en_SG.UTF-8. The source of that override was not identified. supervisord and chromium-launcher still receive en_SG.UTF-8.
  • kernel-images-private installs locales and runs the same locale-gen but does not copy packs. Mirroring this cleanup there is a separate follow-up after the blockers clear.

validation

  • Built headful and headless images from this branch: locales not installed; only C, C.utf8, POSIX; no copied packs; tzdata 2026c present; fonts present (headless 52, headful 706).
  • Stock images: TestRegionalBrowserTimezone (both), TestBrowserTimezoneFollowsLocaltime pass; TestRegionalBrowserLocale skips.
  • Exact custom artifact: the same images with the kernel-browser fix computer controls hang #92 release-x64 artifact from build run 37918236863 (chromium sha256 e4cd799a…4434957) installed at /usr/lib/chromium, as kernel-images-private does. TestRegionalBrowserLocale (4 subtests), TestRegionalBrowserTimezone, TestBrowserLocationRuntimeUpdate, TestBrowserTimezoneFollowsLocaltime and TestBrowserLocationCapabilities (check mode) pass.
  • Control: Add browser location bridge and lease convergence #399's TestRegionalBrowserLocation fails on the cleaned stock image as described above.
  • go build ./..., go vet ./e2e, git diff --check.
  • Not run: kernel-images-private images, production metro/VM runtime, and other guest processes under a missing regional locale beyond the environment inspection above (blocker 3).

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.
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