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