system: Define 'GUIX_LOCPATH' to work around 'glibc' package defect.
authorLudovic Courtès <ludo@gnu.org>
Tue, 2 Aug 2016 16:05:23 +0000 (18:05 +0200)
committerLudovic Courtès <ludo@gnu.org>
Tue, 2 Aug 2016 16:07:19 +0000 (18:07 +0200)
Our 'glibc' package currently ignores /run/current-system/locale,
although the intent is to look for locales in that directory.

* gnu/packages/base.scm (glibc/linux): Add comment about
/run/current-system/locale being ignored.
* gnu/system.scm (operating-system-environment-variables): Add
'GUIX_LOCPATH'.
* gnu/tests/base.scm (run-basic-test): Add "locale" test.

gnu/packages/base.scm
gnu/system.scm
gnu/tests/base.scm

index 5edf3eb..a476837 100644 (file)
@@ -535,6 +535,7 @@ store.")
             ;;
             ;; `--localedir' is not honored, so work around it.
             ;; See <http://sourceware.org/ml/libc-alpha/2013-03/msg00093.html>.
+            ;; FIXME: This hack no longer works on 2.23!
             (string-append "libc_cv_localedir=/run/current-system/locale/"
                            ,version)
 
index 04dd7a8..d6bf6c4 100644 (file)
@@ -545,7 +545,12 @@ use 'plain-file' instead~%")
 
     ;; By default, applications that use D-Bus, such as Emacs, abort at startup
     ;; when /etc/machine-id is missing.  Make sure these warnings are non-fatal.
-    ("DBUS_FATAL_WARNINGS" . "0")))
+    ("DBUS_FATAL_WARNINGS" . "0")
+
+    ;; XXX: Normally we wouldn't need to do this, but our glibc@2.23 package
+    ;; looks things up in 'PREFIX/lib/locale' instead of
+    ;; '/run/current-system/locale' as was intended.
+    ("GUIX_LOCPATH" . "/run/current-system/locale")))
 
 (define %setuid-programs
   ;; Default set of setuid-root programs.
index a6278b2..7170ab1 100644 (file)
@@ -178,6 +178,18 @@ info --version")
              '(false-if-exception (getaddrinfo "does-not-exist"))
              marionette))
 
+          (test-equal "locale"
+            "en_US.utf8"
+            (marionette-eval '(begin
+                                ;; XXX: This 'setenv' call wouldn't be needed
+                                ;; but our glibc@2.23 currently ignores
+                                ;; /run/current-system/locale.
+                                (setenv "GUIX_LOCPATH"
+                                        "/run/current-system/locale")
+                                (let ((before (setlocale LC_ALL "en_US.utf8")))
+                                  (setlocale LC_ALL before)))
+                             marionette))
+
           (test-assert "screendump"
             (begin
               (marionette-control (string-append "screendump " #$output