Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glibc: clean up install, add C.UTF-8 by default #49146

Merged
merged 2 commits into from
Mar 13, 2024

Conversation

ahesford
Copy link
Member

@ahesford ahesford commented Mar 6, 2024

We should really provide the C.UTF-8 locale by default. I believe that the best way to do so is by removing it entirely from /etc/default/libc-locales processing and install it, as part of the main glibc package, in /usr/lib/locales like Arch does.

This currently trips the package linter, so either

  • We can make an exception for glibc in the linter, or
  • Rather than include the locale files in the package, we can add an INSTALL script to the base package to write the C.utf-8 locale outside of an archive, where it will always be reachable.

I favor the first because it is less wasteful; why should everybody have to generate a locale that we expect everybody to have available by default?

A third option is to modify the glibc-locales INSTALL script to either add a separate, non-archived C.utf-8 locale directory, or just ensure that C.UTF-8 is always included in the locale processing. Both seem even more kludgey than doing the right thing by default.

Thoughts? @void-linux/pkg-committers

While I was at it, I cleaned up the install function a bit.

@ahesford
Copy link
Member Author

ahesford commented Mar 6, 2024

For bikeshedding, I added the proposed linter exception.

@oreo639
Copy link
Member

oreo639 commented Mar 6, 2024

Afaict, the outputs generated by localedef are endian-specific although you can specify --big-endian or --little-endian.

You can see how Debian handles it here:
https://salsa.debian.org/glibc-team/glibc/-/blob/6c8b05d8a7138593c80908d5fe5b928d2ac038d6/debian/rules.d/build.mk#L340-358

srcpkgs/glibc/template Outdated Show resolved Hide resolved
srcpkgs/glibc/template Outdated Show resolved Hide resolved
@ahesford
Copy link
Member Author

ahesford commented Mar 7, 2024

Changes adopted. For native builds, we can just use the make target; for cross builds, we will fall back to the host utility with proper endianness.

@oreo639
Copy link
Member

oreo639 commented Mar 7, 2024

Thinking about it more, using the system localedef command is a bit problematic when cross-compiling from musl.
Maybe it would be good to use the qemu build helper instead?
(for that either we can define LOCALEDEF manually like Debian (where qemu gets added when cross compiling), just call localedef manually with vtargetrun, or use vsed -i localedata/Makefile -e "s|\$(rtld-prefix)|qemu-${XBPS_TARGET_QEMU_MACHINE}-static \$(rtld-prefix)|")

@ahesford
Copy link
Member Author

ahesford commented Mar 7, 2024

We don't generally support cross-compiling across C libraries, and I'm not sure about the wisdom of requiring qemu-user-static in a bootstrap package like glibc.

@oreo639
Copy link
Member

oreo639 commented Mar 7, 2024

Yeah.

@ahesford ahesford merged commit de0e1f9 into void-linux:master Mar 13, 2024
6 of 8 checks passed
@ahesford ahesford deleted the library-policeman branch March 13, 2024 10:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants