diff options
Diffstat (limited to 'guix-build-coordinator/utils.scm')
-rw-r--r-- | guix-build-coordinator/utils.scm | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/guix-build-coordinator/utils.scm b/guix-build-coordinator/utils.scm index c619a12..5d365a6 100644 --- a/guix-build-coordinator/utils.scm +++ b/guix-build-coordinator/utils.scm @@ -65,7 +65,9 @@ running-on-the-hurd? - get-gc-metrics-updater)) + get-gc-metrics-updater + + check-locale!)) (eval-when (eval load compile) (begin @@ -931,3 +933,31 @@ again." (let ((value (assq-ref stats name))) (metric-set metric value)))) metrics)))) + +(define (check-locale!) + (with-exception-handler + (lambda (exn) + (display + (simple-format + #f + "exception when calling setlocale: ~A +falling back to en_US.utf8\n" + exn) + (current-error-port)) + + (with-exception-handler + (lambda (exn) + (display + (simple-format + #f + "exception when calling setlocale with en_US.utf8: ~A\n" + exn) + (current-error-port)) + + (exit 1)) + (lambda _ + (setlocale LC_ALL "en_US.utf8")) + #:unwind? #t)) + (lambda _ + (setlocale LC_ALL "")) + #:unwind? #t)) |