Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Muon ICU

Brian R. Bondy edited this page Mar 16, 2017 · 3 revisions

ICU in Chromium and Node

This page describes the current state of ICU as of Chromium56 and Chromium57.

ICU is used in both Chromium and Node.

The deps can be found in:
browser-laptop-bootstrap/src/electron/vendor/node/deps/icu-small
browser-laptop-bootstrap/src/third_party/icu/

If you built without any changes, you'd get a lot of duplicate defined symbols. We therefore do some changes to build config in Chromium and Chromium's deps.

Patches

Changes to Chromium directly, and changes to deps of Chromium are maintained in separate patch files.

Of particular interest here are:
For changes to Chromium: electron/patches/master_patch.patch
For changes to Chromium's ICU dep: electron/patches/third_party/icu/filter.patch

Changes in the patch files

The first patch has many changes outside of ICU, but you can search in the patch for icu for the changes relating to ICU. The second patch is only related to the ICU dep of Chromium so it only has ICU changes in it.

A lot of the Chromium code has dependencies on ICU, and during Chromium upgrades it's common for new ones to be added. For this reason we want to modify the same dep name of third_party/icu:icu to use the ICU inside Node.

Chromium has multiple independent standalone executables (such as chromedriver) which are not linked to node. For these we want to use the normal unpatched ICU dep. This is renamed to third_party/icu:icu_chrome.

The changes in the third_party/icu/filter.patch file makes the default ICU deps use Node's shared library ICU. It also creates the icu_chrome dep which matches the old icu dep.

The changes in the electron/patches/master_patch.patch for standalone executables removes the third_party/icu:icu dep and instead uses the icu_chrome dep.

More details on dep targets

third_party/icu:icu_chrome is for standalone executables in muon. It depends on config icu_config_chrome (which uses a static library), and deps: icu18n_chrome, and icuuc_chrome.

third_party/icu is patched to use ICU from node. It depends on deps icu18n, and icuuc.

icui18n_name is a variable which will pick between icui18n and icui18n_chrome depending on the build type. icuuc_name is a variable which will pick between icuuc and icuuc_chromes depending on the build type.

Longer term

Longer term we'd like to remove Node completely except for in a utility process that doesn't use ICU at all from Chromium. This would simplify build and upgrade problems a lot.

Clone this wiki locally