rakudo / star

Rakudo Star (Raku distribution)
https://rakudo.org/
Artistic License 2.0
265 stars 41 forks source link

C.UTF-8 locale not supported everywhere #161

Closed madsen closed 3 years ago

madsen commented 3 years ago

lib/actions/install.bash unconditionally sets LC_ALL=C.UTF-8. However, that locale doesn't exist on all systems (e.g. Arch Linux), resulting in a lot of warnings:

$ ./bin/rstar install
/path/rakudo-star-2020.10/lib/actions/install.bash: line 46: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8): No such file or directory
[2020-11-27T22:25:28] [INFO]  Installing Raku in /path/rakudo-star-2020.10
[2020-11-27T22:25:28] [INFO]  Starting build on MoarVM
[2020-11-27T22:25:28] [NOTIC] Using /path/rakudo-star-2020.10/tmp/tmp.FclpQZgMzw as working directory
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = "C.UTF-8",
    LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
sh: warning: setlocale: LC_ALL: cannot change locale (C.UTF-8)

I worked around it by changing the line in install.bash to say LC_ALL=en_US.UTF-8. Rakudo seemed to build fine.

Other projects have encountered this issue, e.g. https://github.com/electron-userland/electron-builder/issues/2340

Tyil commented 3 years ago

en_US.UTF-8 will work fine on English systems, but would break on systems not configured to install English locales. I've not encountered this issue on any of my test targets, so it would seem this is an Archlinux specific issue for now (unless you know of any other distros that lack this very standard locale).

I'll have to look into potential solutions, but my first instinct is that Archlinux should support this locale.

Tyil commented 3 years ago

I've added a workaround for Archlinux in 1656557.