Skip to content

Commit a6b5231

Browse files
committed
Bug 1533481 - Part 4: Prepare update to ICU 64. r=jwalden!
Summary: - ICU no longer supports removing resource files manually, instead the new data filter builder needs to be used. - This includes test data, which also must be preserved in ICU 64. - umutex.h contains an implicit call to `new` in ICU64 which needs to be allowed in check_vanilla_allocations.py. - Drive-by: Make ICU with multiple jobs for faster rebuilds. Reviewers: jwalden Reviewed By: jwalden Bug #: 1533481 Differential Revision: https://phabricator.services.mozilla.com/D25264 --HG-- extra : rebase_source : 9fde775ee9b189c84a29f69f11ebd955f0030b38
1 parent 0786be3 commit a6b5231

File tree

4 files changed

+68
-35
lines changed

4 files changed

+68
-35
lines changed

config/check_vanilla_allocations.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,14 @@ def main():
150150
if "ProfilingStack" in filename:
151151
continue
152152

153+
# Ignore implicit call to operator new in std::condition_variable_any.
154+
#
155+
# From intl/icu/source/common/umutex.h:
156+
# On Linux, the default constructor of std::condition_variable_any
157+
# produces an in-line reference to global operator new(), [...].
158+
if filename == 'umutex.o':
159+
continue
160+
153161
fn = m.group(2)
154162
if filename == 'jsutil.o':
155163
jsutil_cpp.add(fn)

intl/icu/data_filter.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"featureFilters": {
3+
"brkitr_dictionaries": {
4+
"filterType": "exclude"
5+
},
6+
"brkitr_rules": {
7+
"filterType": "exclude"
8+
},
9+
"brkitr_tree": {
10+
"filterType": "exclude"
11+
},
12+
"conversion_mappings": {
13+
"whitelist": [
14+
"ibm-37_P100-1995",
15+
"ibm-1047_P100-1995"
16+
]
17+
},
18+
"lang_tree": {
19+
"filterType": "exclude"
20+
},
21+
"rbnf_tree": {
22+
"filterType": "exclude"
23+
},
24+
"region_tree": {
25+
"filterType": "exclude"
26+
},
27+
"translit": {
28+
"filterType": "exclude"
29+
},
30+
"unit_tree": {
31+
"filterType": "exclude"
32+
}
33+
},
34+
"resourceFilters": [
35+
{
36+
"categories": [
37+
"zone_tree"
38+
],
39+
"rules": [
40+
"-/zoneStrings/*/ec"
41+
]
42+
}
43+
]
44+
}

intl/icu_sources_data.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from __future__ import print_function
1414

1515
import glob
16+
import multiprocessing
1617
import os
1718
import sets
1819
import shutil
@@ -217,6 +218,13 @@ def update_data_file(topsrcdir):
217218
'-DUCONFIG_NO_BREAK_ITERATION ' +
218219
'-DU_CHARSET_IS_UTF8')
219220
})
221+
222+
# Exclude data that we currently don't need.
223+
#
224+
# The file format for ICU's data build tool is described at
225+
# <https://github.com/unicode-org/icu/blob/master/docs/userguide/icu_data/buildtool.md>.
226+
env["ICU_DATA_FILTER_FILE"] = mozpath.join(topsrcdir, 'intl/icu/data_filter.json')
227+
220228
print('Running ICU configure...')
221229
if not try_run(
222230
'icu-configure',
@@ -235,7 +243,12 @@ def update_data_file(topsrcdir):
235243
env=env):
236244
return False
237245
print('Running ICU make...')
238-
if not try_run('icu-make', ['make'], cwd=objdir):
246+
if not try_run(
247+
'icu-make',
248+
['make',
249+
'--jobs=%d' % multiprocessing.cpu_count(),
250+
'--output-sync'],
251+
cwd=objdir):
239252
return False
240253
print('Copying ICU data file...')
241254
tree_data_path = mozpath.join(topsrcdir,

intl/update-icu.sh

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -44,43 +44,11 @@ git -C ${tmpclonedir} log -1 > ${icu_dir}/GIT-INFO
4444
# Clean up after ourselves.
4545
rm -rf ${tmpclonedir}
4646

47-
# remove layoutex, tests, and samples, but leave makefiles in place
47+
# Remove layoutex, tests, and samples, but leave makefiles and test data in place.
4848
find ${icu_dir}/source/layoutex -name '*Makefile.in' -prune -or -type f -print | xargs rm
49-
find ${icu_dir}/source/test -name '*Makefile.in' -prune -or -type f -print | xargs rm
49+
find ${icu_dir}/source/test -name '*Makefile.in' -prune -or -name 'testdata' -prune -or -type f -print | xargs rm
5050
find ${icu_dir}/source/samples -name '*Makefile.in' -prune -or -type f -print | xargs rm
5151

52-
# remove data that we currently don't need
53-
rm -rf ${icu_dir}/source/data/brkitr/*
54-
rm ${icu_dir}/source/data/lang/*.mk
55-
rm ${icu_dir}/source/data/lang/*.txt
56-
rm ${icu_dir}/source/data/mappings/*.mk
57-
find ${icu_dir}/source/data/mappings \
58-
-name ibm-37_P100-1995.ucm -prune -or \
59-
-name ibm-1047_P100-1995.ucm -prune -or \
60-
-name '*.ucm' -print | xargs rm
61-
rm ${icu_dir}/source/data/rbnf/*
62-
rm ${icu_dir}/source/data/region/*.mk
63-
rm ${icu_dir}/source/data/region/*.txt
64-
rm ${icu_dir}/source/data/translit/*
65-
rm ${icu_dir}/source/data/unit/*.mk
66-
rm ${icu_dir}/source/data/unit/*.txt
67-
68-
# Remove all exemplar cities 'ec'. (bug 1225401 and bug 1345336)
69-
find ${icu_dir}/source/data/zone \
70-
-name root.txt -prune -or \
71-
-name tzdbNames.txt -prune -or \
72-
-name '*.txt' -print | xargs sed -i '/^\s*ec{\".*\"}$/ { d }'
73-
# Remove empty time zone entries after exemplar cities removal.
74-
find ${icu_dir}/source/data/zone \
75-
-name root.txt -prune -or \
76-
-name tzdbNames.txt -prune -or \
77-
-name '*.txt' -print | xargs sed -i '/^\s*\"[A-Z][a-zA-Z:_-]*\"{/{N; s/^\s*\"[A-Z][a-zA-Z:_-]*\"{\n\s*}// }; /^$/d'
78-
# And finally remove any empty 'zoneStrings' entries.
79-
find ${icu_dir}/source/data/zone \
80-
-name root.txt -prune -or \
81-
-name tzdbNames.txt -prune -or \
82-
-name '*.txt' -print | xargs sed -i '/^\s*zoneStrings{/{N; s/^\s*zoneStrings{\n\s*}// }; /^$/d'
83-
8452
for patch in \
8553
bug-915735 \
8654
suppress-warnings.diff \

0 commit comments

Comments
 (0)