Subject: Re: bug#51259: Cannot build Guix from source (error messages about the translations)

From: Julien Lepiller <[email-masked]>
Date: Wed, 20 Oct 2021 14:11:38 +0200

Le Wed, 20 Oct 2021 12:40:17 +0200,
Raphaël Mélotte <[email-masked]> a écrit :

> Hello,
> 
> On 10/20/21 4:06 AM, Julien Lepiller wrote:
> 
> > 
> > Since it seems this is due to the lack of the LC_ALL variable in the
> > pure environment, how about the attached patch?  
> 
> With the attached patch on top of master (c650160abb), the build
> fails with messages similar to this one:
> ./doc/guix.de.texi:158: @ref reference to nonexistent node
> `Translating Guix'
> 
> I attached the build logs.
> 
> I used the following to build, to make sure to start from a clean
> tree: ---
> git clean -ffdx && guix environment guix --pure --ad-hoc help2man git
> strace -- sh -c './bootstrap && ./configure --localstatedir=/var &&
> make' | tee build.log
> 
> ---
> 
> Kind regards,
> 
> Raphaël

So, it looks like my change prevented the xref command from running
altogether, which explains the error. Moving the variable definition
seems to help; I was able to build from a clean checkout in a pure
environment with the attached revised patch.
>From 9cf411955afe9d3cb95d8060bb37ce97fdcbacb0 Mon Sep 17 00:00:00 2001
Message-Id: <[email-masked]>
From: Julien Lepiller <[email-masked]>
Date: Wed, 20 Oct 2021 04:02:06 +0200
Subject: [PATCH] doc: Set LC_ALL when translating xref commands.

* doc/local.mk (xref_command): Set LC_ALL.
---
 doc/local.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/local.mk b/doc/local.mk
index fff11f8183..d0cab306a4 100644
--- a/doc/local.mk
+++ b/doc/local.mk
@@ -110,18 +110,18 @@ endef
 $(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contributing.%.texi guix/build/po.go
 	-$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix.texi" -p "$<" -l "$@.tmp"
 	-sed -i "s|guix\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp"
-	-$(AM_V_POXREF)$(xref_command)
+	-$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command)
 	-mv "$@.tmp" "$@"
 
 $(srcdir)/%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po guix/build/po.go
 	-$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix-cookbook.texi" -p "$<" -l "$@.tmp"
 	-sed -i "s|guix-cookbook\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp"
-	-$(AM_V_POXREF)$(xref_command)
+	-$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command)
 	-mv "$@.tmp" "$@"
 
 $(srcdir)/%D%/contributing.%.texi: po/doc/guix-manual.%.po guix/build/po.go
 	-$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/contributing.texi" -p "$<" -l "$@.tmp"
-	-$(AM_V_POXREF)$(xref_command)
+	-$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command)
 	-mv "$@.tmp" "$@"
 
 %D%/os-config-%.texi: gnu/system/examples/%.tmpl
-- 
2.33.0