You are not logged in.

#1 2022-10-24 08:47:27

buhtz
Member
Registered: 2022-08-24
Posts: 25
Website

[Fixed] No "locale" while PKGBUILD runs?

Hello,

I'm not an Arch user so I maybe miss some basic knowledge about Arch and your packaging process.
But at upstream I perceived a strange behaviour that I would like to investigate.

On a usual Linux system (also on Arch) you can get the "local" like this:

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

You can also do this with Python.

$ python3 -c "import locale;print(locale.getlocale())"
('de_DE', 'UTF-8')

But is it possible that the PKGBUILD process and its environment doesn't have a locale?
For example this package https://aur.archlinux.org/cgit/aur.git/ … intime-git has a unittest which checks the return value of Pythons "local.getlocale()" and it returns "None". Regarding to the docu it is possible that this method return "None".

But the user who reported that problem is also able to get a valid output on the shell via "locale". So there is a local but not when PKGBUILD runs.

Is there a good explanation for that?

Last edited by buhtz (2022-10-24 09:35:17)


Member of upstream maintenance Teams of Back In Time

Offline

#2 2022-10-24 09:25:42

ayekat
Member
Registered: 2011-01-17
Posts: 1,632

Re: [Fixed] No "locale" while PKGBUILD runs?

The PKGBUILD you've linked there invokes make with LC_ALL=C.

I assume this is to ensure that the build always behaves the same way, no matter what the build system has configured as a locale.

As an upstream, you could try to test that case for your build scripts, because LC_ALL=C should not make your build fail.


pkgshackscfgblag

Offline

#3 2022-10-24 09:27:34

buhtz
Member
Registered: 2022-08-24
Posts: 25
Website

Re: [Fixed] No "locale" while PKGBUILD runs?

ayekat wrote:

The PKGBUILD you've linked there invokes make with LC_ALL=C.

At line 33. https://aur.archlinux.org/cgit/aur.git/ … me-git#n33


Member of upstream maintenance Teams of Back In Time

Offline

#4 2022-10-24 09:35:08

ayekat
Member
Registered: 2011-01-17
Posts: 1,632

Re: [Fixed] No "locale" while PKGBUILD runs?

Yes, exactly. That's where make gets invoked with LC_ALL=C.

Last edited by ayekat (2022-10-24 09:35:18)


pkgshackscfgblag

Offline

Board footer

Powered by FluxBB