This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] locale: Fix localedef exit code [BZ #22292]
On 10/15/2017 02:01 PM, Andreas Schwab wrote:
> On Okt 15 2017, Carlos O'Donell <carlos@redhat.com> wrote:
>
>> On 10/15/2017 02:14 AM, Andreas Schwab wrote:
>>> On Okt 13 2017, Carlos O'Donell <carlos@redhat.com> wrote:
>>>
>>>> This has allowed the following fix:
>>>> * Previously any warnings were being treated as errors
>>>> because they incremented error_message_count, but now
>>>> we properly return an exit status of 1 if there are
>>>> warnings but output was generated.
>>>
>>> This breaks make localedata/install-locales.
>>
>> What breakage are you seeing?
>
> https://build.opensuse.org/package/live_build_log/home:Andreas_Schwab:glibc/glibc/f/x86_64
Thank you for the context. That is very helpful.
You are building a locale/charmap combination that is not supported
(in the SUPPORTED file) and has a warning. The warning in this case
is that SHIFT_JIS and SHIFT_JISX0213 are not ASCII compatible.
POSIX requires that if we issue a warning, and still output the locale
anyway, that the error code is 1.
If you are building non-standard locale/charmap combinations, and we
want to make localedata/install-locales to work, then we need to do one
of two things:
(a) Support having locales that have warnings (and adjust our install
process to accept 0 or 1 as a valid return code from localedef).
(b) Do not make ASCII compatibility a warning. See the large comment
in locale/programs/charmap.c line ~205. It would appear that the
SHIFT_JIS* charmaps violate this ISO C requirement, which could
cause problems for some programs, thus the warning
(in localedata/gen-locale.sh I work around this for SHIFT_SJIS
for testing shift charmaps).
Only now with proper warning/errors in place can we reliably get to
the point about having this discussion (previous to my fixes it was
a mess).
Which of (a) or (b) do you prefer?
--
Cheers,
Carlos.