unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Yet another locale question on a foreign distro
@ 2021-01-31  6:06 Fredrik Salomonsson
  2021-01-31 12:16 ` Julien Lepiller
  0 siblings, 1 reply; 3+ messages in thread
From: Fredrik Salomonsson @ 2021-01-31  6:06 UTC (permalink / raw)
  To: help-guix


Hi guix,

I've developed a little tool to use rofi as a pinentry for gpg-agent
called pinentry-rofi. It recently landed in guix, note that version
2.0.2 that is the latest in guix only works if you don't have guile in
the same profile.

My current setup is guix running on a foreign distro (Arch Linux). And
I'm currently running pinentry-rofi installed by its package manager and
it works fine. When I submitted the patch to guix, I only ran the tests
and launched the tool from the commandline to make sure it was working.
I never did test it with gpg-agent. Which was a mistake on my part, as
it seems it does not work with gpg-agent when it's installed via guix.

I tracked down the root of the problem to rofi not being able to set the
locale. The error it return is

Rofi-WARNING **: 21:16:03.115: Failed to set locale

As far as I can tell my locale is setup properly. GUIX_LOCPATH is set to
the profile I have `glibc-locales` installed to. And rofi has no issue
setting the locale when I launch pinentry-rofi from the commandline.
It's only when gpg-agent launches it.

I've tried to use both the native gpg package on the foreign distro as
well as the gnupg package on guix (installed to the same profile as
pinentry-rofi). Same issue on both.

If I hardcode LC_ALL=C, when pinentry-rofi launches rofi, it works with
gpg-agent. But that does not seem like a great solution.

Do anyone have any idea what could be the issue?

Thanks

-- 
s/Fred[re]+i[ck]+/Fredrik/g


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Yet another locale question on a foreign distro
  2021-01-31  6:06 Yet another locale question on a foreign distro Fredrik Salomonsson
@ 2021-01-31 12:16 ` Julien Lepiller
  2021-01-31 23:27   ` Fredrik Salomonsson
  0 siblings, 1 reply; 3+ messages in thread
From: Julien Lepiller @ 2021-01-31 12:16 UTC (permalink / raw)
  To: help-guix, Fredrik Salomonsson, help-guix

Does gpg-agent change the locale of the system somehow? What's the locale it launches the pinentry with? Does it exist in $GUIX_LOCPATH?

Le 31 janvier 2021 01:06:38 GMT-05:00, Fredrik Salomonsson <plattfot@posteo.net> a écrit :
>
>Hi guix,
>
>I've developed a little tool to use rofi as a pinentry for gpg-agent
>called pinentry-rofi. It recently landed in guix, note that version
>2.0.2 that is the latest in guix only works if you don't have guile in
>the same profile.
>
>My current setup is guix running on a foreign distro (Arch Linux). And
>I'm currently running pinentry-rofi installed by its package manager
>and
>it works fine. When I submitted the patch to guix, I only ran the tests
>and launched the tool from the commandline to make sure it was working.
>I never did test it with gpg-agent. Which was a mistake on my part, as
>it seems it does not work with gpg-agent when it's installed via guix.
>
>I tracked down the root of the problem to rofi not being able to set
>the
>locale. The error it return is
>
>Rofi-WARNING **: 21:16:03.115: Failed to set locale
>
>As far as I can tell my locale is setup properly. GUIX_LOCPATH is set
>to
>the profile I have `glibc-locales` installed to. And rofi has no issue
>setting the locale when I launch pinentry-rofi from the commandline.
>It's only when gpg-agent launches it.
>
>I've tried to use both the native gpg package on the foreign distro as
>well as the gnupg package on guix (installed to the same profile as
>pinentry-rofi). Same issue on both.
>
>If I hardcode LC_ALL=C, when pinentry-rofi launches rofi, it works with
>gpg-agent. But that does not seem like a great solution.
>
>Do anyone have any idea what could be the issue?
>
>Thanks
>
>-- 
>s/Fred[re]+i[ck]+/Fredrik/g

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Yet another locale question on a foreign distro
  2021-01-31 12:16 ` Julien Lepiller
@ 2021-01-31 23:27   ` Fredrik Salomonsson
  0 siblings, 0 replies; 3+ messages in thread
From: Fredrik Salomonsson @ 2021-01-31 23:27 UTC (permalink / raw)
  To: Julien Lepiller, help-guix, help-guix

Hi Julien,

Julien Lepiller <julien@lepiller.eu> writes:

> Does gpg-agent change the locale of the system somehow? What's the locale it launches the pinentry with?

Kind of, it request the pinentry program to at least set LC_CTYPE and
LC_MESSAGES to the requested locale. Currently my pinentry-rofi ignore
these requests. I implemented them in case that was the issue, but still
the same issue. It was requesting to set en_US.UTF-8, e.g. my default
locale.

> Does it exist in $GUIX_LOCPATH?

It does, however you gave me a point in the right direction. The issue
was that the systemd gpg-agent.service unit that launches gpg-agent,
does not set $GUIX_LOCPATH. Which was why rofi failed to set the locale.

To fix it all I needed to do was to append that to the service file.

I.e run.
  systemctl --user edit gpg-agent.service

and add:
  [Service]
  Environment=GUIX_LOCPATH=%h/.guix-profile/lib/locale

Thanks for the help!

-- 
s/Fred[re]+i[ck]+/Fredrik/g


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-01-31 23:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-31  6:06 Yet another locale question on a foreign distro Fredrik Salomonsson
2021-01-31 12:16 ` Julien Lepiller
2021-01-31 23:27   ` Fredrik Salomonsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).