LoginSignup
0
0

More than 5 years have passed since last update.

How to fix Non-NixOS TravisCI setlocale problems

Posted at

On TravisCI, you will very quickly run into locale related issues like so:

bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/nix/store/n2hjbpkf4c0m48945ivxs3lmsczzw2rg-bash-4.4-p23/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Failure to decode string:
/nix/store/n2hjbpkf4c0m48945ivxs3lmsczzw2rg-bash-4.4-p23/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/nix/store/n2hjbpkf4c0m48945ivxs3lmsczzw2rg-bash-4.4-p23/bin/bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

To work around this problem, set LOCALE_ARCHIVE_2_27 (from glibc-locales-2.27) by using the <nixpkgs> glibcLocales package path:

sudo: required
dist: trusty
language: nix
script:
  - glibcLocales=$(nix-build --no-out-link "<nixpkgs>" -A glibcLocales)
  - export LOCALE_ARCHIVE_2_27="${glibcLocales}/lib/locale/locale-archive"
  - # other things in your script like:
  - make

See https://github.com/NixOS/nixpkgs/issues/38991#issuecomment-443840585 for more details

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0