circleci: Set up locale en_US.UTF-8.

See comment for motivation and what's known.

[greg: Added comment, summarizing Vishnu's results from testing.]
This commit is contained in:
Vishnu Ks 2017-12-14 01:22:16 +05:30 committed by Greg Price
parent 48163db479
commit f743eeb1eb
2 changed files with 14 additions and 3 deletions

View File

@ -6,7 +6,7 @@ jobs:
build: build:
docker: docker:
# This is built from tools/circleci/images/Dockerfile . # This is built from tools/circleci/images/Dockerfile .
- image: gregprice/circleci:trusty-python-2.test - image: gregprice/circleci:trusty-python-3.test
working_directory: ~/repo working_directory: ~/repo

View File

@ -40,8 +40,19 @@ RUN apt-get update \
netcat unzip zip jq \ netcat unzip zip jq \
python3-pip \ python3-pip \
&& ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime \ && ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime \
&& { locale-gen C.UTF-8 || true; } && { locale-gen en_US.UTF-8 || true; } \
ENV LANG=C.UTF-8 && echo "LC_ALL=en_US.UTF-8" | sudo tee -a /etc/default/locale
# Set the locale, together with the locale-related steps above.
# It's not entirely clear why, but alternatives that don't work include
# * using `C.UTF-8` instead of `en_US.UTF-8`, here and above
# (causes mysterious failures in zerver.tests.test_narrow)
# * skipping the /etc/default/locale step above (ditto)
# * skipping this ENV instruction (causes provision to fail,
# because Python tries to use the `ascii` codec)
# Details in https://github.com/zulip/zulip/pull/7762#issuecomment-353197289
# and particularly https://circleci.com/gh/hackerkid/zulip/80 .
ENV LC_ALL en_US.UTF-8
# Install Docker. This logic comes from Circle's Dockerfile; it's probably # Install Docker. This logic comes from Circle's Dockerfile; it's probably
# faster than the upstream-recommended approach of using their apt repo, # faster than the upstream-recommended approach of using their apt repo,