[Git][ghc/ghc][master] 2 commits: gitlab-ci: Handle distributions without locales

Marge Bot gitlab at gitlab.haskell.org
Tue Sep 8 19:44:05 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
0c61cbff by Ben Gamari at 2020-09-08T15:43:54-04:00
gitlab-ci: Handle distributions without locales

Previously we would assume that the `locale` utility exists. However,
this is not so on Alpine as musl's locale support is essentially
non-existent.

(cherry picked from commit 17cdb7ac3b557a245fee1686e066f9f770ddc21e)

- - - - -
d989c842 by Ben Gamari at 2020-09-08T15:43:55-04:00
gitlab-ci: Accept Centos 7 C.utf8 locale

Centos apparently has C.utf8 rather than C.UTF-8.

(cherry picked from commit d9f85dd25a26a04d3485470afb3395ee2dec6464)

- - - - -


1 changed file:

- .gitlab/ci.sh


Changes:

=====================================
.gitlab/ci.sh
=====================================
@@ -58,6 +58,12 @@ function run() {
 TOP="$(pwd)"
 
 function setup_locale() {
+  # Musl doesn't provide locale support at all...
+  if ! which locale > /dev/null; then
+    info "No locale executable. Skipping locale setup..."
+    return
+  fi
+
   # BSD grep terminates early with -q, consequently locale -a will get a
   # SIGPIPE and the pipeline will fail with pipefail.
   shopt -o -u pipefail
@@ -70,6 +76,9 @@ function setup_locale() {
   elif locale -a | grep -q en_US.UTF-8; then
     # Centos doesn't have C.UTF-8
     export LANG=en_US.UTF-8
+  elif locale -a | grep -q en_US.utf8; then
+    # Centos doesn't have C.UTF-8
+    export LANG=en_US.utf8
   else
     error "Failed to find usable locale"
     info "Available locales:"



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/44472daf500bf862921e89ad45c9741a07a64f61...d989c84225090f850591e9f4f82adffbf8c96cac

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/44472daf500bf862921e89ad45c9741a07a64f61...d989c84225090f850591e9f4f82adffbf8c96cac
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200908/3201f0fa/attachment.html>


More information about the ghc-commits mailing list