Skip to content

Commit ee9c0b9

Browse files
committed
ICU-10923 Rewriting data build orchestration in Python.
- Creates new Python package in icu4c/data/buildtool - Creates BUILRDULES.py in icu4c/data and icu4c/test/testdata, unified between Unix/Windows - Removes most data build orchestration rules from makedata.mak, testdata.mak, data/Makefile.in, and test/testdata/Makefile.in - Removes pool.res files and builds them on the fly instead
1 parent 2d3901a commit ee9c0b9

File tree

25 files changed

+1532
-1462
lines changed

25 files changed

+1532
-1462
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Global ignores
2+
__pycache__/
3+
*.pyc
4+
5+
# Specific file name ignores
16
/.git
27
icu4c/bin
38
icu4c/bin32uwp
@@ -77,6 +82,7 @@ icu4c/source/data/obj
7782
icu4c/source/data/out
7883
icu4c/source/data/packagedata
7984
icu4c/source/data/pkgdataMakefile
85+
icu4c/source/data/rules.mk
8086
icu4c/source/data/uni-core-data
8187
icu4c/source/data/x64
8288
icu4c/source/data/x86
@@ -621,6 +627,7 @@ icu4c/source/test/testdata/Makefile
621627
icu4c/source/test/testdata/out
622628
icu4c/source/test/testdata/pkgdata.inc
623629
icu4c/source/test/testdata/pkgdataMakefile
630+
icu4c/source/test/testdata/rules.mk
624631
icu4c/source/test/testmap/*.d
625632
icu4c/source/test/testmap/Debug
626633
icu4c/source/test/testmap/Makefile

icu4c/source/configure

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4200,7 +4200,7 @@ fi
42004200
#AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
42014201
#AC_CHECK_PROG(STRIP, strip, strip, true)
42024202

4203-
for ac_prog in python3
4203+
for ac_prog in python3 "py -3"
42044204
do
42054205
# Extract the first word of "$ac_prog", so it can be a program name with args.
42064206
set dummy $ac_prog; ac_word=$2
@@ -9121,6 +9121,24 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
91219121
fi
91229122
91239123
9124+
if test -z "$PYTHON3";
9125+
then
9126+
echo "" > data/rules.mk
9127+
else
9128+
echo "Spawning Python to generate data/rules.mk..."
9129+
PYTHONPATH="$srcdir/data" $PYTHON3 -m buildtool \
9130+
--format gnumake \
9131+
--seqmode parallel \
9132+
--glob_dir "$srcdir/data" \
9133+
> data/rules.mk
9134+
echo "Spawning Python to generate test/testdata/rules.mk..."
9135+
PYTHONPATH="$srcdir/test/testdata:$srcdir/data" $PYTHON3 -m buildtool \
9136+
--format gnumake \
9137+
--seqmode parallel \
9138+
--glob_dir "$srcdir/test/testdata" \
9139+
> test/testdata/rules.mk
9140+
fi
9141+
91249142
echo
91259143
echo "ICU for C/C++ $VERSION is ready to be built."
91269144
echo "=== Important Notes: ==="
@@ -9205,15 +9223,7 @@ fi
92059223
92069224
if test -z "$PYTHON3";
92079225
then
9208-
echo ""
9209-
echo "NOTICE: Unable to find Python 3. ICU versions 64 and later will require Python 3 to build."
9210-
echo "See ICU-10923 for more information: https://unicode-org.atlassian.net/browse/ICU-10923"
9211-
echo ""
9212-
else
9213-
echo ""
9214-
echo "Found Python 3. You are all set for ICU 64, which will require Python 3 to build."
9215-
echo "For more info on Python 3 requirement, see: https://unicode-org.atlassian.net/browse/ICU-10923"
9216-
echo ""
9226+
echo "** Note: Python 3 not found. You will not be able to build data from source."
92179227
fi
92189228
92199229
$as_unset _CXX_CXXSUFFIX

icu4c/source/configure.ac

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ fi
195195
#AC_CHECK_PROG(AUTOCONF, autoconf, autoconf, true)
196196
#AC_CHECK_PROG(STRIP, strip, strip, true)
197197

198-
AC_CHECK_PROGS(PYTHON3, python3)
198+
AC_CHECK_PROGS(PYTHON3, python3 "py -3")
199199

200200
# Check for the platform make
201201
AC_PATH_PROGS(U_MAKE, gmake gnumake, make)
@@ -1385,6 +1385,24 @@ AC_CONFIG_FILES([icudefs.mk \
13851385
samples/cal/Makefile samples/layout/Makefile])
13861386
AC_OUTPUT
13871387

1388+
if test -z "$PYTHON3";
1389+
then
1390+
echo "" > data/rules.mk
1391+
else
1392+
echo "Spawning Python to generate data/rules.mk..."
1393+
PYTHONPATH="$srcdir/data" $PYTHON3 -m buildtool \
1394+
--format gnumake \
1395+
--seqmode parallel \
1396+
--glob_dir "$srcdir/data" \
1397+
> data/rules.mk
1398+
echo "Spawning Python to generate test/testdata/rules.mk..."
1399+
PYTHONPATH="$srcdir/test/testdata:$srcdir/data" $PYTHON3 -m buildtool \
1400+
--format gnumake \
1401+
--seqmode parallel \
1402+
--glob_dir "$srcdir/test/testdata" \
1403+
> test/testdata/rules.mk
1404+
fi
1405+
13881406
echo
13891407
echo "ICU for C/C++ $VERSION is ready to be built."
13901408
echo "=== Important Notes: ==="
@@ -1466,15 +1484,7 @@ fi
14661484

14671485
if test -z "$PYTHON3";
14681486
then
1469-
echo ""
1470-
echo "NOTICE: Unable to find Python 3. ICU versions 64 and later will require Python 3 to build."
1471-
echo "See ICU-10923 for more information: https://unicode-org.atlassian.net/browse/ICU-10923"
1472-
echo ""
1473-
else
1474-
echo ""
1475-
echo "Found Python 3. You are all set for ICU 64, which will require Python 3 to build."
1476-
echo "For more info on Python 3 requirement, see: https://unicode-org.atlassian.net/browse/ICU-10923"
1477-
echo ""
1487+
echo "** Note: Python 3 not found. You will not be able to build data from source."
14781488
fi
14791489

14801490
$as_unset _CXX_CXXSUFFIX

0 commit comments

Comments
 (0)