Skip to content

Commit

Permalink
doc: document and warn if the ICU version is too old
Browse files Browse the repository at this point in the history
Fixes: nodejs#19657

PR-URL: nodejs#23766
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Ujjwal Sharma <[email protected]>
  • Loading branch information
srl295 committed Oct 23, 2018
1 parent 341006b commit d8b6a1d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,10 @@ You can find other ICU releases at
Download the file named something like `icu4c-**##.#**-src.tgz` (or
`.zip`).

To check the minimum recommended ICU, run `./configure --help` and see
the help for the `--with-icu-source` option. A warning will be printed
during configuration if the ICU version is too old.

##### Unix/macOS

From an already-unpacked ICU:
Expand Down
9 changes: 8 additions & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
valid_mips_fpu = ('fp32', 'fp64', 'fpxx')
valid_mips_float_abi = ('soft', 'hard')
valid_intl_modes = ('none', 'small-icu', 'full-icu', 'system-icu')
with open ('tools/icu/icu_versions.json') as f:
icu_versions = json.load(f)

# create option groups
shared_optgroup = optparse.OptionGroup(parser, "Shared libraries",
Expand Down Expand Up @@ -425,7 +427,9 @@
intl_optgroup.add_option('--with-icu-source',
action='store',
dest='with_icu_source',
help='Intl mode: optional local path to icu/ dir, or path/URL of icu source archive.')
help='Intl mode: optional local path to icu/ dir, or path/URL of '
'the icu4c source archive. '
'v%d.x or later recommended.' % icu_versions["minimum_icu"])

parser.add_option('--with-ltcg',
action='store_true',
Expand Down Expand Up @@ -1452,6 +1456,9 @@ def write_config(data, name):
icu_ver_major = m.group(1)
if not icu_ver_major:
error('Could not read U_ICU_VERSION_SHORT version from %s' % uvernum_h)
elif int(icu_ver_major) < icu_versions["minimum_icu"]:
error('icu4c v%d.x is too old, v%d.x or later is required.' % (int(icu_ver_major),
icu_versions["minimum_icu"]))
icu_endianness = sys.byteorder[0];
o['variables']['icu_ver_major'] = icu_ver_major
o['variables']['icu_endianness'] = icu_endianness
Expand Down
3 changes: 3 additions & 0 deletions tools/icu/icu_versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"minimum_icu": 57
}

0 comments on commit d8b6a1d

Please sign in to comment.