Bug#963584: Unreleased 1.15 FTBFS

2020-07-13 Thread Osamu Aoki
Hi,


On Mon, 2020-07-13 at 15:40 +0900, Osamu Aoki wrote:
> Hi,
> 
> On Mon, 2020-07-13 at 14:12 +0900, Osamu Aoki wrote:
> > Hi,
> > 
> > While working on Unreleased 1.15, I saw a bug preventing build
> > process
> > under test build process.
> > 
> > It fails when running "mktemp" if $TMPDIR doesn't exist in advance,
> > 
> > The following seems to fix it.
> > 
> > @ -114,6 +114,7 @@ pot: $(PO_DIR)/templates.pot
> >  # 
> >  $(PO_DIR)/templates.pot: $(MANUAL).en.x02 .FORCE
> > ( \
> > +   mkdir -p $(TMPDIR) ; \
> > _MY_TEMPFILE=$$(mktemp) ; \
> > $(ITSTOOL) $< -o $${_MY_TEMPFILE} ; \
> > $(MSGCAT) -o $@ $${_MY_TEMPFILE} ; \
> > 
> > But I don't see failure of itstool under "stable" system with
> > backported debhelper.
> 
> This was regression only for test build process.  Normal package
> build
> was not affected.
> 
> > I will check sid situation later.
> 
> It fails under sid.  So this is a regression.
> 
> Anyway this awkward _MY_TEMPFILE hack was introduced for now fixed:
>   https://bugs.debian.org/918953
> 
> Reverting this workaround doesn't help.  
> 
> 
>   File "/usr/bin/itstool", line 1614, in 
> doc.merge_translations(translations, opts.lang,
> strict=opts.strict)
>   File "/usr/bin/itstool", line 1000, in merge_translations
> lcpar = lcpar.parent
>   File "/usr/lib/python3/dist-packages/libxml2.py", line 296, in
> get_parent
> return nodeWrap(ret)
>   File "/usr/lib/python3/dist-packages/libxml2.py", line 580, in
> nodeWrap
> if name[0:8] == "document":
> TypeError: 'NoneType' object is not subscriptable
> 
> ---

I think I understand problem better now.

In stable platform, I see error message but PO application doesn't
bail-out but print out message:

> Warning: Could not merge zh-tw translation for msgid:
> Export the build environment as “ role="strong">LC_ALL=C.UTF-8” (see ).


When I grepped this line in PO:

> #. (itstool) path: listitem/simpara
> #: debmake-doc.en.x02:2744
> msgid ""
> "Export the build environment as “ role=\"strong\">LC_ALL=C.UTF-8 "emphasis>” (see )."
> msgstr ""
> "在构建环境中导出环境变量“LC_ALL=C.UTF-8 "emphasis>”(参见 )。"
> 

Please note this translation has typo for tag "emphasis" -> "emphassi"

Basically itstool needs to handle broken PO file more gracefully with
more informative error message.

Previous error message was not the best shape but better than now.

Osamu



Bug#963584: Unreleased 1.15 FTBFS

2020-07-13 Thread Osamu Aoki
Hi,

On Mon, 2020-07-13 at 14:12 +0900, Osamu Aoki wrote:
> Hi,
> 
> While working on Unreleased 1.15, I saw a bug preventing build
> process
> under test build process.
> 
> It fails when running "mktemp" if $TMPDIR doesn't exist in advance,
> 
> The following seems to fix it.
> 
> @ -114,6 +114,7 @@ pot: $(PO_DIR)/templates.pot
>  # 
>  $(PO_DIR)/templates.pot: $(MANUAL).en.x02 .FORCE
>   ( \
> + mkdir -p $(TMPDIR) ; \
>   _MY_TEMPFILE=$$(mktemp) ; \
>   $(ITSTOOL) $< -o $${_MY_TEMPFILE} ; \
>   $(MSGCAT) -o $@ $${_MY_TEMPFILE} ; \
> 
> But I don't see failure of itstool under "stable" system with
> backported debhelper.

This was regression only for test build process.  Normal package build
was not affected.

> I will check sid situation later.

It fails under sid.  So this is a regression.

Anyway this awkward _MY_TEMPFILE hack was introduced for now fixed:
  https://bugs.debian.org/918953

Reverting this workaround doesn't help.  


  File "/usr/bin/itstool", line 1614, in 
doc.merge_translations(translations, opts.lang, strict=opts.strict)
  File "/usr/bin/itstool", line 1000, in merge_translations
lcpar = lcpar.parent
  File "/usr/lib/python3/dist-packages/libxml2.py", line 296, in
get_parent
return nodeWrap(ret)
  File "/usr/lib/python3/dist-packages/libxml2.py", line 580, in
nodeWrap
if name[0:8] == "document":
TypeError: 'NoneType' object is not subscriptable

---

Considering the latest gettext already has native support of XML and
use of itstool on large complex XML as docbook XML is rare use case, I
may reconsider my tool chain choice.   After all, itstool is a thin
generic wrapper of gettext to support more formats.  Once more projects
migrates to native gettext, I am afraid itstool may be EOLed.
(It was fun to play with itstool, thanks)

Most docbook XML translation projects use po4a for PO file support. 
Reverse generation of PO file for po4a is a non-trivial task but I have
done it before.

So this bug is certainly a regression bug of itstool. But I may close
this bug reported on debmake-doc if I find time to convert the build
tool chain to po4a.

Regards,

Osamu



Bug#963584: Unreleased 1.15 FTBFS

2020-07-12 Thread Osamu Aoki


Hi,

While working on Unreleased 1.15, I saw a bug preventing build process
under test build process.

It fails when running "mktemp" if $TMPDIR doesn't exist in advance,

The following seems to fix it.

@ -114,6 +114,7 @@ pot: $(PO_DIR)/templates.pot
 # 
 $(PO_DIR)/templates.pot: $(MANUAL).en.x02 .FORCE
( \
+   mkdir -p $(TMPDIR) ; \
_MY_TEMPFILE=$$(mktemp) ; \
$(ITSTOOL) $< -o $${_MY_TEMPFILE} ; \
$(MSGCAT) -o $@ $${_MY_TEMPFILE} ; \

But I don't see failure of itstool under "stable" system with
backported debhelper.

I will check sid situation later.

Osamu