Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Seiderer <ps.report@gmx.net>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v1 2/3] package/postgresql: needs locale command
Date: Tue, 22 Sep 2020 23:20:04 +0200	[thread overview]
Message-ID: <20200922232004.354d1852@gmx.net> (raw)
In-Reply-To: <cb3d6427-c511-4b5d-56b0-6cd0a9fecb81@mind.be>

Hello Arnout,

On Mon, 21 Sep 2020 23:22:24 +0200, Arnout Vandecappelle <arnout@mind.be> wrote:

>  Hi Peter,
>
> On 21/09/2020 22:04, Peter Seiderer wrote:
> > Hello Thomas,
> >
> > On Mon, 21 Sep 2020 10:20:13 +0200, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
> >
> >> Hello,
> >>
> >> On Sun, 20 Sep 2020 17:06:58 +0200
> >> Peter Seiderer <ps.report@gmx.net> wrote:
> >>
> >>> Running (as e.g. /etc/init.d/S50postgresql does):
> >>>
> >>>   su - postgres -c '/usr/bin/pg_ctl initdb -D /var/lib/pgsql'
> >>>
> >>> gives the following warning:
> >>>
> >>>   performing post-bootstrap initialization ... sh: locale: not found
> >>>   1970-01-01 01:13:43.498 UTC [246] WARNING:  no usable system locales were found
> >>>   ok
> >>
> >> What is the situation with uClibc and musl toolchains ? Do they provide
> >> the "locale" command as well ?
> >
> > - uclibc without BR2_TOOLCHAIN_BUILDROOT_LOCALE: no warning, no locale command ([1])
> > - uclicc with BR2_TOOLCHAIN_BUILDROOT_LOCALE: no warning, locale command installed on target
> > - musl: 'locale: not found' warning, no locale commmand
> >
> > But it is 'only' a warning... and easy to fix for gcc/buildroot toolchain...
> >
> >>
> >> What about external glibc toolchains ? Do we install/copy the locale
> >> tool to the target ?
>
>  I checked - no, we don't install it, even if it is part of the toolchain sysroot.
>
> > Do not know...., but it is only a warning...
>
>  It is only a warning, but this patch is meant to get rid of that warning, no?
> If this series only fixes that warning for the internal toolchain, I don't think
> it's very useful.

Get rid of the warning for one use case (where it is easy to fix) ;-)

>
>  But probably toolchain-external-pkg.mk should be fixed to install locale if
> available, just like we do for ldd. And maybe also ldconfig and getconf (the
> other two glibc utils we install) should be handled in the same way?

Will take a look...

>
>
> > Regards,
> > Peter
> >
> > [1] The usage of the locale command depends on 'HAVE_LOCALE_T' which depends
> > on the availability of the locale_t type (see postgresql-12.4/config/c-library.m4
> > and postgresql-12.4/src/backend/commands/collationcmds.c)
>
>  We could instead prepopulate the cache variable pgac_cv_type_locale_t with the
> presence of the locale binary in the target directory. Something like:
>
> POSTGRESQL_CONF_ENV += pgac_cv_type_locale_t=$(if $(wildcard
> $(TARGET_DIR)/usr/bin/locale),yes,no)
>
>  This is assuming that the presence of the locale executable corresponds with
> the availability of locales (which is apparently not the case for musl, but I
> think that that should be considered a bug in our musl integration). But at
> least for glibc and uClibc it seems to be correct.

I believe false assumption, locale_t type availability (and the availability of
different locale definitions) does not automatically mean the locale command will
be available (see glibc case without  BR2_PACKAGE_GLIBC_UTILS, and without
BR2_SYSTEM_ENABLE_NLS before patch 1)...

>
>  This solution also removes the need for patch 1/3, which I thought was a bit
> iffy anyway.

See above and any reasons why the locale command should be bound to NSL support?

Regards,
Peter

>
>  Regards,
>  Arnout

  reply	other threads:[~2020-09-22 21:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-20 15:06 [Buildroot] [PATCH v1 1/3] package/glibc: install locale cmd independent of NLS Peter Seiderer
2020-09-20 15:06 ` [Buildroot] [PATCH v1 2/3] package/postgresql: needs locale command Peter Seiderer
2020-09-21  8:20   ` Thomas Petazzoni
2020-09-21 20:04     ` Peter Seiderer
2020-09-21 21:22       ` Arnout Vandecappelle
2020-09-22 21:20         ` Peter Seiderer [this message]
2020-09-20 15:06 ` [Buildroot] [PATCH v1 3/3] package/postgresql: set locale for initdb to C Peter Seiderer
2020-09-21 21:25   ` Arnout Vandecappelle
2020-09-22 21:25     ` Peter Seiderer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200922232004.354d1852@gmx.net \
    --to=ps.report@gmx.net \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox