icu issues

2017.03.04


tmp> icuinfo
icuinfo: error while loading shared libraries: libicudata.so.58: cannot open shared object file: No such file or directory
tmp> ldd /usr/local/bin/icuinfo 
	/usr/lib/arm-linux-gnueabihf/libcofi_rpi.so (0xb6f62000)
	libicutu.so.58 => /usr/local/lib/libicutu.so.58 (0xb6efd000)
	libicui18n.so.58 => /usr/local/lib/libicui18n.so.58 (0xb6cdf000)
	libicuuc.so.58 => /usr/local/lib/libicuuc.so.58 (0xb6b71000)
	libicudata.so.58 => not found
	libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0 (0xb6b43000)
	libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6b38000)
	libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0xb6a66000)
	libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0xb69f5000)
	libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0xb69cd000)
	libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6898000)
	/lib/ld-linux-armhf.so.3 (0x7f58f000)
	libicudata.so.58 => not found
	libicudata.so.58 => not found
	libicudata.so.58 => not found
tmp> ll /usr/local/lib/libicudata.so.58
lrwxrwxrwx 1 root staff 18 Dec 11 21:17 /usr/local/lib/libicudata.so.58 -> libicudata.so.58.2
tmp> file /usr/local/lib/libicudata.so.58.2 
/usr/local/lib/libicudata.so.58.2: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, BuildID[sha1]=0x0606af13518127971c738484a8dc68ded929d384, not stripped
tmp> file /usr/local/lib/libicuuc.so.58.2 
/usr/local/lib/libicuuc.so.58.2: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, BuildID[sha1]=0xe467e7d564818436a7ab229c104d6883b2f499f2, not stripped

The tar I extracted and built was icu4c-58_2-src.tgz (still in /tmp).

2017.09.23-24

Downloaded, extracted, installed as a git repo: ~/git/icu version icu4c-59_1-src
Created a dev branch, and applied there the recommendations in the readme file (namespace, UTF8).
Applied to files although they prevent compiling the ICU test suites:

source> ./runConfigureICU --enable-debug --disable-release Linux/gcc --with-data-packaging=archive --enable-static
--disable-shared
source> make
source> make install
make[0]: Making `install' in `stubdata'
make[1]: Entering directory '/home/marc/git/icu/source/stubdata'
/bin/bash ../mkinstalldirs /usr/local/lib
/usr/bin/install -c libicudata.a /usr/local/lib
/usr/bin/install: cannot create regular file ‘/usr/local/lib/libicudata.a’: Permission denied
...
source> ll stubdata/
total 76
drwxr-xr-x  2 marc marc  4096 Sep 23 15:25 .
drwxr-xr-x 16 marc marc  4096 Sep 23 16:37 ..
-rw-r--r--  1 marc marc  4219 Sep 23 15:24 Makefile
-rw-r--r--  1 marc marc  4236 Jun 15  2016 Makefile.in
-rw-r--r--  1 marc marc  9880 Sep 23 15:25 libicudata.a
-rw-r--r--  1 marc marc  9732 Sep 23 15:25 stubdata.ao
-rw-r--r--  1 marc marc  2466 Jan 20  2017 stubdata.cpp
-rw-r--r--  1 marc marc   336 Sep 23 15:25 stubdata.d
-rw-r--r--  1 marc marc 16145 Jan 16  2017 stubdata.vcxproj
-rw-r--r--  1 marc marc  1030 Dec  7  2016 stubdata.vcxproj.filters
Tried, to build the case sample with:

case> make ICU_PREFIX=/home/marc/git/icu/stubdata
but failed, so had to install (to /usr/local/(include|lib|bin|share|sbin):

source> sudo make install
...
case> icuinfo
 <icuSystemParams type="icu4c">
    <param name="copyright"> Copyright (C) 2016 and later: Unicode, Inc. and others. License & terms of use: http://www.unicode.org/copyright.html </param>
    <param name="product">icu4c</param>
    <param name="product.full">International Components for Unicode for C/C++</param>
    <param name="version">59.1</param>
    <param name="version.unicode">9.0</param>
    <param name="platform.number">4000</param>
    <param name="platform.type">Linux</param>
    <param name="locale.default">en_US_POSIX</param>
    <param name="locale.default.bcp47">en-US-u-va-posix</param>
    <param name="converter.default">UTF-8</param>
    <param name="icudata.name">icudt59l</param>
    <param name="icudata.path">/usr/local/share/icu/59.1</param>
    <param name="cldr.version">31.0.1</param>
    <param name="tz.version">2017b</param>
    <param name="tz.default">Universal</param>
    <param name="cpu.bits">32</param>
    <param name="cpu.big_endian">0</param>
    <param name="os.wchar_width">4</param>
    <param name="os.charset_family">0</param>
    <param name="os.host">armv6l-unknown-linux-gnueabihf</param>
    <param name="build.build">armv6l-unknown-linux-gnueabihf</param>
    <param name="build.cc">gcc</param>
    <param name="build.cxx">g++</param>
    <param name="uconfig.internal_digitlist">1</param>
    <param name="uconfig.have_parseallinput">1</param>
    <param name="uconfig.format_fastpaths_49">1</param>
 </icuSystemParams>


ICU Initialization returned: U_ZERO_ERROR
Plugins are disabled.
But this didn't help:

case> make
g++  -std=c++11  -I/usr/local/include   -c case.cpp -o case.o
case.cpp:23:43: error: ‘UnicodeString’ does not name a type
 void printUnicodeString(UFILE *out, const UnicodeString &s) {
                                           ^
case.cpp: In function ‘void printUnicodeString(UFILE*, const int&)’:
case.cpp:24:5: error: ‘UnicodeString’ was not declared in this scope
     UnicodeString other = s;
     ^
case.cpp:24:5: note: suggested alternative:
In file included from case.cpp:16:0:
/usr/local/include/unicode/unistr.h:296:20: note:   ‘icu_59::UnicodeString’
 class U_COMMON_API UnicodeString : public Replaceable
                    ^
case.cpp:25:30: error: ‘other’ was not declared in this scope
     u_fprintf(out, "\"%S\"", other.getTerminatedBuffer());
                              ^
case.cpp: In function ‘int main()’:
case.cpp:49:5: error: ‘UnicodeString’ was not declared in this scope
     UnicodeString string("This is a test");
     ^
case.cpp:49:5: note: suggested alternative:
In file included from case.cpp:16:0:
/usr/local/include/unicode/unistr.h:296:20: note:   ‘icu_59::UnicodeString’
 class U_COMMON_API UnicodeString : public Replaceable
                    ^
case.cpp:55:19: error: expected ‘;’ before ‘upper’
     UnicodeString upper(uppercase);
                   ^
case.cpp:56:19: error: expected ‘;’ before ‘lower’
     UnicodeString lower(lowercase);
                   ^
case.cpp:59:29: error: ‘string’ was not declared in this scope
     printUnicodeString(out, string);
                             ^
case.cpp:59:29: note: suggested alternative:
In file included from /usr/include/c++/4.9/string:39:0,
                 from /usr/local/include/unicode/std_string.h:35,
                 from /usr/local/include/unicode/unistr.h:35,
                 from case.cpp:16:
/usr/include/c++/4.9/bits/stringfwd.h:62:33: note:   ‘std::string’
   typedef basic_string<char>    string;   
                                 ^
case.cpp:70:14: error: ‘upper’ was not declared in this scope
     string = upper; 
              ^
case.cpp:71:37: error: ‘Locale’ was not declared in this scope
     string.toLower(Locale("tr", "TR")); /* Turkish lower case map string =
                                     ^
case.cpp:71:37: note: suggested alternative:
In file included from /usr/local/include/unicode/brkiter.h:49:0,
                 from case.cpp:18:
/usr/local/include/unicode/locid.h:188:20: note:   ‘icu_59::Locale’
 class U_COMMON_API Locale : public UObject {
                    ^
case.cpp:76:14: error: ‘lower’ was not declared in this scope
     string = lower;
              ^
../rules.mk:41: recipe for target 'case.o' failed
make: *** [case.o] Error 1
UnicodeString is defined in /usr/local/include/unistr.h so there may be a namespace issue? yes, but not only...

case> make
g++  -std=c++11  -I/usr/local/include   -c case.cpp -o case.o
gcc    -I/usr/local/include   -c -o ucase.o ucase.c
g++  -std=c++11  -I/usr/local/include  case.o ucase.o  -L/usr/local/lib -licui18n -licuuc -licudata    -licuio     -o case  -licui18n -licuuc
case.o: In function `printUnicodeString(UFILE*, icu_59::UnicodeString const&)':
case.cpp:(.text+0x5c): undefined reference to `icu_59::UnicodeString::UnicodeString(icu_59::UnicodeString const&)'
case.cpp:(.text+0x68): undefined reference to `icu_59::UnicodeString::getTerminatedBuffer()'
case.cpp:(.text+0x7c): undefined reference to `u_fprintf_59'
case.cpp:(.text+0x88): undefined reference to `icu_59::UnicodeString::~UnicodeString()'
case.cpp:(.text+0x98): undefined reference to `icu_59::UnicodeString::~UnicodeString()'
case.o: In function `main':
case.cpp:(.text+0xd4): undefined reference to `u_finit_59'
...
case> nm -C /usr/local/lib/libicuuc.a | grep 'T icu_59::UnicodeString::UnicodeString(icu_59::UnicodeString const&)'
00000d70 T icu_59::UnicodeString::UnicodeString(icu_59::UnicodeString const&)
00000d70 T icu_59::UnicodeString::UnicodeString(icu_59::UnicodeString const&)
Removed the 58.2 shared libraries.

case> make
g++  -std=c++11  -I/usr/local/include   -c case.cpp -o case.o
g++  -std=c++11  -I/usr/local/include  case.o ucase.o  -L/usr/local/lib -licui18n -licuuc -licudata    -licuio     -o case  -licui18n -licuuc
/usr/local/lib/libicuuc.a(putil.ao): In function `uprv_dl_open_59':
/home/marc/git/icu/source/common/putil.cpp:2347: undefined reference to `dlopen'
/usr/local/lib/libicuuc.a(putil.ao): In function `uprv_dl_close_59':
/home/marc/git/icu/source/common/putil.cpp:2360: undefined reference to `dlclose'
/usr/local/lib/libicuuc.a(putil.ao): In function `uprv_dlsym_func_59':
/home/marc/git/icu/source/common/putil.cpp:2371: undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
../rules.mk:13: recipe for target 'case' failed
make: *** [case] Error 1
I reconfigure/clean/rebuild/reinstall with one new flag...

source> ./runConfigureICU --enable-debug --disable-release Linux/gcc --with-data-packaging=archive --enable-static --disable-shared --disable-dyload
...
case> ./case
ICU Case Mapping Sample Program

C++ Case Mapping


string: "This is a test"
toUpper(): "THIS IS A TEST"
toLower(): "this is a test"

lowercase=istanbul, uppercase=İSTANBUL

upper.toLower: "istanbul"
lower.toUpper: "İSTANBUL"
End C++ sample

** C Case Mapping Sample
toupper(k) = K
tolower() = k
totitle(k) = K
u_foldCase(K, U_FOLD_CASE_DEFAULT) = k
u_strToLower(aBI, turkish) -> abı
u_strToUpper(aBi, english) -> ABI
u_strFoldCase(aBı, U_FOLD_CASE_DEFAULT) -> abı

** end of C sample
And in my own test:

tests> c++ -o ilc ilc.cc -g -O0 -std=c++11 -I/usr/local/include -L/usr/local/lib -licui18n -licuuc -licudata -licuio -licui18n -licuuc
tests> ./ilc 'Alexandre Soljénitsyne, Архипелаг ГУЛаг'
string: "Alexandre Soljénitsyne, Архипелаг ГУЛаг" -- lowercase: "alexandre soljénitsyne, архипелаг гулаг"

2017.11.06

Downloaded icu4c-60_1-src.tgz
Committed two changes to samples sources, and switched back to branch master: extracted.
Committed:

icu> git commit -a -m 'icu4c-60_1-src'
[master 29a74ad] icu4c-60_1-src
 414 files changed, 45386 insertions(+), 26796 deletions(-)
 rewrite APIChangeReport.html (66%)
 rewrite source/common/norm2_nfc_data.h (75%)
 rewrite source/common/uchar_props_data.h (88%)
 rewrite source/data/in/coll/ucadata-unihan.icu (67%)
 rewrite source/data/in/nfc.nrm (76%)
 rewrite source/data/in/nfkc.nrm (86%)
 rewrite source/data/in/nfkc_cf.nrm (82%)
 rewrite source/data/in/pnames.icu (91%)
 rewrite source/data/in/unames.icu (96%)
 rewrite source/data/in/uprops.icu (60%)
 rewrite source/data/in/uts46.nrm (86%)
 rewrite source/tools/gennorm2/n2builder.cpp (66%)
icu> git checkout dev
Checking out files: 100% (416/416), done.
Switched to branch 'dev'
Relevant change in the readme file:

@@ -630,6 +630,14 @@
         (via -D or uconfig.h, as above)
         and include those header files explicitly that you actually need.<br />
         Note: The ICU test suites cannot be compiled with this setting.</li>
+      <li><b>utf_old.h:</b>
+        All of utf_old.h is deprecated or obsolete.<br />
+        Beginning with ICU 60,
+        you should define <code>U_HIDE_OBSOLETE_UTF_OLD_H</code> to 1
+        (via -D or uconfig.h, as above).
+        Use of any of these macros should be replaced as noted
+        in the comments for the obsolete macro.<br />
+        Note: The ICU test suites <i>can</i> be compiled with this setting.</li>
icu> git merge master
Auto-merging source/common/unicode/unistr.h
Auto-merging source/common/unicode/uconfig.h
Auto-merging source/common/unicode/platform.h
error: Terminal is dumb, but EDITOR unset
Not committing merge; use 'git commit' to complete the merge.
icu> git commit -m 'updated to 60.1'
[dev 673a3b8] updated to 60.1
Applied, and committed.

source> ./runConfigureICU --enable-debug --disable-release Linux/gcc --with-data-packaging=archive --enable-static --disable-shared --disable-dyload
source> make
source> make check
source> sudo make install

December 17th

Downloaded 60.2, copied to berry:/tmp.
In the icu repo, in the dev branch, finding 59 files not added to Mostly cpp and h files... Example:

icu> ll source/common/bytesinkutil.cpp
-rw-r--r-- 1 marc marc 3999 Oct 11 16:24 source/common/bytesinkutil.cpp
icu> tar ztf /tmp/icu4c-60_2-src.tgz | grep bytesinkutil.cpp
icu/source/common/bytesinkutil.cpp
Switched back to master. Adding the cpp files first (31), then the h ones (22). Deleted the 3 sample executable (case, ugrep, ustring), as well as source/config/icuinfo.xml not found in the new tar, and assumed to have been generated.
Committed as part of 60.1.

icu> rm -rf *
icu> ll
total 16
drwxr-xr-x 3 marc marc 4096 Dec 17 10:55 .
drwxr-xr-x 7 marc marc 4096 Sep 24 16:54 ..
drwxr-xr-x 8 marc marc 4096 Dec 17 10:52 .git
-rw-r--r-- 1 marc marc 1613 Mar 31  2017 .gitignore
icu> cd ..
git> tar zxf /tmp/icu4c-60_2-src.tgz
git> cd icu
icu> git status
On branch master
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

	modified:   readme.html
	modified:   source/common/common.vcxproj
	modified:   source/common/common.vcxproj.filters
	modified:   source/common/common_uwp.vcxproj
	modified:   source/common/rbbi_cache.h
	modified:   source/common/uchar_props_data.h
	modified:   source/common/ucnv_u8.cpp
	modified:   source/common/unicode/brkiter.h
	modified:   source/common/unicode/ucnv.h
	modified:   source/common/unicode/utext.h
	modified:   source/common/unicode/uvernum.h
	deleted:    source/data/in/icudt59l.dat
	modified:   source/data/in/icudt60l.dat
	modified:   source/data/in/uprops.icu
	modified:   source/extra/uconv/uconv.1.in
	modified:   source/i18n/calendar.cpp
	modified:   source/test/intltest/convtest.cpp
	modified:   source/test/intltest/convtest.h
	modified:   source/test/intltest/dtfmttst.cpp
	modified:   source/test/intltest/dtifmtts.cpp
	modified:   source/test/intltest/dtptngts.cpp
	modified:   source/test/intltest/incaltst.cpp
	modified:   source/test/intltest/intltest.cpp
	modified:   source/test/intltest/transtst.cpp
	modified:   source/test/intltest/ucdtest.cpp
	modified:   source/test/intltest/ucdtest.h
	modified:   source/tools/ctestfw/uperf.cpp
	deleted:    source/tools/escapesrc/output-nochange.cpp
	deleted:    source/tools/escapesrc/output-simple.cpp
	modified:   source/tools/genrb/genrb.cpp
	modified:   source/tools/genrb/parse.cpp
	modified:   source/tools/gensprep/gensprep.c
	modified:   source/tools/makeconv/makeconv.1.in

no changes added to commit (use "git add" and/or "git commit -a")
icu> git commit -a -m 'icu4c-60_2-src'
icu> git checkout dev
icu> git merge master
icu> git commit -a -m 'after merging in icu4c-60_2'
[dev 53a6552] after merging in icu4c-60_2
icu> cd source
source> ./runConfigureICU --enable-debug --disable-release Linux/gcc --with-data-packaging=archive --enable-static --disable-shared --disable-dyload
source> make
source> sudo make install
Testing the ugrep example:

ugrep> make all
g++  -std=c++11  -I/usr/local/include   -c ugrep.cpp -o ugrep.o
g++  -std=c++11  -I/usr/local/include  ugrep.o  -L/usr/local/lib -licui18n -licuuc -licudata      -o ugrep  -licui18n -licuuc
ugrep> cat /tmp/foo
bar
foo
Soljénitsyne
zoo
foo bar zoo
ugrep> ./ugrep 'foo' /tmp/foo
foo
foo bar zoo
ugrep> ./ugrep 'Soljénitsyne' /tmp/foo
Soljénitsyne
ugrep> ./ugrep '^Solj([eé])n.*ne$' /tmp/foo
Soljénitsyne
But the example has no replacement option...

ugrep> make -f usr.mk
g++  -std=c++11  -I/usr/local/include   -c usr.cpp -o usr.o
g++  -std=c++11  -I/usr/local/include  usr.o  -L/usr/local/lib -licui18n -licuuc -licudata      -o usr  -licui18n -licuuc
ugrep> ./usr '^Solj([eé])n.*ne' /tmp/foo
Number of groups: 1
Soljénitsyne: Archipel
ugrep> ./usr '^Solj([eé])n.*ne: (.*)$' /tmp/foo
Number of groups: 2
Soljénitsyne: Archipel
Some work...

ugrep> make -f usr.mk
g++  -std=c++11  -I/usr/local/include   -c usr.cpp -o usr.o
g++  -std=c++11  -I/usr/local/include  usr.o  -L/usr/local/lib -licui18n -licuuc -licudata      -o usr  -licui18n -licuuc
usr.o: In function `main':
usr.cpp:(.text+0x2c8): undefined reference to `icu_60::operator<<(std::ostream&, icu_60::UnicodeString const&)'
collect2: error: ld returned 1 exit status
../rules.mk:13: recipe for target 'usr' failed
make: *** [usr] Error 1
Added -licuio to rules.mk, and:

ugrep> make -f usr.mk
g++  -std=c++11  -I/usr/local/include  usr.o  -L/usr/local/lib -licui18n -licuuc -licudata      -o usr  -licui18n -licuuc -licuio
ugrep> ./usr '^Solj([eé])n.*ne: (.*)$' /tmp/foo
Number of groups: 2
First group: 
Soljénitsyne: Archipel
I.e. not quite yet... After one more change (shouldn't have affected):

ugrep> ./usr '^Solj([eé])n.*ne: (.*)$' /tmp/foo
Number of groups: 2
First group: é
Second group: Archipel
Soljénitsyne: Archipel
Hardcoded, but working:

ugrep> ./usr 'http://(berry314)/(.*)' /tmp/foo
Number of groups: 2
First group: berry314
Second group: архипелаг
Replacement: http://berry314.dyndns-pics.com/архипелаг

http://berry314/архипелаг

April 15th, 2018

Downloaded icu4c-61_1-src.tgz, copied, extracted (same protocol)

icu> rm -rf *
icu> cd ..
git> tar zxf /tmp/icu4c-61_1-src.tgz 
git> cd icu
icu> git add -A
icu> git commit -m icu4c-61_1 -a
icu> git checkout dev
icu> git merge master
icu> git commit -m 'after merging icu4c-61_1' -a
[dev 1a2901e] after merging icu4c-61_1
icu> cd source/
source> ./runConfigureICU --enable-debug --disable-release Linux/gcc --with-data-packaging=archive --enable-static --disable-shared --disable-dyload
source> make
Some manual merge needed... in common/unicode/uversion.h: committed!

source> sudo make install

April 29th, 2018

Built the udata example. writer produces a mypkg_example.dat file, which reader may consume.
This is plain C, and uses only plain ascii.
Extended to write a UChar string, using udata_writeUString.
Using getBuffer. I need to add the 0 explicitly.

udata> make
g++  -std=c++11  -I/usr/local/include  -I../../../source/tools/toolutil  -c -o reader.o reader.cpp
g++  -o reader reader.o  -licuio  -licutu  -L/usr/local/lib -licui18n -licuuc -licudata
g++  -std=c++11  -I/usr/local/include  -I../../../source/tools/toolutil  -c -o writer.o writer.cpp
g++  -o writer writer.o  -licuio  -licutu  -L/usr/local/lib -licui18n -licuuc -licudata
udata> ./writer 
Writing uint16_t value of 2000
Writing string value of EXAMPLE
Writing ustring value of архипелаг (length: 9)
Writing ustring value of Ça va... Il y a toujours à boire et à manger (length: 44)
Calculated size: 120
udata> ./reader
Read value 2000 from data file
Read string EXAMPLE from data file
Read ustring from data file: архипелаг
Read ustring from data file: Ça va... Il y a toujours à boire et à manger

October 7, 2018

Cloned to ~/git/mgirod/icu my own fork of unicode-org/icu and added the update stream:

icu> git remote add update https://github.com/unicode-org/icu.git
icu> git remote -v
origin	https://github.com/mgirod/icu.git (fetch)
origin	https://github.com/mgirod/icu.git (push)
update	https://github.com/unicode-org/icu.git (fetch)
update	https://github.com/unicode-org/icu.git (push)
icu> git pull update master
From https://github.com/unicode-org/icu
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> update/master
Already up-to-date.
Ahum... These were not exactly the instructions...

icu> git remote add upstream [email protected]:unicode-org/icu.git
icu> git remote -v
origin	https://github.com/mgirod/icu.git (fetch)
origin	https://github.com/mgirod/icu.git (push)
update	https://github.com/unicode-org/icu.git (fetch)
update	https://github.com/unicode-org/icu.git (push)
upstream	[email protected]:unicode-org/icu.git (fetch)
upstream	[email protected]:unicode-org/icu.git (push)
icu> gpg --list-keys
gpg: directory `/home/marc/.gnupg' created
gpg: new configuration file `/home/marc/.gnupg/gpg.conf' created
gpg: WARNING: options in `/home/marc/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/home/marc/.gnupg/pubring.gpg' created
gpg: /home/marc/.gnupg/trustdb.gpg: trustdb created
icu> gpg --gen-key
gpg: keyring `/home/marc/.gnupg/secring.gpg' created
Please select what kind of key you want:
   (1) RSA and RSA (default)
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
Your selection? 1
RSA keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) 
Requested keysize is 2048 bits
Please specify how long the key should be valid.
         0 = key does not expire
      <n>  = key expires in n days
      <n>w = key expires in n weeks
      <n>m = key expires in n months
      <n>y = key expires in n years
Key is valid for? (0) 
Key does not expire at all
Is this correct? (y/N) y
You selected this USER-ID:
    "Marc Girod <[email protected]>"
You need a Passphrase to protect your secret key.
gpg: key 54CC4556 marked as ultimately trusted
icu> git config --global user.signingkey 54CC4556
icu> ssh-keygen -t rsa -b 4096 -C [email protected]
icu> git remote set-url origin [email protected]:mgirod/icu.git
icu> git remote -v
origin	[email protected]:mgirod/icu.git (fetch)
origin	[email protected]:mgirod/icu.git (push)
update	https://github.com/unicode-org/icu.git (fetch)
update	https://github.com/unicode-org/icu.git (push)
upstream	[email protected]:unicode-org/icu.git (fetch)
upstream	[email protected]:unicode-org/icu.git (push)
Looks like my gpg is old (1.4), but there is also gpg2 (2.0.26) and the key I generated to short (2048 bits). Anyway, maybe not needed right now.

icu> git pull upstream master
From github.com:unicode-org/icu
 * branch            master     -> FETCH_HEAD
 * [new branch]      master     -> upstream/master
Already up-to-date.
icu> git remote remove update
icu> git remote -v
origin	[email protected]:mgirod/icu.git (fetch)
origin	[email protected]:mgirod/icu.git (push)
upstream	[email protected]:unicode-org/icu.git (fetch)
upstream	[email protected]:unicode-org/icu.git (push)
icu> gpg2 --gen-key
pub   4096R/1C717DDF 2018-10-07
      Key fingerprint = DE6D 6731 4935 D934 F383  F389 EF3D 74D8 1C71 7DDF
uid       [ultimate] Marc Girod <[email protected]>
sub   4096R/6ED3FEEB 2018-10-07
icu> gpg2 --list-secret-keys --keyid-format LONG
...
icu> gpg2 --list-keys
/home/marc/.gnupg/pubring.gpg
-----------------------------
pub   2048R/54CC4556 2018-10-07
uid       [ultimate] Marc Girod <[email protected]>
sub   2048R/647FFECF 2018-10-07

pub   4096R/1C717DDF 2018-10-07
uid       [ultimate] Marc Girod <[email protected]>
sub   4096R/6ED3FEEB 2018-10-07
icu> gpg --armor --export <secret-key>
...
icu> git config --global user.signingkey <secret-key>
And added the 1C717DDF key to github, as well as GPG_TTY=$(tty) to ~/.bash_profile
ICU readme (local), Signing Your Work,
Development
Marc Girod