Skip to content

firefox: Missing ICU patches break functionality of Intl/Temporal JavaScript built-ins #484824

@anba

Description

@anba

Nixpkgs version

  • Unstable (26.05)

Describe the bug

Original bug report: https://bugzilla.mozilla.org/show_bug.cgi?id=2012175

#478573 updated the Firefox package to ICU 78, but because the "buildMozillaMach" package sets --with-system-icu, some ICU 78 patches needed for Firefox aren't used.

The following patches from https://github.com/mozilla-firefox/firefox/tree/main/intl/icu-patches are needed:

  1. https://github.com/mozilla-firefox/firefox/blob/main/intl/icu-patches/bug-2000225-ICU-23262-missing-resource-error-for-iso8601-era.diff to ensure the "iso8601" calendar can be used for the Intl.DateTimeFormat built-in. (https://unicode-org.atlassian.net/browse/ICU-23262)
  2. https://github.com/mozilla-firefox/firefox/blob/main/intl/icu-patches/bug-2000225-ICU-23264-increase-measure-unit-capacity.diff to ensure volume units can be used by Intl.NumberFormat. (https://unicode-org.atlassian.net/browse/ICU-23264)
  3. https://github.com/mozilla-firefox/firefox/blob/main/intl/icu-patches/bug-2002735-ICU-23277-coptic-single-era.diff to ensure the "coptic" calendar is correctly formatted by Intl.DateTimeFormat. (https://unicode-org.atlassian.net/browse/ICU-23277)
  4. https://github.com/mozilla-firefox/firefox/blob/main/intl/icu-patches/bug-2010411-patch-cldr-hv-en-root.diff to fix web-compat issues with old versions of the "date-fns" JavaScript library (https://unicode-org.atlassian.net/browse/CLDR-19205). (The Firefox patch has the minimal changes to fix the web-compat issues, upstream CLDR applied more changes in CLDR-19205 Remove literal 'h' from en availableFormats for Hv unicode-org/cldr#5309 and later in CLDR-19205 Remove literal 'h' or equiv added to Hv availableFmts in CLDR48 unicode-org/cldr#5320.)
  5. And either https://github.com/mozilla-firefox/firefox/blob/09295ebd1dfb7ab08e8b8ad94f0a7302f5ceebe6/intl/icu-patches/bug-2002997-ICU-23278-metazone-with-offset.diff or update to ICU 78.2. This fixes some time zone issues for "Europe/Dublin" and "Africa/Windhoek", observable using either Intl.DateTimeFormat or the Temporal JS built-in. (https://unicode-org.atlassian.net/browse/ICU-23278.)

Alternatively use the ICU version included in Firefox, which also fixes other bugs, like for example https://bugzilla.mozilla.org/show_bug.cgi?id=1999917.

Steps to reproduce

Evaluate new Intl.NumberFormat("en-GB", { style: 'unit', unit: 'liter' }).format(1) in the Firefox dev console.

(This is the test case from https://bugzilla.mozilla.org/show_bug.cgi?id=2012175, caused by https://unicode-org.atlassian.net/browse/ICU-23264.)

Expected behaviour

The test case should print the string "1 l" in the Firefox dev console, but instead throws Uncaught Error: internal error while computing Intl data.

Screenshots

No response

Relevant log output

Additional context

No response

System metadata

From https://bugzilla.mozilla.org/show_bug.cgi?id=2012175#c3:

Operating System: NixOS 26.05
KDE Plasma Version: 6.5.5
KDE Frameworks Version: 6.22.0
Qt Version: 6.10.1
Kernel Version: 6.18.6 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
Memory: 32 GiB of RAM (31,3 GiB usable)
Graphics Processor: AMD Radeon RX 7900 XT
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7C84
System Version: 1.0

Notify maintainers

@mweinelt


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs

Is this issue important to you?

Add a 👍 reaction to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions