* website: Building fails because of missing locales
@ 2021-04-06 15:59 Luis Felipe
2021-04-06 18:11 ` Leo Famulari
2021-04-06 18:14 ` Julien Lepiller
0 siblings, 2 replies; 14+ messages in thread
From: Luis Felipe @ 2021-04-06 15:59 UTC (permalink / raw)
To: guix-devel
Hello,
I updated my local copy of guix-artwork repository today and now running "haunt build" fails with this message:
★★★★★★★★★★★★★★★★★★★★
Backtrace:
In ice-9/threads.scm:
390:8 19 (_ _)
In ice-9/boot-9.scm:
3223:13 18 (_)
In ice-9/threads.scm:
390:8 17 (_ _)
In ice-9/boot-9.scm:
3507:20 16 (_)
2806:4 15 (save-module-excursion _)
3527:26 14 (_)
In unknown file:
13 (primitive-load-path "apps/base/data" #<procedure 7fd2e…>)
In ice-9/eval.scm:
626:19 12 (_ #<directory (apps base data) 7fd2ec67e640>)
173:55 11 (_ #<directory (apps base data) 7fd2ec67e640>)
174:20 10 (_ #<directory (apps base data) 7fd2ec67e640>)
177:32 9 (lp (#<procedure 7fd2eaff9b40 at ice-9/eval.scm:297:…> …))
159:9 8 (_ #(#<directory (apps base data) 7fd2ec67e640> (G_ …) …))
159:9 7 (_ #(#<directory (apps base data) 7fd2ec67e640> (G_ …) …))
159:9 6 (_ #(#<directory (apps base data) 7fd2ec67e640> (G_ …) …))
163:9 5 (_ #(#<directory (apps base data) 7fd2ec67e640> (G_ …) …))
In srfi/srfi-1.scm:
586:29 4 (map1 ("de_DE" "en_US" "eo" "es_ES" "fr_FR" "ko_KR" # #))
586:29 3 (map1 ("en_US" "eo" "es_ES" "fr_FR" "ko_KR" "ru_RU" "…"))
586:17 2 (map1 ("eo" "es_ES" "fr_FR" "ko_KR" "ru_RU" "zh_CN"))
In ice-9/eval.scm:
619:8 1 (_ #(#(#<directory (apps base data) 7fd2ec67e640> # …) …))
In unknown file:
0 (setlocale 6 "eo.utf8")
ERROR: In procedure setlocale:
In procedure setlocale: Argumento inválido
★★★★★★★★★★★★★★★★★★★★
I see in the commit log that there's a new commit adding Esperanto to the website translations, but I was surprised to see this error because the website manifest.scm includes "glibc-locales" and I thought it would provide "eo.utf8" locale, but, apparently, it doesn't (see "locale -a" output below).
Also, if I understand correctly, the package description for "glibc-locales" says it provides more than 400 locales, but once installed, I see less than 40:
★★★★★★★★★★★★★★★★★★★★
$ locale -a
C
ca_ES.utf8
cs_CZ.utf8
da_DK.utf8
de_DE.utf8
el_GR.utf8
en_AU.utf8
en_CA.utf8
en_GB.utf8
en_US.utf8
en_US.UTF-8
es_AR.utf8
es_CL.utf8
es_CO.utf8
es_ES.utf8
es_MX.utf8
fi_FI.utf8
fr_BE.utf8
fr_CA.utf8
fr_CH.utf8
fr_FR.utf8
ga_IE.utf8
it_IT.utf8
ja_JP.utf8
ko_KR.utf8
nb_NO.utf8
nl_NL.utf8
pl_PL.utf8
POSIX
pt_PT.utf8
ro_RO.utf8
ru_RU.utf8
sv_SE.utf8
tr_TR.utf8
uk_UA.utf8
vi_VN.utf8
zh_CN.utf8
★★★★★★★★★★★★★★★★★★★★
I'm not sure what to do here. Maybe the use of "setlocale" should be guarded against missing locales, but I'm also confused about the 400 locales part, where's the rest?
(I'm using Guix System 1148890)
---
Luis Felipe López Acevedo
https://luis-felipe.gitlab.io/
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: website: Building fails because of missing locales
2021-04-06 15:59 website: Building fails because of missing locales Luis Felipe
@ 2021-04-06 18:11 ` Leo Famulari
2021-04-06 20:20 ` Julien Lepiller
2021-04-06 18:14 ` Julien Lepiller
1 sibling, 1 reply; 14+ messages in thread
From: Leo Famulari @ 2021-04-06 18:11 UTC (permalink / raw)
To: Luis Felipe; +Cc: guix-devel
On Tue, Apr 06, 2021 at 03:59:20PM +0000, Luis Felipe wrote:
> Hello,
>
> I updated my local copy of guix-artwork repository today and now running "haunt build" fails with this message:
>
> ★★★★★★★★★★★★★★★★★★★★
> Backtrace:
> In ice-9/threads.scm:
> 390:8 19 (_ _)
> In ice-9/boot-9.scm:
> 3223:13 18 (_)
> In ice-9/threads.scm:
> 390:8 17 (_ _)
> In ice-9/boot-9.scm:
> 3507:20 16 (_)
> 2806:4 15 (save-module-excursion _)
> 3527:26 14 (_)
> In unknown file:
> 13 (primitive-load-path "apps/base/data" #<procedure 7fd2e…>)
> In ice-9/eval.scm:
> 626:19 12 (_ #<directory (apps base data) 7fd2ec67e640>)
> 173:55 11 (_ #<directory (apps base data) 7fd2ec67e640>)
> 174:20 10 (_ #<directory (apps base data) 7fd2ec67e640>)
> 177:32 9 (lp (#<procedure 7fd2eaff9b40 at ice-9/eval.scm:297:…> …))
> 159:9 8 (_ #(#<directory (apps base data) 7fd2ec67e640> (G_ …) …))
> 159:9 7 (_ #(#<directory (apps base data) 7fd2ec67e640> (G_ …) …))
> 159:9 6 (_ #(#<directory (apps base data) 7fd2ec67e640> (G_ …) …))
> 163:9 5 (_ #(#<directory (apps base data) 7fd2ec67e640> (G_ …) …))
> In srfi/srfi-1.scm:
> 586:29 4 (map1 ("de_DE" "en_US" "eo" "es_ES" "fr_FR" "ko_KR" # #))
> 586:29 3 (map1 ("en_US" "eo" "es_ES" "fr_FR" "ko_KR" "ru_RU" "…"))
> 586:17 2 (map1 ("eo" "es_ES" "fr_FR" "ko_KR" "ru_RU" "zh_CN"))
> In ice-9/eval.scm:
> 619:8 1 (_ #(#(#<directory (apps base data) 7fd2ec67e640> # …) …))
> In unknown file:
> 0 (setlocale 6 "eo.utf8")
>
> ERROR: In procedure setlocale:
> In procedure setlocale: Argumento inválido
> ★★★★★★★★★★★★★★★★★★★★
This happens for me too.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: website: Building fails because of missing locales
2021-04-06 18:11 ` Leo Famulari
@ 2021-04-06 20:20 ` Julien Lepiller
2021-04-07 2:20 ` Luis Felipe
0 siblings, 1 reply; 14+ messages in thread
From: Julien Lepiller @ 2021-04-06 20:20 UTC (permalink / raw)
To: Leo Famulari; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 2181 bytes --]
Le Tue, 6 Apr 2021 14:11:03 -0400,
Leo Famulari <leo@famulari.name> a écrit :
> On Tue, Apr 06, 2021 at 03:59:20PM +0000, Luis Felipe wrote:
> > Hello,
> >
> > I updated my local copy of guix-artwork repository today and now
> > running "haunt build" fails with this message:
> >
> > ★★★★★★★★★★★★★★★★★★★★
> > Backtrace:
> > In ice-9/threads.scm:
> > 390:8 19 (_ _)
> > In ice-9/boot-9.scm:
> > 3223:13 18 (_)
> > In ice-9/threads.scm:
> > 390:8 17 (_ _)
> > In ice-9/boot-9.scm:
> > 3507:20 16 (_)
> > 2806:4 15 (save-module-excursion _)
> > 3527:26 14 (_)
> > In unknown file:
> > 13 (primitive-load-path "apps/base/data" #<procedure
> > 7fd2e…>) In ice-9/eval.scm:
> > 626:19 12 (_ #<directory (apps base data) 7fd2ec67e640>)
> > 173:55 11 (_ #<directory (apps base data) 7fd2ec67e640>)
> > 174:20 10 (_ #<directory (apps base data) 7fd2ec67e640>)
> > 177:32 9 (lp (#<procedure 7fd2eaff9b40 at ice-9/eval.scm:297:…>
> > …)) 159:9 8 (_ #(#<directory (apps base data) 7fd2ec67e640> (G_ …)
> > …)) 159:9 7 (_ #(#<directory (apps base data) 7fd2ec67e640> (G_ …)
> > …)) 159:9 6 (_ #(#<directory (apps base data) 7fd2ec67e640> (G_ …)
> > …)) 163:9 5 (_ #(#<directory (apps base data) 7fd2ec67e640> (G_ …)
> > …)) In srfi/srfi-1.scm:
> > 586:29 4 (map1 ("de_DE" "en_US" "eo" "es_ES" "fr_FR" "ko_KR" #
> > #)) 586:29 3 (map1 ("en_US" "eo" "es_ES" "fr_FR" "ko_KR" "ru_RU"
> > "…")) 586:17 2 (map1 ("eo" "es_ES" "fr_FR" "ko_KR" "ru_RU"
> > "zh_CN")) In ice-9/eval.scm:
> > 619:8 1 (_ #(#(#<directory (apps base data) 7fd2ec67e640> # …)
> > …)) In unknown file:
> > 0 (setlocale 6 "eo.utf8")
> >
> > ERROR: In procedure setlocale:
> > In procedure setlocale: Argumento inválido
> > ★★★★★★★★★★★★★★★★★★★★
>
> This happens for me too.
>
Attached is a patch to the manifest.scm that should fix the issue: it
ensures that you enter an environment where the locales corresponding
to po/LINGUAS are available. Can you check if it fixes your issues?
Thanks!
[-- Attachment #2: 0001-website-Add-locales-in-manifest.patch --]
[-- Type: text/x-patch, Size: 2339 bytes --]
From 432145b027b36cc0eedf28d89664a6646db9ebc6 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Tue, 6 Apr 2021 22:16:43 +0200
Subject: [PATCH] website: Add locales in manifest.
* website/manifest.scm: Add locale definition for all our translations.
---
website/manifest.scm | 53 +++++++++++++++++++++++++++++++++-----------
1 file changed, 40 insertions(+), 13 deletions(-)
diff --git a/website/manifest.scm b/website/manifest.scm
index eda382a..6248c87 100644
--- a/website/manifest.scm
+++ b/website/manifest.scm
@@ -1,6 +1,8 @@
(use-modules (guix packages)
((gnu packages package-management) #:select (guix))
((gnu packages guile-xyz) #:select (haunt))
+ (gnu system locale)
+ (ice-9 rdelim)
(srfi srfi-1))
(define the-good-guile
@@ -14,17 +16,42 @@
`(("guile" ,the-good-guile)
,@(alist-delete "guile" (package-inputs haunt))))))
-(packages->manifest
- (append
- ;; Guile needs to be compatible
- (list
- guix
- the-good-guile
- haunt-the-ghost)
+(define locales
+ (locale-directory
+ (call-with-input-file "po/LINGUAS"
+ (lambda (port)
+ (let loop ((line (read-line port))
+ (locales '()))
+ (if (eof-object? line)
+ locales
+ (if (equal? (string-ref line 0) #\#)
+ (loop (read-line port) locales)
+ (loop (read-line port)
+ (cons
+ (locale-definition
+ (name (string-append line ".utf8"))
+ (source line))
+ locales)))))))
+ #:libcs
+ (list glibc)))
- ;; Other packages
- (map specification->package
- (list
- "glibc-locales"
- "git"
- "guile-syntax-highlight"))))
+(manifest
+ (cons
+ (manifest-entry
+ (name "locales")
+ (version "0")
+ (item locales))
+ (manifest-entries
+ (packages->manifest
+ (append
+ ;; Guile needs to be compatible
+ (list
+ guix
+ the-good-guile
+ haunt-the-ghost)
+
+ ;; Other packages
+ (map specification->package
+ (list
+ "git"
+ "guile-syntax-highlight")))))))
--
2.31.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: website: Building fails because of missing locales
2021-04-06 20:20 ` Julien Lepiller
@ 2021-04-07 2:20 ` Luis Felipe
2021-04-07 11:09 ` Julien Lepiller
0 siblings, 1 reply; 14+ messages in thread
From: Luis Felipe @ 2021-04-07 2:20 UTC (permalink / raw)
To: Julien Lepiller; +Cc: Leo Famulari, guix-devel
On Tuesday, April 6, 2021 8:20 PM, Julien Lepiller <julien@lepiller.eu> wrote:
> Le Tue, 6 Apr 2021 14:11:03 -0400,
> Leo Famulari leo@famulari.name a écrit :
>
> > On Tue, Apr 06, 2021 at 03:59:20PM +0000, Luis Felipe wrote:
> >
> > > Hello,
> > > I updated my local copy of guix-artwork repository today and now
> > > running "haunt build" fails with this message:
[...]
> > This happens for me too.
>
> Attached is a patch to the manifest.scm that should fix the issue: it
> ensures that you enter an environment where the locales corresponding
> to po/LINGUAS are available. Can you check if it fixes your issues?
Leo, Julien, thanks for checking.
Julien, unfortunately I get the same error after applying the patch:
★★★★★★★★★★★★★★★★★★★★
LANG=C GUIX_WEB_SITE_LOCAL=yes guix environment -C -m manifest.scm -E GUIX_LOCPATH -E LANG --share=$HOME/.guix-profile/lib/locales -E GUIX_WEB_SITE_LOCAL --share=/tmp -- haunt build
Backtrace:
In ice-9/threads.scm:
390:8 19 (_ _)
In ice-9/boot-9.scm:
3223:13 18 (_)
In ice-9/threads.scm:
390:8 17 (_ _)
In ice-9/boot-9.scm:
3507:20 16 (_)
2806:4 15 (save-module-excursion _)
3527:26 14 (_)
In unknown file:
13 (primitive-load-path "apps/base/data" #<procedure 7f821?>)
In ice-9/eval.scm:
626:19 12 (_ #<directory (apps base data) 7f8213f1e640>)
173:55 11 (_ #<directory (apps base data) 7f8213f1e640>)
174:20 10 (_ #<directory (apps base data) 7f8213f1e640>)
177:32 9 (lp (#<procedure 7f8212d3c000 at ice-9/eval.scm:297:?> ?))
159:9 8 (_ #(#<directory (apps base data) 7f8213f1e640> (G_ ?) ?))
159:9 7 (_ #(#<directory (apps base data) 7f8213f1e640> (G_ ?) ?))
159:9 6 (_ #(#<directory (apps base data) 7f8213f1e640> (G_ ?) ?))
163:9 5 (_ #(#<directory (apps base data) 7f8213f1e640> (G_ ?) ?))
In srfi/srfi-1.scm:
586:29 4 (map1 ("de_DE" "en_US" "eo" "es_ES" "fr_FR" "ko_KR" # #))
586:29 3 (map1 ("en_US" "eo" "es_ES" "fr_FR" "ko_KR" "ru_RU" "?"))
586:17 2 (map1 ("eo" "es_ES" "fr_FR" "ko_KR" "ru_RU" "zh_CN"))
In ice-9/eval.scm:
619:8 1 (_ #(#(#<directory (apps base data) 7f8213f1e640> # ?) ?))
In unknown file:
0 (setlocale 6 "eo.utf8")
ERROR: In procedure setlocale:
In procedure setlocale: Invalid argument
★★★★★★★★★★★★★★★★★★★★
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: website: Building fails because of missing locales
2021-04-07 2:20 ` Luis Felipe
@ 2021-04-07 11:09 ` Julien Lepiller
2021-04-07 13:48 ` Luis Felipe
0 siblings, 1 reply; 14+ messages in thread
From: Julien Lepiller @ 2021-04-07 11:09 UTC (permalink / raw)
To: Luis Felipe; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 2673 bytes --]
Ah, don't pass -E GUIX_LOCPATH, I think it prevents guix from setting it properly in the environment.
Le 6 avril 2021 22:20:32 GMT-04:00, Luis Felipe <luis.felipe.la@protonmail.com> a écrit :
>On Tuesday, April 6, 2021 8:20 PM, Julien Lepiller <julien@lepiller.eu>
>wrote:
>
>> Le Tue, 6 Apr 2021 14:11:03 -0400,
>> Leo Famulari leo@famulari.name a écrit :
>>
>> > On Tue, Apr 06, 2021 at 03:59:20PM +0000, Luis Felipe wrote:
>> >
>> > > Hello,
>> > > I updated my local copy of guix-artwork repository today and now
>> > > running "haunt build" fails with this message:
>
>[...]
>
>> > This happens for me too.
>>
>> Attached is a patch to the manifest.scm that should fix the issue: it
>> ensures that you enter an environment where the locales corresponding
>> to po/LINGUAS are available. Can you check if it fixes your issues?
>
>Leo, Julien, thanks for checking.
>
>Julien, unfortunately I get the same error after applying the patch:
>
>★★★★★★★★★★★★★★★★★★★★
>LANG=C GUIX_WEB_SITE_LOCAL=yes guix environment -C -m manifest.scm -E
>GUIX_LOCPATH -E LANG --share=$HOME/.guix-profile/lib/locales -E
>GUIX_WEB_SITE_LOCAL --share=/tmp -- haunt build
>Backtrace:
>In ice-9/threads.scm:
> 390:8 19 (_ _)
>In ice-9/boot-9.scm:
> 3223:13 18 (_)
>In ice-9/threads.scm:
> 390:8 17 (_ _)
>In ice-9/boot-9.scm:
> 3507:20 16 (_)
> 2806:4 15 (save-module-excursion _)
> 3527:26 14 (_)
>In unknown file:
> 13 (primitive-load-path "apps/base/data" #<procedure 7f821?>)
>In ice-9/eval.scm:
> 626:19 12 (_ #<directory (apps base data) 7f8213f1e640>)
> 173:55 11 (_ #<directory (apps base data) 7f8213f1e640>)
> 174:20 10 (_ #<directory (apps base data) 7f8213f1e640>)
> 177:32 9 (lp (#<procedure 7f8212d3c000 at ice-9/eval.scm:297:?> ?))
> 159:9 8 (_ #(#<directory (apps base data) 7f8213f1e640> (G_ ?) ?))
> 159:9 7 (_ #(#<directory (apps base data) 7f8213f1e640> (G_ ?) ?))
> 159:9 6 (_ #(#<directory (apps base data) 7f8213f1e640> (G_ ?) ?))
> 163:9 5 (_ #(#<directory (apps base data) 7f8213f1e640> (G_ ?) ?))
>In srfi/srfi-1.scm:
> 586:29 4 (map1 ("de_DE" "en_US" "eo" "es_ES" "fr_FR" "ko_KR" # #))
> 586:29 3 (map1 ("en_US" "eo" "es_ES" "fr_FR" "ko_KR" "ru_RU" "?"))
> 586:17 2 (map1 ("eo" "es_ES" "fr_FR" "ko_KR" "ru_RU" "zh_CN"))
>In ice-9/eval.scm:
> 619:8 1 (_ #(#(#<directory (apps base data) 7f8213f1e640> # ?) ?))
>In unknown file:
> 0 (setlocale 6 "eo.utf8")
>
>ERROR: In procedure setlocale:
>In procedure setlocale: Invalid argument
>★★★★★★★★★★★★★★★★★★★★
[-- Attachment #2: Type: text/html, Size: 3660 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: website: Building fails because of missing locales
2021-04-07 11:09 ` Julien Lepiller
@ 2021-04-07 13:48 ` Luis Felipe
2021-04-07 15:10 ` Julien Lepiller
0 siblings, 1 reply; 14+ messages in thread
From: Luis Felipe @ 2021-04-07 13:48 UTC (permalink / raw)
To: Julien Lepiller; +Cc: Leo Famulari, guix-devel
On Wednesday, April 7, 2021 11:09 AM, Julien Lepiller <julien@lepiller.eu> wrote:
> Ah, don't pass -E GUIX_LOCPATH, I think it prevents guix from setting it properly in the environment.
It fails a bit differently now; it errors trying to set locale "de_DE.utf8":
★★★★★★★★★★★★★★★★★★★★
$ LANG=C GUIX_WEB_SITE_LOCAL=yes guix environment -C -m manifest.scm -E LANG --share=$HOME/.guix-profile/lib/locales -E GUIX_WEB_SITE_LOCAL --share=/tmp -- haunt build
Backtrace:
In ice-9/boot-9.scm:
222:17 19 (map1 (((apps base data)) ((apps base templates #)) # ?))
3297:17 18 (resolve-interface (apps base data) #:select _ #:hide _ ?)
In ice-9/threads.scm:
390:8 17 (_ _)
In ice-9/boot-9.scm:
3223:13 16 (_)
In ice-9/threads.scm:
390:8 15 (_ _)
In ice-9/boot-9.scm:
3507:20 14 (_)
2806:4 13 (save-module-excursion _)
3527:26 12 (_)
In unknown file:
11 (primitive-load-path "apps/base/data" #<procedure 7fa7e?>)
In ice-9/eval.scm:
626:19 10 (_ #<directory (apps base data) 7fa7e11b8640>)
173:55 9 (_ #<directory (apps base data) 7fa7e11b8640>)
174:20 8 (_ #<directory (apps base data) 7fa7e11b8640>)
177:32 7 (lp (#<procedure 7fa7dfe83420 at ice-9/eval.scm:297:?> ?))
159:9 6 (_ #(#<directory (apps base data) 7fa7e11b8640> (G_ ?) ?))
159:9 5 (_ #(#<directory (apps base data) 7fa7e11b8640> (G_ ?) ?))
159:9 4 (_ #(#<directory (apps base data) 7fa7e11b8640> (G_ ?) ?))
163:9 3 (_ #(#<directory (apps base data) 7fa7e11b8640> (G_ ?) ?))
In srfi/srfi-1.scm:
586:17 2 (map1 ("de_DE" "en_US" "eo" "es_ES" "fr_FR" "ko_KR" # #))
In ice-9/eval.scm:
619:8 1 (_ #(#(#<directory (apps base data) 7fa7e11b8640> # ?) ?))
In unknown file:
0 (setlocale 6 "de_DE.utf8")
ERROR: In procedure setlocale:
In procedure setlocale: Invalid argument
★★★★★★★★★★★★★★★★★★★★
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: website: Building fails because of missing locales
2021-04-07 13:48 ` Luis Felipe
@ 2021-04-07 15:10 ` Julien Lepiller
2021-04-07 16:27 ` Luis Felipe
0 siblings, 1 reply; 14+ messages in thread
From: Julien Lepiller @ 2021-04-07 15:10 UTC (permalink / raw)
To: Luis Felipe; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 2141 bytes --]
Weird, is GUIX_LOCPATH not set at all maybe?
Le 7 avril 2021 09:48:02 GMT-04:00, Luis Felipe <luis.felipe.la@protonmail.com> a écrit :
>On Wednesday, April 7, 2021 11:09 AM, Julien Lepiller
><julien@lepiller.eu> wrote:
>
>> Ah, don't pass -E GUIX_LOCPATH, I think it prevents guix from setting
>it properly in the environment.
>
>It fails a bit differently now; it errors trying to set locale
>"de_DE.utf8":
>
>★★★★★★★★★★★★★★★★★★★★
>$ LANG=C GUIX_WEB_SITE_LOCAL=yes guix environment -C -m manifest.scm -E
>LANG --share=$HOME/.guix-profile/lib/locales -E GUIX_WEB_SITE_LOCAL
>--share=/tmp -- haunt build
>Backtrace:
>In ice-9/boot-9.scm:
> 222:17 19 (map1 (((apps base data)) ((apps base templates #)) # ?))
> 3297:17 18 (resolve-interface (apps base data) #:select _ #:hide _ ?)
>In ice-9/threads.scm:
> 390:8 17 (_ _)
>In ice-9/boot-9.scm:
> 3223:13 16 (_)
>In ice-9/threads.scm:
> 390:8 15 (_ _)
>In ice-9/boot-9.scm:
> 3507:20 14 (_)
> 2806:4 13 (save-module-excursion _)
> 3527:26 12 (_)
>In unknown file:
> 11 (primitive-load-path "apps/base/data" #<procedure 7fa7e?>)
>In ice-9/eval.scm:
> 626:19 10 (_ #<directory (apps base data) 7fa7e11b8640>)
> 173:55 9 (_ #<directory (apps base data) 7fa7e11b8640>)
> 174:20 8 (_ #<directory (apps base data) 7fa7e11b8640>)
> 177:32 7 (lp (#<procedure 7fa7dfe83420 at ice-9/eval.scm:297:?> ?))
> 159:9 6 (_ #(#<directory (apps base data) 7fa7e11b8640> (G_ ?) ?))
> 159:9 5 (_ #(#<directory (apps base data) 7fa7e11b8640> (G_ ?) ?))
> 159:9 4 (_ #(#<directory (apps base data) 7fa7e11b8640> (G_ ?) ?))
> 163:9 3 (_ #(#<directory (apps base data) 7fa7e11b8640> (G_ ?) ?))
>In srfi/srfi-1.scm:
> 586:17 2 (map1 ("de_DE" "en_US" "eo" "es_ES" "fr_FR" "ko_KR" # #))
>In ice-9/eval.scm:
> 619:8 1 (_ #(#(#<directory (apps base data) 7fa7e11b8640> # ?) ?))
>In unknown file:
> 0 (setlocale 6 "de_DE.utf8")
>
>ERROR: In procedure setlocale:
>In procedure setlocale: Invalid argument
>★★★★★★★★★★★★★★★★★★★★
[-- Attachment #2: Type: text/html, Size: 2617 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: website: Building fails because of missing locales
2021-04-07 15:10 ` Julien Lepiller
@ 2021-04-07 16:27 ` Luis Felipe
2021-04-07 17:13 ` Julien Lepiller
0 siblings, 1 reply; 14+ messages in thread
From: Luis Felipe @ 2021-04-07 16:27 UTC (permalink / raw)
To: Julien Lepiller; +Cc: Leo Famulari, guix-devel
[-- Attachment #1: Type: text/plain, Size: 895 bytes --]
On Wednesday, April 7, 2021 3:10 PM, Julien Lepiller <julien@lepiller.eu> wrote:
> Weird, is GUIX_LOCPATH not set at all maybe?
I have this:
★★★★★★★★★★★★★★★★★★★★
$ echo $GUIX_LOCPATH
/run/current-system/locale
$ tree /run/current-system/locale
/run/current-system/locale
├── 2.29 -> /gnu/store/dlf4a3zrx0rrb38v3w42317fbd2p4dnb-locale-2.29/2.29
└── 2.31 -> /gnu/store/xlzv58dyh7nw8gv1w33byhx8f19aqivk-locale-2.31/2.31
2 directories, 0 files
★★★★★★★★★★★★★★★★★★★★
For what it's worth, using the packages from my user profile, I can setlocale from a Guile REPL to "de_DE.utf8" and it works. I also tried it on my website, which is internationalized and localized, made it build pages in that same locale, and it works too (although it doesn't use Haunt nor Guix i18n mechanism, but it is Guile Scheme).
[-- Attachment #2: Type: text/html, Size: 1154 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: website: Building fails because of missing locales
2021-04-07 16:27 ` Luis Felipe
@ 2021-04-07 17:13 ` Julien Lepiller
2021-04-07 17:22 ` Julien Lepiller
2021-04-10 11:00 ` Julien Lepiller
0 siblings, 2 replies; 14+ messages in thread
From: Julien Lepiller @ 2021-04-07 17:13 UTC (permalink / raw)
To: Luis Felipe; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 1368 bytes --]
What I intended with the patch was to provide those locales in the environment, so you'd set GUIX_LOCPATH=$GUIX_PROFILE/lib/locale (and I thought guix would do it itself). Now I noticed it did not work as expected: it creates the directory directly under the profile instead of under lib/locale. Give me a moment to send a v2.
Le 7 avril 2021 12:27:07 GMT-04:00, Luis Felipe <luis.felipe.la@protonmail.com> a écrit :
>On Wednesday, April 7, 2021 3:10 PM, Julien Lepiller
><julien@lepiller.eu> wrote:
>
>> Weird, is GUIX_LOCPATH not set at all maybe?
>
>I have this:
>
>★★★★★★★★★★★★★★★★★★★★
>$ echo $GUIX_LOCPATH
>/run/current-system/locale
>$ tree /run/current-system/locale
>/run/current-system/locale
>├── 2.29 ->
>/gnu/store/dlf4a3zrx0rrb38v3w42317fbd2p4dnb-locale-2.29/2.29
>└── 2.31 ->
>/gnu/store/xlzv58dyh7nw8gv1w33byhx8f19aqivk-locale-2.31/2.31
>
>2 directories, 0 files
>★★★★★★★★★★★★★★★★★★★★
>
>For what it's worth, using the packages from my user profile, I can
>setlocale from a Guile REPL to "de_DE.utf8" and it works. I also tried
>it on my website, which is internationalized and localized, made it
>build pages in that same locale, and it works too (although it doesn't
>use Haunt nor Guix i18n mechanism, but it is Guile Scheme).
[-- Attachment #2: Type: text/html, Size: 1798 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: website: Building fails because of missing locales
2021-04-07 17:13 ` Julien Lepiller
@ 2021-04-07 17:22 ` Julien Lepiller
2021-04-07 18:11 ` Luis Felipe
2021-04-10 11:00 ` Julien Lepiller
1 sibling, 1 reply; 14+ messages in thread
From: Julien Lepiller @ 2021-04-07 17:22 UTC (permalink / raw)
To: Luis Felipe; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 124 bytes --]
Here's v2.
I checked that it sets GUIX_LOCPATH properly on my system (I had to add
the path specification for it to work).
[-- Attachment #2: 0001-website-Add-locales-in-manifest.patch --]
[-- Type: text/x-patch, Size: 2783 bytes --]
From 70aa3b969e1830bce9e44b8dda0a97fcb27cce89 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Tue, 6 Apr 2021 22:16:43 +0200
Subject: [PATCH] website: Add locales in manifest.
* website/manifest.scm: Add locale definition for all our translations.
---
website/manifest.scm | 62 ++++++++++++++++++++++++++++++++++----------
1 file changed, 49 insertions(+), 13 deletions(-)
diff --git a/website/manifest.scm b/website/manifest.scm
index eda382a..6beb78e 100644
--- a/website/manifest.scm
+++ b/website/manifest.scm
@@ -1,6 +1,8 @@
(use-modules (guix packages)
((gnu packages package-management) #:select (guix))
((gnu packages guile-xyz) #:select (haunt))
+ (gnu system locale)
+ (ice-9 rdelim)
(srfi srfi-1))
(define the-good-guile
@@ -14,17 +16,51 @@
`(("guile" ,the-good-guile)
,@(alist-delete "guile" (package-inputs haunt))))))
-(packages->manifest
- (append
- ;; Guile needs to be compatible
- (list
- guix
- the-good-guile
- haunt-the-ghost)
+(define locales
+ (locale-directory
+ (call-with-input-file "po/LINGUAS"
+ (lambda (port)
+ (let loop ((line (read-line port))
+ (locales '()))
+ (if (eof-object? line)
+ locales
+ (if (equal? (string-ref line 0) #\#)
+ (loop (read-line port) locales)
+ (loop (read-line port)
+ (cons
+ (locale-definition
+ (name (string-append line ".utf8"))
+ (source line))
+ locales)))))))
+ #:libcs
+ (list glibc)))
- ;; Other packages
- (map specification->package
- (list
- "glibc-locales"
- "git"
- "guile-syntax-highlight"))))
+(manifest
+ (cons
+ (manifest-entry
+ (name "locales")
+ (version "0")
+ (item (computed-file "locales"
+ (with-imported-modules '((guix build utils))
+ #~(let ((out (string-append #$output "/lib/locale")))
+ (use-modules (guix build utils))
+ (mkdir-p out)
+ (copy-recursively #$locales out)))))
+ (search-paths
+ (list (search-path-specification
+ (variable "GUIX_LOCPATH")
+ (files '("lib/locale"))))))
+ (manifest-entries
+ (packages->manifest
+ (append
+ ;; Guile needs to be compatible
+ (list
+ guix
+ the-good-guile
+ haunt-the-ghost)
+
+ ;; Other packages
+ (map specification->package
+ (list
+ "git"
+ "guile-syntax-highlight")))))))
--
2.31.0
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: website: Building fails because of missing locales
2021-04-07 17:22 ` Julien Lepiller
@ 2021-04-07 18:11 ` Luis Felipe
2021-04-08 20:04 ` Luis Felipe
0 siblings, 1 reply; 14+ messages in thread
From: Luis Felipe @ 2021-04-07 18:11 UTC (permalink / raw)
To: Julien Lepiller; +Cc: guix-devel
On Wednesday, April 7, 2021 5:22 PM, Julien Lepiller <julien@lepiller.eu> wrote:
> Here's v2.
>
> I checked that it sets GUIX_LOCPATH properly on my system (I had to add
> the path specification for it to work).
Thanks, Julien, with this new patch, the website builds. But I noticed other problems now:
1. It does not run (haunt serve fails).
2. Running it with "python3 -m http.server" instead, I see many characters replaced by "?" marks.
I'm using the commands from the website's README, but omitting "-E GUIX_LOCPATH" and changing "lib/locale" to "lib/locales" because the former does not exist.
So this is the command I ran to build:
★★★★★★★★★★★★★★★★★★★★
$ LANG=C GUIX_WEB_SITE_LOCAL=yes guix environment -C -m manifest.scm -E LANG --share=$HOME/.guix-profile/lib/locales -E GUIX_WEB_SITE_LOCAL --share=/tmp -- haunt build
★★★★★★★★★★★★★★★★★★★★
And this one for serving:
★★★★★★★★★★★★★★★★★★★★
$ guix environment -CN -m manifest.scm -E LANG --share=$HOME/.guix-profile/lib/locales --share=/tmp -- haunt serve
guile: warning: failed to install locale
Backtrace:
2 (primitive-load "/gnu/store/k3650bnqc741650cg36nv2wan82?")
In haunt/ui.scm:
130:2 1 (haunt-main _ "serve")
In unknown file:
0 (setlocale 6 "")
ERROR: In procedure setlocale:
In procedure setlocale: Invalid argument
★★★★★★★★★★★★★★★★★★★★
Am I doing something wrong?
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: website: Building fails because of missing locales
2021-04-07 18:11 ` Luis Felipe
@ 2021-04-08 20:04 ` Luis Felipe
0 siblings, 0 replies; 14+ messages in thread
From: Luis Felipe @ 2021-04-08 20:04 UTC (permalink / raw)
To: Luis Felipe; +Cc: Julien Lepiller, guix-devel
Hi,
On Wednesday, April 7, 2021 6:11 PM, Luis Felipe <luis.felipe.la@protonmail.com> wrote:
> On Wednesday, April 7, 2021 5:22 PM, Julien Lepiller julien@lepiller.eu wrote:
>
> > Here's v2.
> > I checked that it sets GUIX_LOCPATH properly on my system (I had to add
> > the path specification for it to work).
>
> Thanks, Julien, with this new patch, the website builds. But I noticed other problems now:
>
> 1. It does not run (haunt serve fails).
> 2. Running it with "python3 -m http.server" instead, I see many characters replaced by "?" marks.
>
> I'm using the commands from the website's README, but omitting "-E GUIX_LOCPATH" and changing "lib/locale" to "lib/locales" because the former does not exist.
I managed to build and serve without problems (apparently) passing Julien's manifest to a script I use to manage Guix profiles for project development, instead of using the commands in the README.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: website: Building fails because of missing locales
2021-04-07 17:13 ` Julien Lepiller
2021-04-07 17:22 ` Julien Lepiller
@ 2021-04-10 11:00 ` Julien Lepiller
1 sibling, 0 replies; 14+ messages in thread
From: Julien Lepiller @ 2021-04-10 11:00 UTC (permalink / raw)
To: Luis Felipe; +Cc: guix-devel
Le Wed, 07 Apr 2021 13:13:13 -0400,
Julien Lepiller <julien@lepiller.eu> a écrit :
> What I intended with the patch was to provide those locales in the
> environment, so you'd set GUIX_LOCPATH=$GUIX_PROFILE/lib/locale (and
> I thought guix would do it itself). Now I noticed it did not work as
> expected: it creates the directory directly under the profile instead
> of under lib/locale. Give me a moment to send a v2.
>
> Le 7 avril 2021 12:27:07 GMT-04:00, Luis Felipe
> <luis.felipe.la@protonmail.com> a écrit :
> >On Wednesday, April 7, 2021 3:10 PM, Julien Lepiller
> ><julien@lepiller.eu> wrote:
> >
> >> Weird, is GUIX_LOCPATH not set at all maybe?
> >
> >I have this:
> >
> >★★★★★★★★★★★★★★★★★★★★
> >$ echo $GUIX_LOCPATH
> >/run/current-system/locale
> >$ tree /run/current-system/locale
> >/run/current-system/locale
> >├── 2.29 ->
> >/gnu/store/dlf4a3zrx0rrb38v3w42317fbd2p4dnb-locale-2.29/2.29
> >└── 2.31 ->
> >/gnu/store/xlzv58dyh7nw8gv1w33byhx8f19aqivk-locale-2.31/2.31
> >
> >2 directories, 0 files
> >★★★★★★★★★★★★★★★★★★★★
> >
> >For what it's worth, using the packages from my user profile, I can
> >setlocale from a Guile REPL to "de_DE.utf8" and it works. I also
> >tried it on my website, which is internationalized and localized,
> >made it build pages in that same locale, and it works too (although
> >it doesn't use Haunt nor Guix i18n mechanism, but it is Guile
> >Scheme).
Since you reported success, I pushed my patch to the website. Let's see
what we need to change in the README for it to work properly.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: website: Building fails because of missing locales
2021-04-06 15:59 website: Building fails because of missing locales Luis Felipe
2021-04-06 18:11 ` Leo Famulari
@ 2021-04-06 18:14 ` Julien Lepiller
1 sibling, 0 replies; 14+ messages in thread
From: Julien Lepiller @ 2021-04-06 18:14 UTC (permalink / raw)
To: Luis Felipe, guix-devel
[-- Attachment #1: Type: text/plain, Size: 3503 bytes --]
Oops, I happen to have an esperanto locale on my system, and berlin probably has one too. That would explain why I was able to build the website, and why the website is updated.
This is how I defined that locale: https://git.lepiller.eu/system-configuration/tree/-/modules/config/os.scm#L117
Weirdly, glibc-locales provides "eo" but not "eo.utf8"
Le 6 avril 2021 11:59:20 GMT-04:00, Luis Felipe <luis.felipe.la@protonmail.com> a écrit :
>Hello,
>
>I updated my local copy of guix-artwork repository today and now
>running "haunt build" fails with this message:
>
>★★★★★★★★★★★★★★★★★★★★
>Backtrace:
>In ice-9/threads.scm:
> 390:8 19 (_ _)
>In ice-9/boot-9.scm:
> 3223:13 18 (_)
>In ice-9/threads.scm:
> 390:8 17 (_ _)
>In ice-9/boot-9.scm:
> 3507:20 16 (_)
> 2806:4 15 (save-module-excursion _)
> 3527:26 14 (_)
>In unknown file:
> 13 (primitive-load-path "apps/base/data" #<procedure 7fd2e…>)
>In ice-9/eval.scm:
> 626:19 12 (_ #<directory (apps base data) 7fd2ec67e640>)
> 173:55 11 (_ #<directory (apps base data) 7fd2ec67e640>)
> 174:20 10 (_ #<directory (apps base data) 7fd2ec67e640>)
> 177:32 9 (lp (#<procedure 7fd2eaff9b40 at ice-9/eval.scm:297:…> …))
> 159:9 8 (_ #(#<directory (apps base data) 7fd2ec67e640> (G_ …) …))
> 159:9 7 (_ #(#<directory (apps base data) 7fd2ec67e640> (G_ …) …))
> 159:9 6 (_ #(#<directory (apps base data) 7fd2ec67e640> (G_ …) …))
> 163:9 5 (_ #(#<directory (apps base data) 7fd2ec67e640> (G_ …) …))
>In srfi/srfi-1.scm:
> 586:29 4 (map1 ("de_DE" "en_US" "eo" "es_ES" "fr_FR" "ko_KR" # #))
> 586:29 3 (map1 ("en_US" "eo" "es_ES" "fr_FR" "ko_KR" "ru_RU" "…"))
> 586:17 2 (map1 ("eo" "es_ES" "fr_FR" "ko_KR" "ru_RU" "zh_CN"))
>In ice-9/eval.scm:
> 619:8 1 (_ #(#(#<directory (apps base data) 7fd2ec67e640> # …) …))
>In unknown file:
> 0 (setlocale 6 "eo.utf8")
>
>ERROR: In procedure setlocale:
>In procedure setlocale: Argumento inválido
>★★★★★★★★★★★★★★★★★★★★
>
>I see in the commit log that there's a new commit adding Esperanto to
>the website translations, but I was surprised to see this error because
>the website manifest.scm includes "glibc-locales" and I thought it
>would provide "eo.utf8" locale, but, apparently, it doesn't (see
>"locale -a" output below).
>
>Also, if I understand correctly, the package description for
>"glibc-locales" says it provides more than 400 locales, but once
>installed, I see less than 40:
>
>★★★★★★★★★★★★★★★★★★★★
>$ locale -a
>C
>ca_ES.utf8
>cs_CZ.utf8
>da_DK.utf8
>de_DE.utf8
>el_GR.utf8
>en_AU.utf8
>en_CA.utf8
>en_GB.utf8
>en_US.utf8
>en_US.UTF-8
>es_AR.utf8
>es_CL.utf8
>es_CO.utf8
>es_ES.utf8
>es_MX.utf8
>fi_FI.utf8
>fr_BE.utf8
>fr_CA.utf8
>fr_CH.utf8
>fr_FR.utf8
>ga_IE.utf8
>it_IT.utf8
>ja_JP.utf8
>ko_KR.utf8
>nb_NO.utf8
>nl_NL.utf8
>pl_PL.utf8
>POSIX
>pt_PT.utf8
>ro_RO.utf8
>ru_RU.utf8
>sv_SE.utf8
>tr_TR.utf8
>uk_UA.utf8
>vi_VN.utf8
>zh_CN.utf8
>★★★★★★★★★★★★★★★★★★★★
>
>I'm not sure what to do here. Maybe the use of "setlocale" should be
>guarded against missing locales, but I'm also confused about the 400
>locales part, where's the rest?
>
>(I'm using Guix System 1148890)
>
>
>---
>Luis Felipe López Acevedo
>https://luis-felipe.gitlab.io/
[-- Attachment #2: Type: text/html, Size: 4021 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2021-04-10 11:01 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-06 15:59 website: Building fails because of missing locales Luis Felipe
2021-04-06 18:11 ` Leo Famulari
2021-04-06 20:20 ` Julien Lepiller
2021-04-07 2:20 ` Luis Felipe
2021-04-07 11:09 ` Julien Lepiller
2021-04-07 13:48 ` Luis Felipe
2021-04-07 15:10 ` Julien Lepiller
2021-04-07 16:27 ` Luis Felipe
2021-04-07 17:13 ` Julien Lepiller
2021-04-07 17:22 ` Julien Lepiller
2021-04-07 18:11 ` Luis Felipe
2021-04-08 20:04 ` Luis Felipe
2021-04-10 11:00 ` Julien Lepiller
2021-04-06 18:14 ` Julien Lepiller
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.