all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* locale warning and postgresql
@ 2016-11-28 14:02 Myles English
  2016-11-28 20:48 ` Ludovic Courtès
  0 siblings, 1 reply; 8+ messages in thread
From: Myles English @ 2016-11-28 14:02 UTC (permalink / raw)
  To: help-guix


Hello,

I have always had trouble with my locale after installing guix on Arch
Linux (with zsh and a basic window manager, bspwm).  I have set
GUIX_LOCPATH in ~/.zshenv and it appears correct in my shell.  The
system-wide locale looks right.  When I install postgresql it gives the
usual "warning: failed to install locale: Invalid argument".  When I try
to initialise a database cluster, passing the locale doesn't work.

Does anyone using Arch Linux and a basic WM know which file to put
GUIX_LOCPATH in so that the warning goes away?

How can I find out what guix thinks its locale is or what are available?

Is there a way to use initdb even though there is a locale warning?

Shell experiments:

$ locale
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

$ echo $GUIX_LOCPATH
/home/myles/.guix-profile/lib/locale

$ guix package -i postgresql
warning: failed to install locale: Invalid argument
The following package will be upgraded:
   postgresql	9.5.3 -> 9.5.3	/gnu/store/sfgg20a7jnwfisajsvqdijjm2zj905az-postgresql-9.5.3

nothing to be done
guix package -i postgresql  7.56s user 0.22s system 107% cpu 7.213 total

$ which initdb
/home/myles/.guix-profile/bin/initdb

$ initdb --locale en_GB.UTF-8 -E UTF8 -D '/home/myles/pgdata-guix'
The files belonging to this database system will be owned by user "myles".
This user must also own the server process.

initdb: invalid locale name "en_GB.UTF-8"


$ initdb --locale en_GB -E UTF8 -D '/home/myles/pgdata-guix'
The files belonging to this database system will be owned by user "myles".
This user must also own the server process.

initdb: invalid locale name "en_GB"


$ initdb -E UTF8 -D '/home/myles/pgdata-guix'
The files belonging to this database system will be owned by user "myles".
This user must also own the server process.

initdb: invalid locale settings; check LANG and LC_* environment variables


Thanks,

Myles

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

* Re: locale warning and postgresql
  2016-11-28 14:02 locale warning and postgresql Myles English
@ 2016-11-28 20:48 ` Ludovic Courtès
  2016-11-28 21:47   ` Alex Kost
  2016-11-28 22:25   ` Myles English
  0 siblings, 2 replies; 8+ messages in thread
From: Ludovic Courtès @ 2016-11-28 20:48 UTC (permalink / raw)
  To: Myles English; +Cc: help-guix

Hi Myles,

Myles English <mylesenglish@gmail.com> skribis:

> I have always had trouble with my locale after installing guix on Arch
> Linux (with zsh and a basic window manager, bspwm).  I have set
> GUIX_LOCPATH in ~/.zshenv and it appears correct in my shell.  The
> system-wide locale looks right.  When I install postgresql it gives the
> usual "warning: failed to install locale: Invalid argument".  When I try
> to initialise a database cluster, passing the locale doesn't work.
>
> Does anyone using Arch Linux and a basic WM know which file to put
> GUIX_LOCPATH in so that the warning goes away?
>
> How can I find out what guix thinks its locale is or what are available?
>
> Is there a way to use initdb even though there is a locale warning?
>
> Shell experiments:
>
> $ locale
> LANG=en_GB.UTF-8
> LC_CTYPE="en_GB.UTF-8"
> LC_NUMERIC="en_GB.UTF-8"
> LC_TIME="en_GB.UTF-8"
> LC_COLLATE="en_GB.UTF-8"
> LC_MONETARY="en_GB.UTF-8"
> LC_MESSAGES="en_GB.UTF-8"
> LC_PAPER="en_GB.UTF-8"
> LC_NAME="en_GB.UTF-8"
> LC_ADDRESS="en_GB.UTF-8"
> LC_TELEPHONE="en_GB.UTF-8"
> LC_MEASUREMENT="en_GB.UTF-8"
> LC_IDENTIFICATION="en_GB.UTF-8"
> LC_ALL=
>
> $ echo $GUIX_LOCPATH
> /home/myles/.guix-profile/lib/locale

What does “ls $GUIX_LOCPATH/2.24” show?

You must make sure you have the ‘glibc-locales’ or ‘glibc-utf8-locales’
that correspond to the glibc version of the program you are using (if
you just installed postgresql, it’s using glibc 2.24.)

Then you need to make sure GUIX_LOCPATH is set both in the environment
of the postgresql daemon, and in the environment of the commands you
invoke (initdb, etc.).

HTH!

Ludo’.

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

* Re: locale warning and postgresql
  2016-11-28 20:48 ` Ludovic Courtès
@ 2016-11-28 21:47   ` Alex Kost
  2016-11-28 23:37     ` Myles English
  2016-11-28 22:25   ` Myles English
  1 sibling, 1 reply; 8+ messages in thread
From: Alex Kost @ 2016-11-28 21:47 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: help-guix

Ludovic Courtès (2016-11-28 21:48 +0100) wrote:

> Hi Myles,
>
> Myles English <mylesenglish@gmail.com> skribis:
>
>> I have always had trouble with my locale after installing guix on Arch
>> Linux (with zsh and a basic window manager, bspwm).  I have set
>> GUIX_LOCPATH in ~/.zshenv and it appears correct in my shell.  The
>> system-wide locale looks right.  When I install postgresql it gives the
>> usual "warning: failed to install locale: Invalid argument".  When I try
>> to initialise a database cluster, passing the locale doesn't work.
>>
>> Does anyone using Arch Linux and a basic WM know which file to put
>> GUIX_LOCPATH in so that the warning goes away?
>>
>> How can I find out what guix thinks its locale is or what are available?
>>
>> Is there a way to use initdb even though there is a locale warning?
>>
>> Shell experiments:
>>
>> $ locale
>> LANG=en_GB.UTF-8
>> LC_CTYPE="en_GB.UTF-8"
>> LC_NUMERIC="en_GB.UTF-8"
>> LC_TIME="en_GB.UTF-8"
>> LC_COLLATE="en_GB.UTF-8"
>> LC_MONETARY="en_GB.UTF-8"
>> LC_MESSAGES="en_GB.UTF-8"
>> LC_PAPER="en_GB.UTF-8"
>> LC_NAME="en_GB.UTF-8"
>> LC_ADDRESS="en_GB.UTF-8"
>> LC_TELEPHONE="en_GB.UTF-8"
>> LC_MEASUREMENT="en_GB.UTF-8"
>> LC_IDENTIFICATION="en_GB.UTF-8"
>> LC_ALL=
>>
>> $ echo $GUIX_LOCPATH
>> /home/myles/.guix-profile/lib/locale
>
> What does “ls $GUIX_LOCPATH/2.24” show?
>
> You must make sure you have the ‘glibc-locales’ or ‘glibc-utf8-locales’
> that correspond to the glibc version of the program you are using (if
> you just installed postgresql, it’s using glibc 2.24.)
>
> Then you need to make sure GUIX_LOCPATH is set both in the environment
> of the postgresql daemon, and in the environment of the commands you
> invoke (initdb, etc.).

Including the guix-daemon, as this warning:

>> $ guix package -i postgresql
>> warning: failed to install locale: Invalid argument
>> The following package will be upgraded:
>>    postgresql	9.5.3 -> 9.5.3	/gnu/store/sfgg20a7jnwfisajsvqdijjm2zj905az-postgresql-9.5.3

comes from the daemon, so make sure your "guix-daemon.service" has a
line like this:

  Environment=GUIX_LOCPATH=/root/.guix-profile/lib/locale

-- 
Alex

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

* Re: locale warning and postgresql
  2016-11-28 20:48 ` Ludovic Courtès
  2016-11-28 21:47   ` Alex Kost
@ 2016-11-28 22:25   ` Myles English
  2016-11-29 12:54     ` Ludovic Courtès
  1 sibling, 1 reply; 8+ messages in thread
From: Myles English @ 2016-11-28 22:25 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: help-guix

Hi Ludo',

Thanks for your help.

on [2016-11-28] at 20:48 Ludovic Courtès writes:

> Myles English <mylesenglish@gmail.com> skribis:
>
>> I have always had trouble with my locale after installing guix on Arch
>> Linux (with zsh and a basic window manager, bspwm).  I have set
>> GUIX_LOCPATH in ~/.zshenv and it appears correct in my shell.  The
>> system-wide locale looks right.

I should say that I have tried guix several times and usually (always?)
get the locale warning.

>> When I install postgresql it gives the usual "warning: failed to
>> install locale: Invalid argument".  When I try to initialise a
>> database cluster, passing the locale doesn't work.
>>
>> Does anyone using Arch Linux and a basic WM know which file to put
>> GUIX_LOCPATH in so that the warning goes away?
>>
>> How can I find out what guix thinks its locale is or what are available?
>>
>> Is there a way to use initdb even though there is a locale warning?
>>
>> Shell experiments:
>>
>> $ locale
>> LANG=en_GB.UTF-8
>> LC_CTYPE="en_GB.UTF-8"
>> LC_NUMERIC="en_GB.UTF-8"
>> LC_TIME="en_GB.UTF-8"
>> LC_COLLATE="en_GB.UTF-8"
>> LC_MONETARY="en_GB.UTF-8"
>> LC_MESSAGES="en_GB.UTF-8"
>> LC_PAPER="en_GB.UTF-8"
>> LC_NAME="en_GB.UTF-8"
>> LC_ADDRESS="en_GB.UTF-8"
>> LC_TELEPHONE="en_GB.UTF-8"
>> LC_MEASUREMENT="en_GB.UTF-8"
>> LC_IDENTIFICATION="en_GB.UTF-8"
>> LC_ALL=
>>
>> $ echo $GUIX_LOCPATH
>> /home/myles/.guix-profile/lib/locale
>
> What does “ls $GUIX_LOCPATH/2.24” show?

$ ls $GUIX_LOCPATH/2.24
ls: cannot access '/home/myles/.guix-profile/lib/locale/2.24': No such file or directory

Ah Hah!

> You must make sure you have the ‘glibc-locales’ or ‘glibc-utf8-locales’
> that correspond to the glibc version of the program you are using (if
> you just installed postgresql, it’s using glibc 2.24.)

So I need to reinstall glibc-utf8-locales?  But alas...

$ guix package -i glibc-utf8-locales
warning: failed to install locale: Invalid argument     <<< Grrrrr! Bad guix! Naughty!
The following package will be upgraded:
   glibc-utf8-locales	2.23 -> 2.23	/gnu/store/akx97sgcvnjrp0ywf02ab4m4wsmdzwyp-glibc-utf8-locales-2.23

substitute: warning: failed to install locale: Invalid argument  <<<  Stop that!
substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
The following derivations will be built:
   /gnu/store/vwcisqs25j00jqhaffa9r2xfxi9xibmj-profile.drv
   /gnu/store/j8p555s7g8akzb1pqxq34xc9bciy2m50-ca-certificate-bundle.drv
   /gnu/store/c8ad0jxwwxyjk59rhmv65a850xm486a9-info-dir.drv
   /gnu/store/5y583gn3k7qqr1s27qriflb11xapsr0r-fonts-dir.drv
2 packages in profile
guix package -i glibc-utf8-locales  7.00s user 0.30s system 49% cpu
14.627 total

This is no better:

$ guix package --no-substitutes -i glibc-utf8-locales

Then I tried:

$ guix graph --type=bag-emerged postgresql | dot -Tpdf > dag.pdf

which I think shows that postgresql 9.5.3 depends on
glibc-utf8-locales-2.23.

How can I install  glibc 2.24 ?

> Then you need to make sure GUIX_LOCPATH is set both in the environment
> of the postgresql daemon, and in the environment of the commands you
> invoke (initdb, etc.).

Ok, once I get initdb to work I'll make sure I set GUIX_LOCPATH in the
systemd service file that I will construct to start the daemon.

Myles

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

* Re: locale warning and postgresql
  2016-11-28 21:47   ` Alex Kost
@ 2016-11-28 23:37     ` Myles English
  2016-11-29  0:53       ` Myles English
  0 siblings, 1 reply; 8+ messages in thread
From: Myles English @ 2016-11-28 23:37 UTC (permalink / raw)
  To: Alex Kost; +Cc: help-guix


on [2016-11-28] at 21:47 Alex Kost writes:

> Ludovic Courtès (2016-11-28 21:48 +0100) wrote:
>
>> Hi Myles,
>>
>> Myles English <mylesenglish@gmail.com> skribis:
>>
>>> I have always had trouble with my locale after installing guix on Arch
>>> Linux (with zsh and a basic window manager, bspwm).  I have set
>>> GUIX_LOCPATH in ~/.zshenv and it appears correct in my shell.  The
>>> system-wide locale looks right.  When I install postgresql it gives the
>>> usual "warning: failed to install locale: Invalid argument".  When I try
>>> to initialise a database cluster, passing the locale doesn't work.
>>>
>>> Does anyone using Arch Linux and a basic WM know which file to put
>>> GUIX_LOCPATH in so that the warning goes away?
>>>
>>> How can I find out what guix thinks its locale is or what are available?
>>>
>>> Is there a way to use initdb even though there is a locale warning?
>>>
>>> Shell experiments:
>>>
>>> $ locale
>>> LANG=en_GB.UTF-8
>>> LC_CTYPE="en_GB.UTF-8"
>>> LC_NUMERIC="en_GB.UTF-8"
>>> LC_TIME="en_GB.UTF-8"
>>> LC_COLLATE="en_GB.UTF-8"
>>> LC_MONETARY="en_GB.UTF-8"
>>> LC_MESSAGES="en_GB.UTF-8"
>>> LC_PAPER="en_GB.UTF-8"
>>> LC_NAME="en_GB.UTF-8"
>>> LC_ADDRESS="en_GB.UTF-8"
>>> LC_TELEPHONE="en_GB.UTF-8"
>>> LC_MEASUREMENT="en_GB.UTF-8"
>>> LC_IDENTIFICATION="en_GB.UTF-8"
>>> LC_ALL=
>>>
>>> $ echo $GUIX_LOCPATH
>>> /home/myles/.guix-profile/lib/locale
>>
>> What does “ls $GUIX_LOCPATH/2.24” show?
>>
>> You must make sure you have the ‘glibc-locales’ or ‘glibc-utf8-locales’
>> that correspond to the glibc version of the program you are using (if
>> you just installed postgresql, it’s using glibc 2.24.)
>>
>> Then you need to make sure GUIX_LOCPATH is set both in the environment
>> of the postgresql daemon, and in the environment of the commands you
>> invoke (initdb, etc.).
>
> Including the guix-daemon, as this warning:
>
>>> $ guix package -i postgresql
>>> warning: failed to install locale: Invalid argument
>>> The following package will be upgraded:
>>>    postgresql	9.5.3 -> 9.5.3	/gnu/store/sfgg20a7jnwfisajsvqdijjm2zj905az-postgresql-9.5.3
>
> comes from the daemon, so make sure your "guix-daemon.service" has a
> line like this:
>
>   Environment=GUIX_LOCPATH=/root/.guix-profile/lib/locale

Thank you, I hadn't installed glibc-utf8-locales for root.  Perhaps this
step could be added to the documentation in "2.6.1 Locales"?

I also might have been using --locale wrong but I still can't get initdb
to use one:


$ initdb --locale=en_GB -E UTF8 -D '/home/myles/pgdata-guix'
The files belonging to this database system will be owned by user "myles".
This user must also own the server process.

initdb: invalid locale name "en_GB"


$ initdb --locale=en_GB.UTF-8 -E UTF8 -D '/home/myles/pgdata-guix'
The files belonging to this database system will be owned by user "myles".
This user must also own the server process.

initdb: invalid locale name "en_GB.UTF-8"


$ initdb -D '/home/myles/pgdata-guix'
The files belonging to this database system will be owned by user "myles".
This user must also own the server process.

initdb: invalid locale settings; check LANG and LC_* environment
variables


Any ideas?

Myles

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

* Re: locale warning and postgresql
  2016-11-28 23:37     ` Myles English
@ 2016-11-29  0:53       ` Myles English
  2016-11-29  1:57         ` Leo Famulari
  0 siblings, 1 reply; 8+ messages in thread
From: Myles English @ 2016-11-29  0:53 UTC (permalink / raw)
  To: Alex Kost; +Cc: help-guix


on [2016-11-28] at 23:37 Myles English writes:

> $ initdb --locale=en_GB -E UTF8 -D '/home/myles/pgdata-guix'
> The files belonging to this database system will be owned by user "myles".
> This user must also own the server process.
>
> initdb: invalid locale name "en_GB"

Excuse my arrogance, I thought that en_GB was important enough to make
it into glibc-utf8-locales.  After installing glibc-locales it works.

Myles

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

* Re: locale warning and postgresql
  2016-11-29  0:53       ` Myles English
@ 2016-11-29  1:57         ` Leo Famulari
  0 siblings, 0 replies; 8+ messages in thread
From: Leo Famulari @ 2016-11-29  1:57 UTC (permalink / raw)
  To: Myles English; +Cc: Alex Kost, help-guix

On Tue, Nov 29, 2016 at 12:53:59AM +0000, Myles English wrote:
> 
> on [2016-11-28] at 23:37 Myles English writes:
> 
> > $ initdb --locale=en_GB -E UTF8 -D '/home/myles/pgdata-guix'
> > The files belonging to this database system will be owned by user "myles".
> > This user must also own the server process.
> >
> > initdb: invalid locale name "en_GB"
> 
> Excuse my arrogance, I thought that en_GB was important enough to make
> it into glibc-utf8-locales.  After installing glibc-locales it works.

Glibc-ut8-locales is a small subset of glibc-locales. It's partially
intended for test environments, where using the full set of locales
could be impractical:

$ guix size glibc-utf8-locales
store item                                                       total    self
/gnu/store/bhj5xdwwd2dg770lmlks7hyny8vzjm9x-glibc-utf8-locales-2.24     6.3     6.3 100.0%
total: 6.3 MiB
$ guix size glibc-locales     
store item                                                       total    self
/gnu/store/hyi7svs0ds79wrcg5l0nr36zzjikqj7i-glibc-locales-2.24     474.5   474.5 100.0%
total: 474.5 MiB

Almost two orders of magnitude difference!

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

* Re: locale warning and postgresql
  2016-11-28 22:25   ` Myles English
@ 2016-11-29 12:54     ` Ludovic Courtès
  0 siblings, 0 replies; 8+ messages in thread
From: Ludovic Courtès @ 2016-11-29 12:54 UTC (permalink / raw)
  To: Myles English; +Cc: help-guix

Hi!

Myles English <mylesenglish@gmail.com> skribis:

> on [2016-11-28] at 20:48 Ludovic Courtès writes:
>
>> Myles English <mylesenglish@gmail.com> skribis:
>>
>>> I have always had trouble with my locale after installing guix on Arch
>>> Linux (with zsh and a basic window manager, bspwm).  I have set
>>> GUIX_LOCPATH in ~/.zshenv and it appears correct in my shell.  The
>>> system-wide locale looks right.
>
> I should say that I have tried guix several times and usually (always?)
> get the locale warning.
>
>>> When I install postgresql it gives the usual "warning: failed to
>>> install locale: Invalid argument".  When I try to initialise a
>>> database cluster, passing the locale doesn't work.
>>>
>>> Does anyone using Arch Linux and a basic WM know which file to put
>>> GUIX_LOCPATH in so that the warning goes away?
>>>
>>> How can I find out what guix thinks its locale is or what are available?
>>>
>>> Is there a way to use initdb even though there is a locale warning?
>>>
>>> Shell experiments:
>>>
>>> $ locale
>>> LANG=en_GB.UTF-8
>>> LC_CTYPE="en_GB.UTF-8"
>>> LC_NUMERIC="en_GB.UTF-8"
>>> LC_TIME="en_GB.UTF-8"
>>> LC_COLLATE="en_GB.UTF-8"
>>> LC_MONETARY="en_GB.UTF-8"
>>> LC_MESSAGES="en_GB.UTF-8"
>>> LC_PAPER="en_GB.UTF-8"
>>> LC_NAME="en_GB.UTF-8"
>>> LC_ADDRESS="en_GB.UTF-8"
>>> LC_TELEPHONE="en_GB.UTF-8"
>>> LC_MEASUREMENT="en_GB.UTF-8"
>>> LC_IDENTIFICATION="en_GB.UTF-8"
>>> LC_ALL=
>>>
>>> $ echo $GUIX_LOCPATH
>>> /home/myles/.guix-profile/lib/locale
>>
>> What does “ls $GUIX_LOCPATH/2.24” show?
>
> $ ls $GUIX_LOCPATH/2.24
> ls: cannot access '/home/myles/.guix-profile/lib/locale/2.24': No such file or directory
>
> Ah Hah!

See?  :-)

>> You must make sure you have the ‘glibc-locales’ or ‘glibc-utf8-locales’
>> that correspond to the glibc version of the program you are using (if
>> you just installed postgresql, it’s using glibc 2.24.)
>
> So I need to reinstall glibc-utf8-locales?  But alas...
>
> $ guix package -i glibc-utf8-locales
> warning: failed to install locale: Invalid argument     <<< Grrrrr! Bad guix! Naughty!

At this point, I wouldn’t mind getting rid of this message altogether.
:-)

> Then I tried:
>
> $ guix graph --type=bag-emerged postgresql | dot -Tpdf > dag.pdf
>
> which I think shows that postgresql 9.5.3 depends on
> glibc-utf8-locales-2.23.

This is showing you compile-time (not run-time) dependencies of
postgresql, possibly a version other than the one you installed.

> How can I install  glibc 2.24 ?

If you install a postgresql from a recentish Guix, it’ll be linked
against glibc 2.24.

Ludo’.

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

end of thread, other threads:[~2016-11-29 12:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-28 14:02 locale warning and postgresql Myles English
2016-11-28 20:48 ` Ludovic Courtès
2016-11-28 21:47   ` Alex Kost
2016-11-28 23:37     ` Myles English
2016-11-29  0:53       ` Myles English
2016-11-29  1:57         ` Leo Famulari
2016-11-28 22:25   ` Myles English
2016-11-29 12:54     ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.