After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 623971 - gtkdoc-mkhtml should terminate on errors
gtkdoc-mkhtml should terminate on errors
Status: RESOLVED NOTABUG
Product: gtk-doc
Classification: Platform
Component: general
1.14
Other Linux
: Normal normal
: ---
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on: 624167
Blocks:
 
 
Reported: 2010-07-09 17:39 UTC by Björn Lindqvist
Modified: 2011-03-29 14:32 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Björn Lindqvist 2010-07-09 17:39:43 UTC
gtkdoc-mkhtml may encounter parsing errors in the input xml files:

parser error : Opening and ending tag mismatch: para line 57 and refsect1
...
parser error : Premature end of data in tag refentry line 9
...
element include: XInclude error : could not load /home/bjourne/gtkimageview/build/default/src/xml/gtkanimview.xml, and no fallback was found

These errors are critical and will result in broken gtkdoc documentation with missing pages. gtkdoc-mkhtml should terminate when an error like the above is discovered. It should also return a non-zero exit code.
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2010-07-12 08:39:37 UTC
in gtkdoc-mkhtml we pass the xsltproc return-code up
  @XSLTPROC@ $path_arg --nonet --xinclude \
      --stringparam gtkdoc.bookname $module \
      --stringparam gtkdoc.version "@VERSION@" \
      "$@" $gtkdocdir/gtk-doc.xsl $document || exit $?

and also in gtkdoc.make we don't ignore the return code. Need to check the actual return-value from xsltproc in the above case ...
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2010-07-12 09:01:31 UTC
I found no option in xsltproc to make parser errors fatal :/

gtk-doc/tests/bugs/docs/html$ /usr/bin/xsltproc --path /home/ensonic/projects/gnome/gtk-doc/tests/bugs/docs --nonet --xinclude --stringparam gtkdoc.bookname tester --stringparam gtkdoc.version 1.15.1 /home/ensonic/projects/gnome/gtk-doc/gtk-doc.xsl ../tester-docs.xml; echo $?

../xml/tester.xml:591: parser error : Opening and ending tag mismatch: para line 578 and refsect2
</variablelist></refsect2>
                          ^
../xml/tester.xml:593: parser error : Opening and ending tag mismatch: refsect2 line 574 and refsect1
</refsect1>
           ^
../xml/tester.xml:595: parser error : Opening and ending tag mismatch: refsect1 line 90 and refentry
</refentry>
           ^
../xml/tester.xml:596: parser error : Premature end of data in tag refentry line 7

^
../tester-docs.xml:19: element include: XInclude error : could not load ../xml/tester.xml, and no fallback was found
Computing chunks...
Element include in namespace 'http://www.w3.org/2003/XInclude' encountered in chapter, but no template matches.
Writing ch01.html for chapter
Writing api-index.html for index(api-index)
Writing deprecated-api-index.html for index(deprecated-api-index)
Writing index.html for book(index)
Writing index.sgml for book(index)
Writing tester.devhelp for book(index)
Writing tester.devhelp2 for book(index)
0


It could be 'fixed' by running
xmllint --noout --xinclude ../tester-docs.xml; echo $?
after gtkdoc-mkdb but that would cause even more slowdown. I'd prefer to have this fixed in xsltproc (extra option).

Björn, any opinion? Move as a feature request to libxslt?
Comment 3 Björn Lindqvist 2010-07-12 12:44:27 UTC
I think the return code issue more important than getting xsltproc to halt correctly. But for me, it returns zero even on parse errors:

$ /usr/bin/xsltproc --nonet --xinclude --stringparam gtkdoc.bookname gtkimageview --stringparam gtkdoc.version 1.14 /usr/share/gtk-doc/data/gtk-doc.xsl /home/bjourne/gtkimageview/build/default/src/gtkimageview.sgml
parser error : Opening and ending tag mismatch: para line 65 and refsect1
...
$ echo $?
0

So I guess everything is xsltproc's fault. :) Though I definitely wouldn't mind an option to run xmllint and catch these errors. I'd use it.
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2010-07-12 13:07:52 UTC
That's what I meant. xmllint would error out correctly. xsltproc does not. I filed a bug for libxslt.
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2011-03-29 14:32:40 UTC
xsltproc does actually now error out. See dependent bug. Closing this one.