|
|
Message-ID: <20261002053800.GA29287@brightrain.aerifal.cx>
Date: Fri, 2 Oct 2026 01:38:00 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: [PATCH v2] musl locale overhaul series, take 2
The attached patch series is the current contents of my integration
branch for the locale support overhaul project, funded by NLnet and
the NGI Zero Core Fund. Compared to the v1 draft, this is now largely
in the form it will be merged to the master branch after the 1.2.7
bugfix release. Significant additional work has been done to eliminate
most of the increased size of global data for locale, and to reduce
code churn at the same time.
As before these are factored into small commits to admit individual
assessment both now and in the historical record. The high-level
changes are:
- Updates of built-in character data to Unicode 17. This is entirely
mechanical, generated by musl-chartable-tools[1], probably not
intersting to read. The bugs present in the v1 patch series due to
parse errors during table generation are now fixed.
- Code to process the new locale file format, and changes to switch
over to using it.
- No longer synthesizing dummy locales for requested locale names that
don't exist. setlocale(cat,"") still succeeds in this case but the
resulting locale name will be C.UTF-8. Explicit requests for a name
result in failure.
- Linear-search-free versions of all of the error message lookup
interfaces (strerror, hstrerror, gai_strerror, regerror), signal
name lookup (strsignal), nl_langinfo (this is the backend for
localized data/time formatting), and gettext error messages. These
now all use the new string table lookup infrastructure for both
built-in and locale string tables.
- Collation interfaces (strcoll, strxfrm, wcscoll, wcsxfrm) that pass
conformance test vectors with the CLDR root data. This includes the
NFD iterator and decomposition tables (large) which are generated by
the musl-uca-draft[2] tooling.
- localeconv implementation that reports LC_NUMERIC and LC_MONETARY
properties set in the locale file.
- strfmon implementation that honors LC_MONETARY properties to format
monetary quantities.
- Setting a policy for a default locale search path. The default path
is "/etc/musl/locale:/usr/share/musl/locale:/share/musl/locale" and
setting the environment variable MUSL_LOCALE_PATH will override it.
This may still be changed up until release of 1.2.8 if there are
compelling reasons to alter the default/search logic.
The full list of commits included in this series is:
f0c71559 update character type data and case mappings to unicode 17.0.0
83ab1947 langinfo: add alternative month name keys from POSIX 2024
0f521122 add integer-keyed multi-level table lookup for new locale support
42c57b8d add common __loc_lookup backend for new locale
deba1b9e add include frameworks for building built-in C locale string tables
0fdc2d64 switch langinfo and error strings over to new common table lookup
05e68e1c add langinfo keys for alt months to string table
0cfd41aa locale: remove synthesis of nonexistent locale names
27359091 locale: make explicit request of unavailable locales fail
9b7e95d5 locale: add loader for new locale format & adjust related logic
5bcf0d48 locale: replace gettext-based string lookups with new int-keyed tables
07bb8079 remove references to old translation framework from getopt and strsignal
5ddebacd convert strsignal to use new locale string table lookups
4df51353 convert getopt to use new locale string table lookups
8ef4199d locale: remove now-unused gettext-style translation code
fe70f88f add an iterator for unicode normalization form NFD for internal use
aba70836 add collation implementation
304767d2 move global_locale object out of libc struct
c45dbe1d implement non-stub localeconv
331f8c00 implement a working, non-stub strfmon
81ab5823 add a default locale path and switch to new environment variable
ef8494a4 stop locale path search on any error except deterministic unavailability
4ca9e890 remove always-true conditional from __get_locale success path
[1] https://github.com/richfelker/musl-chartable-tools
[2] https://codeberg.org/dalias/musl-uca-draft
View attachment "0001-update-character-type-data-and-case-mappings-to-unic.patch" of type "text/plain" (80298 bytes)
View attachment "0002-langinfo-add-alternative-month-name-keys-from-POSIX-.patch" of type "text/plain" (1302 bytes)
View attachment "0003-add-integer-keyed-multi-level-table-lookup-for-new-l.patch" of type "text/plain" (3213 bytes)
View attachment "0004-add-common-__loc_lookup-backend-for-new-locale.patch" of type "text/plain" (2684 bytes)
View attachment "0005-add-include-frameworks-for-building-built-in-C-local.patch" of type "text/plain" (2603 bytes)
View attachment "0006-switch-langinfo-and-error-strings-over-to-new-common.patch" of type "text/plain" (24685 bytes)
View attachment "0007-add-langinfo-keys-for-alt-months-to-string-table.patch" of type "text/plain" (1165 bytes)
View attachment "0008-locale-remove-synthesis-of-nonexistent-locale-names.patch" of type "text/plain" (1552 bytes)
View attachment "0009-locale-make-explicit-request-of-unavailable-locales-.patch" of type "text/plain" (2625 bytes)
View attachment "0010-locale-add-loader-for-new-locale-format-adjust-relat.patch" of type "text/plain" (3296 bytes)
View attachment "0011-locale-replace-gettext-based-string-lookups-with-new.patch" of type "text/plain" (3569 bytes)
View attachment "0012-remove-references-to-old-translation-framework-from-.patch" of type "text/plain" (1109 bytes)
View attachment "0013-convert-strsignal-to-use-new-locale-string-table-loo.patch" of type "text/plain" (6618 bytes)
View attachment "0014-convert-getopt-to-use-new-locale-string-table-lookup.patch" of type "text/plain" (5737 bytes)
View attachment "0015-locale-remove-now-unused-gettext-style-translation-c.patch" of type "text/plain" (2184 bytes)
View attachment "0016-add-an-iterator-for-unicode-normalization-form-NFD-f.patch" of type "text/plain" (88676 bytes)
View attachment "0017-add-collation-implementation.patch" of type "text/plain" (17990 bytes)
View attachment "0018-move-global_locale-object-out-of-libc-struct.patch" of type "text/plain" (5115 bytes)
View attachment "0019-implement-non-stub-localeconv.patch" of type "text/plain" (7363 bytes)
View attachment "0020-implement-a-working-non-stub-strfmon.patch" of type "text/plain" (6658 bytes)
View attachment "0021-add-a-default-locale-path-and-switch-to-new-environm.patch" of type "text/plain" (1399 bytes)
View attachment "0022-stop-locale-path-search-on-any-error-except-determin.patch" of type "text/plain" (1262 bytes)
View attachment "0023-remove-always-true-conditional-from-__get_locale-suc.patch" of type "text/plain" (1303 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.