* Re: [PR PATCH] [Updated] glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
@ 2024-03-06 15:44 ` ahesford
2024-03-06 15:45 ` ahesford
` (23 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: ahesford @ 2024-03-06 15:44 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1443 bytes --]
There is an updated pull request by ahesford against master on the void-packages repository
https://github.com/ahesford/void-packages library-policeman
https://github.com/void-linux/void-packages/pull/49146
glibc: clean up install, add C.UTF-8 by default
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.
A patch file from https://github.com/void-linux/void-packages/pull/49146.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-library-policeman-49146.patch --]
[-- Type: text/x-diff, Size: 3815 bytes --]
From f5aee5328c712e661f029d5ea6363314ecd8d160 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 6 Mar 2024 08:46:43 -0500
Subject: [PATCH 1/2] glibc: clean up install, add C.UTF-8 locale by default
---
srcpkgs/glibc/template | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index abd2ad846c9de1..1da9d03b626988 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,7 +1,7 @@
# Template file for 'glibc'
pkgname=glibc
version=2.38
-revision=5
+revision=6
bootstrap=yes
short_desc="GNU C library"
maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -123,23 +123,28 @@ do_build() {
env LDFLAGS.so="-Wl,--hash-style=both" LDFLAGS-rtld="-Wl,--hash-style=both" \
make ${makejobs}
}
+
do_install() {
vlicense LICENSES
# Create DESTDIR/etc/ld.so.conf
mkdir -p ${DESTDIR}/etc
echo "include /etc/ld.so.conf.d/*.conf" > ${DESTDIR}/etc/ld.so.conf
- cd build
- make install_root=${DESTDIR} install
+ ( cd build && make install_root=${DESTDIR} install )
+
+ # The C.UTF-8 locale should always be available
+ vmkdir usr/lib/locale
+ I18NPATH=./localedata localedef --prefix="${DESTDIR}" \
+ -i C -f UTF-8 --no-archive C.utf8
# create /etc/default/libc-locales
vinstall ${FILESDIR}/libc-locales 644 etc/default
- cp ${wrksrc}/localedata/SUPPORTED ${wrksrc}/build
- sed -i -e "s|/| |g" \
+ sed -e "s|/| |g" \
-e 's|\\| |g' \
-e "s|SUPPORTED-LOCALES=||" \
- -e "s|^|#|g" ${wrksrc}/build/SUPPORTED
- cat ${wrksrc}/build/SUPPORTED >> ${DESTDIR}/etc/default/libc-locales
+ -e "s|^|#|g" \
+ -e "/#C\.UTF-8 /d" localedata/SUPPORTED \
+ >> "${DESTDIR}/etc/default/libc-locales"
# ldd is a bash script, so make it run as such.
replace_interpreter bash ${DESTDIR}/usr/bin/ldd
@@ -162,7 +167,7 @@ do_install() {
armv?l) ln -sfr ${DESTDIR}/usr/lib/ld-linux-armhf.so.3 ${DESTDIR}/usr/lib/ld-linux.so.3;;
esac
- vinstall ${wrksrc}/posix/gai.conf 644 etc
+ vinstall posix/gai.conf 644 etc
rm -rf ${DESTDIR}/var/db
# Remove tzselect and z{dump,ic}, provided by tzutils.
rm -f ${DESTDIR}/usr/bin/tzselect
@@ -185,6 +190,7 @@ glibc-devel_package() {
fi
}
}
+
glibc-locales_package() {
conf_files="/etc/default/libc-locales"
short_desc+=" - locale data files"
@@ -194,6 +200,7 @@ glibc-locales_package() {
vmove usr/share/locale
}
}
+
nscd_package() {
conf_files="/etc/nscd.conf"
short_desc+=" - Name Service Cache Daemon"
From 1b0e9252a3aeaa74b275495d0c6b0063b5f47a6f Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 6 Mar 2024 10:05:46 -0500
Subject: [PATCH 2/2] common/hooks/pre-pkg/99-pkglint.sh: allow C.utf8 locale
in glibc package
---
common/hooks/pre-pkg/99-pkglint.sh | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/common/hooks/pre-pkg/99-pkglint.sh b/common/hooks/pre-pkg/99-pkglint.sh
index 30d97fcda40d46..90cb07da3f4aff 100644
--- a/common/hooks/pre-pkg/99-pkglint.sh
+++ b/common/hooks/pre-pkg/99-pkglint.sh
@@ -79,8 +79,22 @@ hook() {
# Check for l10n files in usr/lib/locale
if [ -d ${PKGDESTDIR}/usr/lib/locale ]; then
- msg_red "${pkgver}: /usr/lib/locale is forbidden, use /usr/share/locale!\n"
- error=1
+ local locale_allow=0 ldir
+ local lroot="${PKGDESTDIR}/usr/lib/locale"
+
+ if [ "${pkgname}" = "glibc" ]; then
+ # glibc gets an exception for its included C.utf8 locale
+ locale_allow=1
+ for ldir in "${lroot}"/*; do
+ [ "${ldir}" = "${lroot}/C.utf8" ] && continue
+ locale_allow=0
+ done
+ fi
+
+ if [ "${locale_allow}" -ne 1 ]; then
+ msg_red "${pkgver}: /usr/lib/locale is forbidden, use /usr/share/locale!\n"
+ error=1
+ fi
fi
# Check for bash completions in etc/bash_completion.d
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
2024-03-06 15:44 ` [PR PATCH] [Updated] " ahesford
@ 2024-03-06 15:45 ` ahesford
2024-03-06 16:04 ` [PR PATCH] [Updated] " ahesford
` (22 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: ahesford @ 2024-03-06 15:45 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 199 bytes --]
New comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#issuecomment-1981173594
Comment:
For bikeshedding, I added the proposed linter exception.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR PATCH] [Updated] glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
2024-03-06 15:44 ` [PR PATCH] [Updated] " ahesford
2024-03-06 15:45 ` ahesford
@ 2024-03-06 16:04 ` ahesford
2024-03-06 20:10 ` oreo639
` (21 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: ahesford @ 2024-03-06 16:04 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1443 bytes --]
There is an updated pull request by ahesford against master on the void-packages repository
https://github.com/ahesford/void-packages library-policeman
https://github.com/void-linux/void-packages/pull/49146
glibc: clean up install, add C.UTF-8 by default
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.
A patch file from https://github.com/void-linux/void-packages/pull/49146.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-library-policeman-49146.patch --]
[-- Type: text/x-diff, Size: 3843 bytes --]
From 423ee1a6b17acf615e48be00fc0d201a1ad1b621 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 6 Mar 2024 08:46:43 -0500
Subject: [PATCH 1/2] glibc: clean up install, add C.UTF-8 locale by default
---
srcpkgs/glibc/template | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index abd2ad846c9de1..11446313663752 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,7 +1,7 @@
# Template file for 'glibc'
pkgname=glibc
version=2.38
-revision=5
+revision=6
bootstrap=yes
short_desc="GNU C library"
maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -123,23 +123,28 @@ do_build() {
env LDFLAGS.so="-Wl,--hash-style=both" LDFLAGS-rtld="-Wl,--hash-style=both" \
make ${makejobs}
}
+
do_install() {
vlicense LICENSES
# Create DESTDIR/etc/ld.so.conf
mkdir -p ${DESTDIR}/etc
echo "include /etc/ld.so.conf.d/*.conf" > ${DESTDIR}/etc/ld.so.conf
- cd build
- make install_root=${DESTDIR} install
+ ( cd build && make install_root=${DESTDIR} install )
+
+ # The C.UTF-8 locale should always be available
+ vmkdir usr/lib/locale
+ I18NPATH=./localedata localedef --prefix="${DESTDIR}" \
+ -i C -f UTF-8 --no-archive "${DESTDIR}/usr/lib/locale/C.utf8"
# create /etc/default/libc-locales
vinstall ${FILESDIR}/libc-locales 644 etc/default
- cp ${wrksrc}/localedata/SUPPORTED ${wrksrc}/build
- sed -i -e "s|/| |g" \
+ sed -e "s|/| |g" \
-e 's|\\| |g' \
-e "s|SUPPORTED-LOCALES=||" \
- -e "s|^|#|g" ${wrksrc}/build/SUPPORTED
- cat ${wrksrc}/build/SUPPORTED >> ${DESTDIR}/etc/default/libc-locales
+ -e "s|^|#|g" \
+ -e "/#C\.UTF-8 /d" localedata/SUPPORTED \
+ >> "${DESTDIR}/etc/default/libc-locales"
# ldd is a bash script, so make it run as such.
replace_interpreter bash ${DESTDIR}/usr/bin/ldd
@@ -162,7 +167,7 @@ do_install() {
armv?l) ln -sfr ${DESTDIR}/usr/lib/ld-linux-armhf.so.3 ${DESTDIR}/usr/lib/ld-linux.so.3;;
esac
- vinstall ${wrksrc}/posix/gai.conf 644 etc
+ vinstall posix/gai.conf 644 etc
rm -rf ${DESTDIR}/var/db
# Remove tzselect and z{dump,ic}, provided by tzutils.
rm -f ${DESTDIR}/usr/bin/tzselect
@@ -185,6 +190,7 @@ glibc-devel_package() {
fi
}
}
+
glibc-locales_package() {
conf_files="/etc/default/libc-locales"
short_desc+=" - locale data files"
@@ -194,6 +200,7 @@ glibc-locales_package() {
vmove usr/share/locale
}
}
+
nscd_package() {
conf_files="/etc/nscd.conf"
short_desc+=" - Name Service Cache Daemon"
From f03838dc3a1b5eb03d4582bf5fe9224a504fc7dd Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 6 Mar 2024 10:05:46 -0500
Subject: [PATCH 2/2] common/hooks/pre-pkg/99-pkglint.sh: allow C.utf8 locale
in glibc package
---
common/hooks/pre-pkg/99-pkglint.sh | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/common/hooks/pre-pkg/99-pkglint.sh b/common/hooks/pre-pkg/99-pkglint.sh
index 30d97fcda40d46..90cb07da3f4aff 100644
--- a/common/hooks/pre-pkg/99-pkglint.sh
+++ b/common/hooks/pre-pkg/99-pkglint.sh
@@ -79,8 +79,22 @@ hook() {
# Check for l10n files in usr/lib/locale
if [ -d ${PKGDESTDIR}/usr/lib/locale ]; then
- msg_red "${pkgver}: /usr/lib/locale is forbidden, use /usr/share/locale!\n"
- error=1
+ local locale_allow=0 ldir
+ local lroot="${PKGDESTDIR}/usr/lib/locale"
+
+ if [ "${pkgname}" = "glibc" ]; then
+ # glibc gets an exception for its included C.utf8 locale
+ locale_allow=1
+ for ldir in "${lroot}"/*; do
+ [ "${ldir}" = "${lroot}/C.utf8" ] && continue
+ locale_allow=0
+ done
+ fi
+
+ if [ "${locale_allow}" -ne 1 ]; then
+ msg_red "${pkgver}: /usr/lib/locale is forbidden, use /usr/share/locale!\n"
+ error=1
+ fi
fi
# Check for bash completions in etc/bash_completion.d
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (2 preceding siblings ...)
2024-03-06 16:04 ` [PR PATCH] [Updated] " ahesford
@ 2024-03-06 20:10 ` oreo639
2024-03-06 20:10 ` oreo639
` (20 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-06 20:10 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 488 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#issuecomment-1981699240
Comment:
> we can add an `INSTALL` script
There already is one for generating `locale-archive`. You can add `localedef --prefix=. -i C -f UTF-8 --no-archive C.utf8` to the install script.
For generating them during build, afaict, the outputs generated by this command are endian-specific although you can specify `--big-endian` or `--little-endian`.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (3 preceding siblings ...)
2024-03-06 20:10 ` oreo639
@ 2024-03-06 20:10 ` oreo639
2024-03-06 20:11 ` oreo639
` (19 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-06 20:10 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 505 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#issuecomment-1981699240
Comment:
> we can add an `INSTALL` script
There already is one for generating `locale-archive`. You can add `localedef --prefix=. -i C -f UTF-8 --no-archive C.utf8` unconditionally to the install script.
For generating them during build, afaict, the outputs generated by this command are endian-specific although you can specify `--big-endian` or `--little-endian`.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (4 preceding siblings ...)
2024-03-06 20:10 ` oreo639
@ 2024-03-06 20:11 ` oreo639
2024-03-06 20:20 ` oreo639
` (18 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-06 20:11 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 504 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#issuecomment-1981699240
Comment:
> we can add an `INSTALL` script
There already is one for generating `locale-archive`. You can add `localedef --prefix=. -i C -f UTF-8 --no-archive C.utf8` unconditionally to the install script.
For generating them during build, afaict, the outputs generated by this command are endian-specific although you can specify `--big-endian` or `--little-endian`.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (5 preceding siblings ...)
2024-03-06 20:11 ` oreo639
@ 2024-03-06 20:20 ` oreo639
2024-03-06 20:45 ` oreo639
` (17 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-06 20:20 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 521 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#issuecomment-1981699240
Comment:
> we can add an `INSTALL` script
There already is one for generating `locale-archive`. It should be possible to add `localedef --prefix=. -i C -f UTF-8 --no-archive C.utf8` unconditionally to the install script.
For generating them during build, afaict, the outputs generated by this command are endian-specific although you can specify `--big-endian` or `--little-endian`.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (6 preceding siblings ...)
2024-03-06 20:20 ` oreo639
@ 2024-03-06 20:45 ` oreo639
2024-03-06 20:46 ` oreo639
` (16 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-06 20:45 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 307 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#issuecomment-1981699240
Comment:
For generating them during build, afaict, the outputs generated by this command are endian-specific although you can specify `--big-endian` or `--little-endian`.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (7 preceding siblings ...)
2024-03-06 20:45 ` oreo639
@ 2024-03-06 20:46 ` oreo639
2024-03-06 20:46 ` oreo639
` (15 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-06 20:46 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 269 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#issuecomment-1981699240
Comment:
Afaict, the outputs generated by this command are endian-specific although you can specify `--big-endian` or `--little-endian`.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (8 preceding siblings ...)
2024-03-06 20:46 ` oreo639
@ 2024-03-06 20:46 ` oreo639
2024-03-06 23:24 ` oreo639
` (14 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-06 20:46 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 268 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#issuecomment-1981699240
Comment:
Afaict, the outputs generated by `localedef` are endian-specific although you can specify `--big-endian` or `--little-endian`.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (9 preceding siblings ...)
2024-03-06 20:46 ` oreo639
@ 2024-03-06 23:24 ` oreo639
2024-03-06 23:27 ` [PR REVIEW] " oreo639
` (13 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-06 23:24 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 435 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#issuecomment-1981699240
Comment:
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
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR REVIEW] glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (10 preceding siblings ...)
2024-03-06 23:24 ` oreo639
@ 2024-03-06 23:27 ` oreo639
2024-03-06 23:37 ` oreo639
` (12 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-06 23:27 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 463 bytes --]
New review comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#discussion_r1515282714
Comment:
Use the system localedef when cross compiling and the recently built localedef when native compiling.
Also, make sure to pass `--big-endian` or `--little-endian` when cross compiling.
See: https://salsa.debian.org/glibc-team/glibc/-/blob/6c8b05d8a7138593c80908d5fe5b928d2ac038d6/debian/rules.d/build.mk#L340-358
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR REVIEW] glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (11 preceding siblings ...)
2024-03-06 23:27 ` [PR REVIEW] " oreo639
@ 2024-03-06 23:37 ` oreo639
2024-03-06 23:37 ` oreo639
` (11 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-06 23:37 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 179 bytes --]
New review comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#discussion_r1515288683
Comment:
imo, probably fine to leave it?
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR REVIEW] glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (12 preceding siblings ...)
2024-03-06 23:37 ` oreo639
@ 2024-03-06 23:37 ` oreo639
2024-03-06 23:37 ` oreo639
` (10 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-06 23:37 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 179 bytes --]
New review comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#discussion_r1515288683
Comment:
imo, probably fine to leave it.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR REVIEW] glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (13 preceding siblings ...)
2024-03-06 23:37 ` oreo639
@ 2024-03-06 23:37 ` oreo639
2024-03-06 23:37 ` oreo639
` (9 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-06 23:37 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 184 bytes --]
New review comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#discussion_r1515288683
Comment:
imo, probably fine to just leave it.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR REVIEW] glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (14 preceding siblings ...)
2024-03-06 23:37 ` oreo639
@ 2024-03-06 23:37 ` oreo639
2024-03-06 23:38 ` oreo639
` (8 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-06 23:37 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 190 bytes --]
New review comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#discussion_r1515288683
Comment:
imo, probably fine to just leave it there.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR REVIEW] glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (15 preceding siblings ...)
2024-03-06 23:37 ` oreo639
@ 2024-03-06 23:38 ` oreo639
2024-03-07 0:49 ` [PR PATCH] [Updated] " ahesford
` (7 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-06 23:38 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 173 bytes --]
New review comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#discussion_r1515288683
Comment:
imo, just leave it there.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR PATCH] [Updated] glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (16 preceding siblings ...)
2024-03-06 23:38 ` oreo639
@ 2024-03-07 0:49 ` ahesford
2024-03-07 0:50 ` ahesford
` (6 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: ahesford @ 2024-03-07 0:49 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1443 bytes --]
There is an updated pull request by ahesford against master on the void-packages repository
https://github.com/ahesford/void-packages library-policeman
https://github.com/void-linux/void-packages/pull/49146
glibc: clean up install, add C.UTF-8 by default
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.
A patch file from https://github.com/void-linux/void-packages/pull/49146.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-library-policeman-49146.patch --]
[-- Type: text/x-diff, Size: 4113 bytes --]
From 5b1976b6792005d43a020d9d02fa93c94dbfe2c4 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 6 Mar 2024 08:46:43 -0500
Subject: [PATCH 1/2] glibc: clean up install, add C.UTF-8 locale by default
---
srcpkgs/glibc/template | 33 +++++++++++++++++++++++++--------
1 file changed, 25 insertions(+), 8 deletions(-)
diff --git a/srcpkgs/glibc/template b/srcpkgs/glibc/template
index abd2ad846c9de1..6faee3db8133ff 100644
--- a/srcpkgs/glibc/template
+++ b/srcpkgs/glibc/template
@@ -1,7 +1,7 @@
# Template file for 'glibc'
pkgname=glibc
version=2.38
-revision=5
+revision=6
bootstrap=yes
short_desc="GNU C library"
maintainer="Enno Boland <gottox@voidlinux.org>"
@@ -123,23 +123,38 @@ do_build() {
env LDFLAGS.so="-Wl,--hash-style=both" LDFLAGS-rtld="-Wl,--hash-style=both" \
make ${makejobs}
}
+
do_install() {
vlicense LICENSES
# Create DESTDIR/etc/ld.so.conf
mkdir -p ${DESTDIR}/etc
echo "include /etc/ld.so.conf.d/*.conf" > ${DESTDIR}/etc/ld.so.conf
- cd build
- make install_root=${DESTDIR} install
+ ( cd build && make install_root=${DESTDIR} install )
+
+ # The C.UTF-8 locale should always be available
+ if [ -z "${CROSS_BUILD}" ]; then
+ make -C localedata DESTDIR="${DESTDIR}" \
+ objdir="../build" install-files-C.UTF-8/UTF-8
+ else
+ local endian=
+ case "$XBPS_TARGET_ENDIAN" in
+ be) endian="--big-endian" ;;
+ le) endian="--little-endian" ;;
+ esac
+
+ vmkdir usr/lib/locale
+ I18NPATH=./localedata localedef --prefix="${DESTDIR}" ${endian} \
+ -i C -f UTF-8 --no-archive "${DESTDIR}/usr/lib/locale/C.utf8"
+ fi
# create /etc/default/libc-locales
vinstall ${FILESDIR}/libc-locales 644 etc/default
- cp ${wrksrc}/localedata/SUPPORTED ${wrksrc}/build
- sed -i -e "s|/| |g" \
+ sed -e "s|/| |g" \
-e 's|\\| |g' \
-e "s|SUPPORTED-LOCALES=||" \
- -e "s|^|#|g" ${wrksrc}/build/SUPPORTED
- cat ${wrksrc}/build/SUPPORTED >> ${DESTDIR}/etc/default/libc-locales
+ -e "s|^|#|g" localedata/SUPPORTED \
+ >> "${DESTDIR}/etc/default/libc-locales"
# ldd is a bash script, so make it run as such.
replace_interpreter bash ${DESTDIR}/usr/bin/ldd
@@ -162,7 +177,7 @@ do_install() {
armv?l) ln -sfr ${DESTDIR}/usr/lib/ld-linux-armhf.so.3 ${DESTDIR}/usr/lib/ld-linux.so.3;;
esac
- vinstall ${wrksrc}/posix/gai.conf 644 etc
+ vinstall posix/gai.conf 644 etc
rm -rf ${DESTDIR}/var/db
# Remove tzselect and z{dump,ic}, provided by tzutils.
rm -f ${DESTDIR}/usr/bin/tzselect
@@ -185,6 +200,7 @@ glibc-devel_package() {
fi
}
}
+
glibc-locales_package() {
conf_files="/etc/default/libc-locales"
short_desc+=" - locale data files"
@@ -194,6 +210,7 @@ glibc-locales_package() {
vmove usr/share/locale
}
}
+
nscd_package() {
conf_files="/etc/nscd.conf"
short_desc+=" - Name Service Cache Daemon"
From 508f007e9464456a1bd7ec9716572330f645b230 Mon Sep 17 00:00:00 2001
From: "Andrew J. Hesford" <ajh@sideband.org>
Date: Wed, 6 Mar 2024 10:05:46 -0500
Subject: [PATCH 2/2] common/hooks/pre-pkg/99-pkglint.sh: allow C.utf8 locale
in glibc package
---
common/hooks/pre-pkg/99-pkglint.sh | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/common/hooks/pre-pkg/99-pkglint.sh b/common/hooks/pre-pkg/99-pkglint.sh
index 30d97fcda40d46..90cb07da3f4aff 100644
--- a/common/hooks/pre-pkg/99-pkglint.sh
+++ b/common/hooks/pre-pkg/99-pkglint.sh
@@ -79,8 +79,22 @@ hook() {
# Check for l10n files in usr/lib/locale
if [ -d ${PKGDESTDIR}/usr/lib/locale ]; then
- msg_red "${pkgver}: /usr/lib/locale is forbidden, use /usr/share/locale!\n"
- error=1
+ local locale_allow=0 ldir
+ local lroot="${PKGDESTDIR}/usr/lib/locale"
+
+ if [ "${pkgname}" = "glibc" ]; then
+ # glibc gets an exception for its included C.utf8 locale
+ locale_allow=1
+ for ldir in "${lroot}"/*; do
+ [ "${ldir}" = "${lroot}/C.utf8" ] && continue
+ locale_allow=0
+ done
+ fi
+
+ if [ "${locale_allow}" -ne 1 ]; then
+ msg_red "${pkgver}: /usr/lib/locale is forbidden, use /usr/share/locale!\n"
+ error=1
+ fi
fi
# Check for bash completions in etc/bash_completion.d
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (17 preceding siblings ...)
2024-03-07 0:49 ` [PR PATCH] [Updated] " ahesford
@ 2024-03-07 0:50 ` ahesford
2024-03-07 21:56 ` oreo639
` (5 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: ahesford @ 2024-03-07 0:50 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 291 bytes --]
New comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#issuecomment-1982138642
Comment:
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.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (18 preceding siblings ...)
2024-03-07 0:50 ` ahesford
@ 2024-03-07 21:56 ` oreo639
2024-03-07 21:57 ` oreo639
` (4 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-07 21:56 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 525 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#issuecomment-1984570542
Comment:
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, just call localedef manually with `vtargetrun`, or use `vsed -i localedata/Makefile -e "s|\$(rtld-prefix)|qemu-${XBPS_TARGET_QEMU_MACHINE}-static \$(rtld-prefix)|"`)
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (19 preceding siblings ...)
2024-03-07 21:56 ` oreo639
@ 2024-03-07 21:57 ` oreo639
2024-03-07 21:58 ` oreo639
` (3 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-07 21:57 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 549 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#issuecomment-1984570542
Comment:
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, just call localedef manually with `vtargetrun`, or use `vsed -i localedata/Makefile -e "s|\$(rtld-prefix)|qemu-${XBPS_TARGET_QEMU_MACHINE}-static \$(rtld-prefix)|"`)
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (20 preceding siblings ...)
2024-03-07 21:57 ` oreo639
@ 2024-03-07 21:58 ` oreo639
2024-03-07 21:59 ` ahesford
` (2 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-07 21:58 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 594 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#issuecomment-1984570542
Comment:
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)|"`)
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (21 preceding siblings ...)
2024-03-07 21:58 ` oreo639
@ 2024-03-07 21:59 ` ahesford
2024-03-07 21:59 ` oreo639
2024-03-13 10:46 ` [PR PATCH] [Merged]: " ahesford
24 siblings, 0 replies; 26+ messages in thread
From: ahesford @ 2024-03-07 21:59 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 306 bytes --]
New comment by ahesford on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#issuecomment-1984573468
Comment:
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.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (22 preceding siblings ...)
2024-03-07 21:59 ` ahesford
@ 2024-03-07 21:59 ` oreo639
2024-03-13 10:46 ` [PR PATCH] [Merged]: " ahesford
24 siblings, 0 replies; 26+ messages in thread
From: oreo639 @ 2024-03-07 21:59 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 147 bytes --]
New comment by oreo639 on void-packages repository
https://github.com/void-linux/void-packages/pull/49146#issuecomment-1984574171
Comment:
Yeah.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PR PATCH] [Merged]: glibc: clean up install, add C.UTF-8 by default
2024-03-06 13:55 [PR PATCH] glibc: clean up install, add C.UTF-8 by default ahesford
` (23 preceding siblings ...)
2024-03-07 21:59 ` oreo639
@ 2024-03-13 10:46 ` ahesford
24 siblings, 0 replies; 26+ messages in thread
From: ahesford @ 2024-03-13 10:46 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1275 bytes --]
There's a merged pull request on the void-packages repository
glibc: clean up install, add C.UTF-8 by default
https://github.com/void-linux/void-packages/pull/49146
Description:
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.
^ permalink raw reply [flat|nested] 26+ messages in thread