summaryrefslogtreecommitdiff
path: root/Admin/README.update
blob: fe028cef09bea42b667e7faa47cda6930aa8a10b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
-*- outline -*-

The substance of libunistring is maintained in Gnulib:

  https://git.savannah.gnu.org/gitweb/?p=gnulib.git

This file attempts to describe the procedure of updating Gnulib to the
latest Unicode release.  Also, a few scripts are included here to make
the update job easier.  All those scripts respect the following
environment variables

- GNULIB_SRCDIR, which points to the absolute path of the Gnulib
- UCD, which points to the directory containing the Unicode UCD

Before updating, read the Unicode release note carefully and
understand any changes that might affect Gnulib.  The release notes are
typically available at:

  https://unicode.org/versions/Unicode<VERSION>/

In particular, changes in the text segmentation algorithms often
require manual adjustment of source files:

  - For unigbrk/ updates, look at the revision history of UAX #29
    <https://www.unicode.org/reports/tr29/>, section 3.
  - For uniwbrk/ updates, look at the revision history of UAX #29
    <https://www.unicode.org/reports/tr29/>, section 4.
  - For unilbrk/ updates, look at the revision history of UAX #14
    <https://www.unicode.org/reports/tr14/>.


* Regenerating the Gnulib source code

The source files in Gnulib are updated using a couple of tools:
'lib/gen-uni-tables.c' and 'lib/uniname/gen-uninames.lisp'.

You can use wrapper scripts included in this directory:
'gen-uni-tables' and 'gen-uninames' as follows:

  $ export GNULIB_SRCDIR=..
  $ export UCD=..
  $ ./gen-uni-tables
  $ ./gen-uninames

Note that 'gen-uni-tables' sometimes fails when a large portion of
Unicode data changes.  In that case, errors are reported as assertion
failures and you will need to adjust 'lib/gen-uni-tables.c'.

Also note that the files under 'tests/uniwidth' are currently _not_
updated automatically.  You need to check the test failures by hand.

* Updating the version numbers of modules

The 'libunistring-optional' module in Gnulib allows you to use the
system libunistring, when possible (i.e., when certain modules are
equal to or older than the system libunistring).  This is done by
checking the version specified with gl_LIBUNISTRING_MODULE invocation
in modules:

  $ cat modules/uniwidth/width
  ...
  configure.ac:
  gl_LIBUNISTRING_MODULE([0.9.6], [uniwidth/width])
  ...

The version specified as the first argument should be incremented when
the behavior of the module changes.  Thus, if you regenerate the
Gnulib source files for the latest Unicode release, you will also need
to bump the version of affected modules.

To identify affected modules, you can use the following command:

  $ (cd $GNULIB_SRCDIR && git show --oneline --name-only $COMMIT | tail -n+2) \
    | ./containing | LC_ALL=C sort -u \
    | ./dependent | LC_ALL=C sort -u

where $COMMIT is a git commit ID, which points to the regeneration,
and 'containing' and 'dependent' are scripts included here.  Note that
this command takes some time to complete.  Also, it is useful to
temporarily remove the dependency to 'wcwidth' from modules/mbchar
before this command.

Daiki Ueno <ueno@gnu.org>