Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#1938 closed task (fixed)

LC_ALL=C causes bash testsuite failure and ugly "make menuconfig" output

Reported by: alexander@… Owned by: lfs-book@…
Priority: normal Milestone:
Component: Book Version: SVN
Severity: normal Keywords:
Cc:

Description

Bash-3.2 uses LANG=en_US.UTF-8 in the run-intl test. However, we set LC_ALL=C in the environment, and that overrides $LANG in the test, leading to the failure.

The minimal solution is:

sed -i 's/LANG/LC_ALL/' tests/intl.tests

However, I don't know if the original reasoning for setting LC_ALL=C during the whole build still holds. LC_ALL=C is certainly a wrong thing to do during "make menuconfig" of the kernel, because this prevents line drawing characters from being displayed correctly on UTF-8 linux text console during configuration.

Change History (9)

comment:1 by Matthew Burgess, 17 years ago

Milestone: 6.3

Well, 4.4 says:

The LC_ALL variable controls the localization of certain programs, making their messages follow the conventions of a specified country. If the host system uses a version of Glibc older than 2.2.4, having LC_ALL set to something other than “POSIX” or “C” (during this chapter) may cause issues if you exit the chroot environment and wish to return later. Setting LC_ALL to “POSIX” or “C” (the two are equivalent) ensures that everything will work as expected in the chroot environment.

iv: Host Requirements says:

Glibc-2.2.5

So, the question now is, was glibc <= 2.2.4 the only reason that LC_ALL=POSIX is being used? If so, it looks like it can be removed.

comment:2 by alexander@…, 17 years ago

The issue is more complex. "make menuconfig" absolutely requires the correct $LANG on Linux console. Here "correct" means "correct for the host", not necessarily "correct for the final LFS system" (although, in the case when they are different, the important problem of migrating to a different locale is left up to the reader).

But compiling the kernel itself with non-English $LANG or $LC_ALL will embed the translation of the string "version" into /proc/version, which is not desired. Also, I am not sure if LFS is buildable at all with LANG=et_EE or et_EE.UTF-8 instead of LC_ALL=POSIX (because in this locale, the letter "z" is in the middle of the naturally sorted alphabet, and the regular expression [a-z] misses some Latin letters, which can confuse some old configure scripts).

comment:3 by alexander@…, 17 years ago

Just in case it wasn't clear from my previous reply: dropping LC_ALL=POSIX doesn't cause the correct $LANG to appear magically in the environment.

comment:4 by manuel@…, 17 years ago

Thus, to fix the Bash test the next sed should do the trick, right?

sed -i 's/LANG/LC_ALL/' tests/intl.tests

For the kernel menuconfig, could this work?

make LANG=<host_LANG_value> menuconfig

comment:5 by alexander@…, 17 years ago

You have got the idea - but for "make menuconfig" you also have to unset LC_ALL. Maybe: make LANG=<host_LANG_or_LC_CTYPE_value> LC_ALL= menuconfig

comment:6 by manuel@…, 17 years ago

I committed the changes on r8149.

Please, review it and close this ticket if all looks good.

comment:7 by dnicholson@…, 17 years ago

Seems alright to me. The only issue (existed before your commit) is that we hack around a lot with the bash testsuite but don't explain it at all. I'd like to change

To prepare the tests, ensure that locales are set correctly in our
environment and that the nobody user can write to the source tree:

sed -i 's/LANG/LC_ALL/' tests/intl.tests
chown -Rv nobody ./

Now, run the tests as the nobody user:

su-tools nobody -s /bin/bash -c "make tests"

comment:8 by manuel@…, 17 years ago

Resolution: fixed
Status: newclosed

Added explanations to Bash testsuite commands in r8153

comment:9 by Jeremy Huntwork, 17 years ago

Milestone: 6.3

Milestone 6.3 deleted

Note: See TracTickets for help on using tickets.