FS#74864 - [systemd] >= 251 breaks devtools' locale
Attached to Project:
Arch Linux
Opened by Felix Yan (felixonmars) - Friday, 27 May 2022, 02:31 GMT
Last edited by freswa (frederik) - Monday, 06 June 2022, 09:47 GMT
Opened by Felix Yan (felixonmars) - Friday, 27 May 2022, 02:31 GMT
Last edited by freswa (frederik) - Monday, 06 June 2022, 09:47 GMT
|
Details
Description:
systemd >= 251 forces LANG to be set to C.UTF-8 which overrides our devtools settings at https://gitlab.archlinux.org/archlinux/devtools/-/blob/master/mkarchroot.in#L88 This effectively breaks packages relying on a UTF-8 locale to build. Relevant commit is https://github.com/systemd/systemd/commit/b626f6959bcee11d966f96bd29a00502f4aa2ce4 Example of failures due to this: https://paste.xinu.at/4oGr9k/ Additional info: * package version(s) systemd 251-1 & 251.1-1 |
This task depends upon
Closed by freswa (frederik)
Monday, 06 June 2022, 09:47 GMT
Reason for closing: Implemented
Additional comments about closing: glibc-2.35-6
Monday, 06 June 2022, 09:47 GMT
Reason for closing: Implemented
Additional comments about closing: glibc-2.35-6
Researching the back story [1] indicates upstream are ultimately wanting to include C.UTF-8 as built-in to Glibc itself (exactly how the "C" locale is currently handled). Even though this didn't quite happen in the 2.35 release, maybe we should simply include it with our glibc by default anyway? This is what Debian / Fedora appear to be doing. I haven't looked in detail yet but hopefully it's a simple matter of crafting a suitable "localedef" command.
Failing that, someone should just whack C.UTF-8 into devtools and get a release out ASAP. Thanks!
[1] https://sourceware.org/glibc/wiki/Proposals/C.UTF-8
Any objections?
Currently the install script has `locale-gen` in `post_upgrade()` only... Is there a reason for that? How are locales generated on initial installation?
FS#67464https://salsa.debian.org/glibc-team/glibc/-/blob/83fb5553addb34aa12820b93a5344866e6a92196/debian/rules.d/build.mk#L372
https://salsa.debian.org/glibc-team/glibc/-/blob/83fb5553addb34aa12820b93a5344866e6a92196/debian/debhelper.in/libc-bin.install#L21
For this to work, our custom locale-gen script needs to be patched to only remove /usr/lib/locale/locale-archive instead of all the contents of the /usr/lib/locale/ folder. This has been patched in Debian by
https://salsa.debian.org/glibc-team/glibc/-/commit/0c4e4734074fd8a45c5ac8a4100b083037fa449c
- After upgrading a system that did not have C.UTF-8 enabled in /etc/locale.gen to this new glibc package, the C.UTF-8 locale is available (tested with "locale -a" and "LANG=C.UTF-8 perl") without any user intervention.
- After upgrading a system that had C.UTF-8 already enabled, nothing changes, C.UTF-8 continues to work as before.
- Running locale-gen (directly or through an alpm hook) preserves /usr/lib/locale/C.UTF-8/ so that the locale continues to work, whether enabled in /etc/locale.gen or not.
sed -i '/#C\.UTF-8 /d' "$pkgdir/etc/locale.gen"
See the updated patch attached to this comment.
My only comment would be that both Debian and Fedora go out of their way to fully ensure the just-built glibc is used to do the actual work:
elf/ld.so --library-path blah localedef blah ...
Just calling the "locale/localedef" binary directly might not cut the mustard. There must be a reason why they do it. It probably matters when upgrading to a new major Glibc version. If we are bootstrapping a toolchain where we build Glibc twice then maybe it doesn't matter much. Anyway, just raising it as a potential issue.