Skip to content

Commit 2d968ca

Browse files
srl295MylesBorins
authored andcommitted
doc: Update tools/icu/README.md
- remove TODOs: the one about defaults has been addressed, and the one about testing is a work item that doesn't belong in a doc. - add some background information Fixes: #7843 PR-URL: #16939 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 44bf0f4 commit 2d968ca

File tree

1 file changed

+34
-27
lines changed

1 file changed

+34
-27
lines changed

tools/icu/README.md

+34-27
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
# Notes about the icu directory.
1+
# Notes about the `tools/icu` subdirectory
2+
3+
This directory contains tools, data, and information about the [http://icu-project.org](ICU) (International Components for Unicode) integration. ICU is used to provide internationalization functionality.
4+
5+
- `patches/` are one-off patches, actually entire source file replacements, organized by ICU version number.
6+
- `icu_small.json` controls the "small" (English only) ICU. It is input to `icutrim.py`
7+
- `icu-generic.gyp` is the build file used for most ICU builds within ICU. <!-- have fun -->
8+
- `icu-system.gyp` is an alternate build file used when `--with-intl=system-icu` is invoked. It builds against the `pkg-config` located ICU.
9+
- `iculslocs.cc` is source for the `iculslocs` utility, invoked by `icutrim.py` as part of repackaging. Not used separately. See source for more details.
10+
- `no-op.cc` — empty function to convince gyp to use a C++ compiler.
11+
- `README.md` — you are here
12+
- `shrink-icu-src.py` — this is used during upgrade (see guide below)
213

314
## How to upgrade ICU
415

@@ -12,13 +23,13 @@
1223
make
1324
```
1425

15-
(The equivalent `vcbuild.bat` commands should work also. Note that we use the `.tgz` and not the `.zip` here,
16-
that is because of line endings.)
26+
> _Note_ in theory, the equivalent `vcbuild.bat` commands should work also,
27+
but the commands below are makefile-centric.
1728

18-
- (note- may need to make changes in `icu-generic.gyp` or `tools/icu/patches` for
19-
version specific stuff)
29+
- If there are ICU version-specific changes needed, you may need to make changes in `icu-generic.gyp` or add patch files to `tools/icu/patches`.
30+
- Specifically, look for the lists in `sources!` in the `icu-generic.gyp` for files to exclude.
2031

21-
- Verify the node build works
32+
- Verify the node build works:
2233

2334
```shell
2435
make test-ci
@@ -27,13 +38,12 @@ make test-ci
2738
Also running
2839

2940
<!-- eslint-disable strict -->
41+
3042
```js
3143
new Intl.DateTimeFormat('es', {month: 'long'}).format(new Date(9E8));
3244
```
3345

3446
…Should return `January` not `enero`.
35-
(TODO here: improve [testing](https://github.com/nodejs/Intl/issues/16))
36-
3747

3848
- Now, copy `deps/icu` over to `deps/icu-small`
3949

@@ -43,25 +53,25 @@ python tools/icu/shrink-icu-src.py
4353

4454
- Now, do a clean rebuild of node to test:
4555

46-
(TODO: fix this when these options become default)
47-
4856
```shell
49-
./configure --with-intl=small-icu --with-icu-source=deps/icu-small
57+
make -k distclean
58+
./configure
5059
make
5160
```
5261

5362
- Test this newly default-generated Node.js
5463

5564
<!-- eslint-disable strict -->
65+
5666
```js
5767
process.versions.icu;
5868
new Intl.DateTimeFormat('es', {month: 'long'}).format(new Date(9E8));
5969
```
6070

61-
(should return your updated ICU version number, and also `January` again.)
71+
(This should print your updated ICU version number, and also `January` again.)
6272

63-
- You are ready to check in the updated `deps/small-icu`.
64-
This is a big commit, so make this a separate commit from other changes.
73+
You are ready to check in the updated `deps/small-icu`. This is a big commit,
74+
so make this a separate commit from the smaller changes.
6575

6676
- Now, rebuild the Node license.
6777

@@ -85,30 +95,27 @@ make test-ci
8595

8696
- commit the change to `configure` along with the updated `LICENSE` file.
8797

98+
- Note: To simplify review, I often will “pre-land” this patch, meaning that I run the patch through `curl -L https://github.com/nodejs/node/pull/xxx.patch | git am -3 --whitespace=fix` per the collaborator’s guide… and then push that patched branch into my PR's branch. This reduces the whitespace changes that show up in the PR, since the final land will eliminate those anyway.
99+
88100
-----
89101

90-
## Notes about these tools
102+
## Postscript about the tools
91103

92-
The files in this directory were written for the node.js effort. It's
93-
the intent of their author (Steven R. Loomis / srl295) to merge them
94-
upstream into ICU, pending much discussion within the ICU-PMC.
104+
The files in this directory were written for the node.js effort.
105+
It was the intent of their author (Steven R. Loomis / srl295) to
106+
merge them upstream into ICU, pending much discussion within the
107+
ICU-TC.
95108

96109
`icu_small.json` is somewhat node-specific as it specifies a "small ICU"
97110
configuration file for the `icutrim.py` script. `icutrim.py` and
98111
`iculslocs.cpp` may themselves be superseded by components built into
99-
ICU in the future.
100-
101-
The following tickets were opened during this work, and their
102-
resolution may inform the reader as to the current state of icu-trim
103-
upstream:
112+
ICU in the future. As of this writing, however, the tools are separate
113+
entities within Node, although theyare being scrutinized by interested
114+
members of the ICU-TC. The “upstream” ICU bugs are given below.
104115

105116
* [#10919](http://bugs.icu-project.org/trac/ticket/10919)
106117
(experimental branch - may copy any source patches here)
107118
* [#10922](http://bugs.icu-project.org/trac/ticket/10922)
108119
(data packaging improvements)
109120
* [#10923](http://bugs.icu-project.org/trac/ticket/10923)
110121
(rewrite data building in python)
111-
112-
When/if components (not including the `.json` file) are merged into
113-
ICU, this code and `configure` will be updated to detect and use those
114-
variants rather than the ones in this directory.

0 commit comments

Comments
 (0)