Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#67464 - [glibc] generate locales also on install

Attached to Project: Arch Linux
Opened by nl6720 (nl6720) - Sunday, 02 August 2020, 11:34 GMT
Last edited by Eli Schwartz (eschwartz) - Thursday, 03 September 2020, 15:27 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To Bartłomiej Piotrowski (Barthalion)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:
glibc.install runs locale-gen on update, but not on install. This complicates installations with a pre-deployed /etc/locale.gen file, since they must now manually run locale-gen in a chroot.
Please add locale-gen to post_install too.

Additional info:
* package version(s)
* config and/or log files etc.
* link to upstream bug report, if any
glibc 2.31-5
https://gitlab.archlinux.org/archlinux/archiso/-/merge_requests/52

Steps to reproduce:
# mkdir -p testdir/etc
# echo 'en_US.UTF-8 UTF-8' > testdir/etc/locale.gen
# pacstrap testdir base
This task depends upon

Closed by  Eli Schwartz (eschwartz)
Thursday, 03 September 2020, 15:27 GMT
Reason for closing:  No response
Comment by Allan McRae (Allan) - Sunday, 02 August 2020, 11:59 GMT
There are dependency issues in doing that. The locale-gen script requires utilities that depend on glibc.
Comment by nl6720 (nl6720) - Sunday, 02 August 2020, 12:11 GMT
That's unfortunate. Would a pacman hook work?
I guessing there's also some reason why the glibc package still uses an install script.
Comment by Eli Schwartz (eschwartz) - Sunday, 02 August 2020, 14:28 GMT
It's pretty useless since it will only ever be used exactly once, then parsed and ignored forever.

It's also pretty useless if it does nothing, because the default file is completely commented out. If it's *only* useful for archiso and other projects explicitly placing a custom locale.gen file, I don't really see the problem with copying over the file and running /usr/bin/locale-gen manually *as is already being done*.
Comment by David Runge (dvzrv) - Sunday, 02 August 2020, 16:27 GMT
Running locale-gen requires running a command in the created chroot. We want to minimize that as much as possible in archiso because arch-chroot in a container has implications and from a software design point-of-view it prevents us from doing cleanup in a "nice way".
We are currently transitioning towards a configuration overlay [1] which would greatly benefit from what @nl6720 is proposing in this ticket.

What could be alternatives? Generating all locales and providing them as package (e.g. as done with Ubuntu's language-pack-* packages or Fedora's langpacks package)?

[1] https://gitlab.archlinux.org/archlinux/archiso/-/issues/21
Comment by Eli Schwartz (eschwartz) - Sunday, 02 August 2020, 16:36 GMT
Can you first provide a convincing rationale for why the chroot(2) syscall has "implications", and why it's better for pacman to do this than for the arch-chroot script to do this?

As for generating all locales as packages, you yourself explained why this is bad in the archiso MR.

Loading...