Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1012536: guix: Debian's guix tries using Guix' glibc locales installed in /var/guix/profiles/... instead of Debian's glibc locales

68 views
Skip to first unread message

Maxime Devos

unread,
Jun 8, 2022, 4:30:03 PM6/8/22
to
Package: guix
Version: 1.2.0-4
Severity: normal

Dear Maintainer,

* What led up to the situation?

Previously, I used a Guix compiled by Guix as the guix daemon.
I would like to switch back to Debian's guix and remove the root
user's Guix profile (because I didn't use it for anything except
for updating the Guix daemon), but I encountered some trouble:

In /etc/systemd/system/guix-daemon.service, there's the line:

Environment='GUIX_LOCPATH=/var/guix/profiles/per-user/root/guix-profile/lib/locale' LC_ALL=en_US.utf8

However, I'm using Debian's guix so shouldn't it look for glibc's
locales instead? (Also, I'm not installing anything as root, so I'd
like to remove /var/guix/profiles/per-user/root.)

* What exactly did you do (or not do) that was effective (or
ineffective)?

I reverted the ExecStart=... line to ExecStart=/usr/bin/guix-daemon.
I removed the GUIX_LOCPATH=... assignment. However, that resulted
in 'guix substitute' not finding the locale:

$ guix build --source snap
substitute: hint: Consider installing the `glibc-utf8-locales' or `glibc-locales' package and
substitute: defining `GUIX_LOCPATH', along these lines:
substitute:
substitute: guix install glibc-utf8-locales
substitute: export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
substitute:
substitute: See the "Application Setup" section in the manual, for more info.
substitute:
substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
113,0 MB will be downloaded: [etc etc].

To resolve the issue, I replaced LC_ALL=en_US.utf8 by LC_ALL=C.UTF-8
(LC_ALL=C.utf8 doesn't work for whatever reason) and did a
"systemctl daemon-reload" + "systemctl restart guix-daemon", after which
the locale warnings didn't appear again.

-- System Information:
Debian Release: 11.3
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.10.0-13-amd64 (SMP w/8 CPU threads)
Locale: LANG=nl_BE.UTF-8, LC_CTYPE=nl_BE.UTF-8 (charmap=UTF-8), LANGUAGE=nl_BE:nl
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages guix depends on:
ii guile-2.2 2.2.7+1-6
ii guile-2.2-libs 2.2.7+1-6
ii guile-gcrypt 0.3.0-3
ii guile-git 0.4.0-3
ii guile-gnutls 3.7.1-5
ii guile-json 4.3.2-2
ii guile-lzlib 0.0.2-2
ii guile-sqlite3 0.1.3-2
ii guile-ssh 0.13.1-4
ii guile-zlib 0.0.1-3
ii libbz2-1.0 1.0.8-4
ii libc6 2.31-13+deb11u3
ii libgcc-s1 10.2.1-6
ii libgcrypt20 1.8.7-6
ii libsqlite3-0 3.34.1-3
ii libssh-dev 0.9.5-1+deb11u1
ii libstdc++6 10.2.1-6
ii zlib1g 1:1.2.11.dfsg-2+deb11u1

Versions of packages guix recommends:
ii nscd 2.31-13+deb11u3
ii systemd 247.3-7

guix suggests no packages.

-- Configuration Files:
/etc/guix/acl [Errno 13] Toegang geweigerd: '/etc/guix/acl'

-- no debconf information

Vagrant Cascadian

unread,
Jun 8, 2022, 5:50:03 PM6/8/22
to
On 2022-06-08, Maxime Devos wrote:
> In /etc/systemd/system/guix-daemon.service, there's the line:
>
> Environment='GUIX_LOCPATH=/var/guix/profiles/per-user/root/guix-profile/lib/locale' LC_ALL=en_US.utf8
>
> However, I'm using Debian's guix so shouldn't it look for glibc's
> locales instead? (Also, I'm not installing anything as root, so I'd
> like to remove /var/guix/profiles/per-user/root.)

Thanks for the report! These are good questions...


> I reverted the ExecStart=... line to ExecStart=/usr/bin/guix-daemon.
> I removed the GUIX_LOCPATH=... assignment. However, that resulted
> in 'guix substitute' not finding the locale:
>
> $ guix build --source snap
> substitute: hint: Consider installing the `glibc-utf8-locales' or `glibc-locales' package and
> substitute: defining `GUIX_LOCPATH', along these lines:
> substitute:
> substitute: guix install glibc-utf8-locales
> substitute: export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"
> substitute:
> substitute: See the "Application Setup" section in the manual, for more info.
> substitute:
> substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
> 113,0 MB will be downloaded: [etc etc].
>
> To resolve the issue, I replaced LC_ALL=en_US.utf8 by LC_ALL=C.UTF-8
> (LC_ALL=C.utf8 doesn't work for whatever reason) and did a
> "systemctl daemon-reload" + "systemctl restart guix-daemon", after which
> the locale warnings didn't appear again.

So do you now have...

ExecStart=/usr/bin/guix-daemon --build-users-group=_guixbuild
Environment=LC_ALL=C.UTF-8


Does this mean the build environment that guix-daemon creates are
running in the C.UTF-8 locale, or does guix-daemon normalize the locale
that builds are performed in to use a "default" locale from guix;
C.UTF-8 isn't yet present in guix's glibc, could this cause issues?

I'll admit I'm a little confused at the multiplicity of potentially
relevent locales; in which environments are which locales
used... etc. :)


live well,
vagrant
signature.asc

Maxime Devos

unread,
Jun 8, 2022, 6:20:03 PM6/8/22
to
Vagrant Cascadian schreef op wo 08-06-2022 om 14:43 [-0700]:
> So do you now have...
>
>   ExecStart=/usr/bin/guix-daemon --build-users-group=_guixbuild
>   Environment=LC_ALL=C.UTF-8
>
>
> Does this mean the build environment that guix-daemon creates are
> running in the C.UTF-8 locale,

Unless there's a hole in the build containeer, the builds (unless you
count "guix perform-download" and "guix substitute" as builds) do not
have access to Debian's /usr/etcetera and likewise they don't have
access to guix-daemon's environment variables (*). So the builds use
guix' locale data or no locales at all, and they don't use the C.UTF-8
locale.

> or does guix-daemon normalize the locale that builds are performed in
> to use a "default" locale from guix;

AFAICT only "guix-daemon", "guix perform-download", "guix substitute"
and maybe "guix offload" will see the LC_ALL=C.UTF-8.

As written previously, the builds themselves do not have access to the
LC_ALL(*) of the build daemon. However, the guix daemon does not
perform any normalisation (except for removing all environment
variables, including LC_ALL, starting a build) -- the locale will be
set by the _builder_, in 'install-locale' in (guix build gnu-build-
system), and the builder will only have access to Guix locales (and
only if the package is built with a glibc-locales package in its
(native-)inputs) because of the build sandbox.

(*) with some exceptions: the fixed-output derivations for downloading
git repositories have access to the http_proxy and LC_ALL of the _user_
that is running "guix build" or the like. However, ‘regular’ builds
like "guix build hello" do not have access to any leaked environment
varibables.

> C.UTF-8 isn't yet present in guix's glibc, could this cause issues?

No, because guix's glibc is not involved here (sandboxing).

(Usual caveats apply, if my understanding of Guix is incorrect then my
answer might be incorrect, etc., my proposed change hasn't seen much
practical testing ...)

Greetings,
Maxime.
signature.asc

Maxime Devos

unread,
Jun 11, 2022, 5:10:04 AM6/11/22
to
signature.asc
0 new messages