You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ mkdir test
$ cd test
$ cabal init -n
...
$ cat <<here > styx.yaml
local-packages:
test:
location: .
here
$ styx configure
Watch the problems
$ nix-shell .styx/shell.nix --pure
nix$ echo $LANG
en_US.UTF-8
nix$ locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.utf8
POSIX
nix$ ghci
Prelude> getLine
ä*** Exception: <stdin>: hGetLine: invalid argument (invalid byte sequence)
Note how en_US.UTF-8 is not listed in the available locales given by locale -a. The Cannot set ... error messages by locale -a are also due to the invalid value of LANG. Furthermore Haskell functions like getLine will assume the character encoding to be ASCI, causing them to throw exceptions on non ASCI characters.
Solutions
There are two possible solutions:
Set LANG=C.UTF-8
Add glibcLocales to buildInputs to make more locales available. This can be done easily as a workaround by adding glibcLocales to non-haskell-deps in styx.yaml.
The text was updated successfully, but these errors were encountered:
How to reproduce
en_US.UTF-8
is not listed in the available locales given bylocale -a
. TheCannot set ...
error messages bylocale -a
are also due to the invalid value ofLANG
. Furthermore Haskell functions likegetLine
will assume the character encoding to be ASCI, causing them to throw exceptions on non ASCI characters.Solutions
There are two possible solutions:
LANG=C.UTF-8
glibcLocales
tobuildInputs
to make more locales available. This can be done easily as a workaround by addingglibcLocales
tonon-haskell-deps
instyx.yaml
.The text was updated successfully, but these errors were encountered: