Subject: [bug#73660] [PATCH v2 2/3] gexp: Attempt to set LC_CTYPE in compiled-modules.

From: Tomas Volf <[email-masked]>
Date: Thu, 23 Jan 2025 23:57:07 +0100

This allows compiling modules with unicode in their names.

* guix/gexp.scm (compiled-modules): Attempt to set LC_CTYPE to C.UTF-8.

Change-Id: Ie92a57fe1c3b45d1c7a5e8865fcf291c5f590c11
---
 guix/gexp.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/guix/gexp.scm b/guix/gexp.scm
index de4afc190c..0e99069a56 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1700,6 +1700,9 @@ (define* (compiled-modules modules
                        (system base target)
                        (system base compile))
 
+          ;; Best effort.  The locale is not installed when cross-compiling.
+          (false-if-exception (setlocale LC_CTYPE "C.UTF-8"))
+
           (define modules
             (getenv "modules"))
 
-- 
2.47.1