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 749142 - Can't build totem-pl-parser from master using gtk-doc 1.22
Can't build totem-pl-parser from master using gtk-doc 1.22
Status: RESOLVED FIXED
Product: gtk-doc
Classification: Platform
Component: general
unspecified
Other Linux
: Normal critical
: 1.23
Assigned To: gtk-doc maintainers
gtk-doc maintainers
: 749268 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-05-08 22:52 UTC by Marcin Banasiak
Modified: 2015-05-15 10:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Marcin Banasiak 2015-05-08 22:52:47 UTC
After update to 1.22 i can't build totem-pl-parser from git master. It fails with:

../xml/totem-pl-parser.xml:179: parser error : Opening and ending tag mismatch: programlisting line 175 and para
_connect (G_OBJECT (pl), "entry-parsed", G_CALLBACK (entry_parsed), NULL);</para
                                                                               ^
../xml/totem-pl-parser.xml:191: parser error : Opening and ending tag mismatch: para line 182 and programlisting
 </programlisting>
                  ^
../xml/totem-pl-parser.xml:214: parser error : Opening and ending tag mismatch: programlisting line 209 and para
	GFile *file;</para>
	                   ^
../xml/totem-pl-parser.xml:235: parser error : Opening and ending tag mismatch: para line 231 and programlisting
 </programlisting>
                  ^
../totem-pl-parser-docs.xml:18: element include: XInclude error : could not load ../xml/totem-pl-parser.xml, and no fallback was found
../totem-pl-parser-docs.xml:7: element indexdiv: validity error : ID api-index-full already defined
../totem-pl-parser-docs.xml:7: element indexdiv: validity error : ID api-index-deprecated already defined
../totem-pl-parser-docs.xml:8: element glossary: validity error : ID annotation-glossary already defined


As I can see totem-pl-parser.xml is generated incorrectly. Here is a snippet:

    173 <para><example>
    174  <title>Reading a Playlist Asynchronously</title>
    175  <programlisting>
    176 TotemPlParser *pl = <link linkend="totem-pl-parser-new"><function>totem_pl_parser_new()</function></link>;
    177 g_object_set (pl, "recurse", FALSE, "disable-unsafe", TRUE, NULL);
    178 g_signal_connect (G_OBJECT (pl), "playlist-started", G_CALLBACK (playlist_started), NULL);
    179 g_signal_connect (G_OBJECT (pl), "entry-parsed", G_CALLBACK (entry_parsed), NULL);</para>
    180 <para>totem_pl_parser_parse_async (pl, "http://example.com/playlist.pls", FALSE, NULL, parse_cb, NULL);
    181 g_object_unref (pl);</para>
    182 <para>static void
    183 parse_cb (TotemPlParser *parser, GAsyncResult *result, gpointer user_data)
    184 {
    185 GError *error = NULL;
    186         if (totem_pl_parser_parse_finish (parser, result, &amp;error) != TOTEM_PL_PARSER_RESULT_SUCCESS) {
    187                 g_error ("Playlist parsing failed: <link linkend="s"><literal>s</literal></link>", error->message);
    188                 g_error_free (error);
    189         }
    190 }
    191  </programlisting>
    192 </example></para>

Note that with 1.21 it builds just fine.
Comment 1 Ting-Wei Lan 2015-05-09 02:18:32 UTC
This problem also happens in atk, gtk2, libgdata and evolution-data-server.
Comment 2 Stefan Sauer (gstreamer, gtkdoc dev) 2015-05-09 12:19:53 UTC
The program listing should be wrapped in a CDATA, or even better use markdown:

|[<!-- language="C" -->
TotemPlParser *pl = totem_pl_parser_new();
...
]| Reading a Playlist Asynchronously


Also since 1.22 got released and apparently noone tested the git version, its probably easier to fix the comments.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2015-05-09 12:20:26 UTC
For reference - the code in question:
https://git.gnome.org/browse/totem-pl-parser/tree/plparse/totem-pl-parser.c#n23
Comment 4 Víctor Manuel Jáquez Leal 2015-05-11 14:24:55 UTC
I'm getting similar errors building gstreamer (gstfdsrc) and gst-plugins-good (playbin) documentation.

For example gstfdsrc.c:

 * The message's structure contains one field:
 * <itemizedlist>
 * <listitem>
 *   <para>
 *   #guint64
 *   <classname>&quot;timeout&quot;</classname>: the timeout in microseconds that
 *   expired when waiting for data.
 *   </para>
 * </listitem>
 * </itemizedlist>
 *
 * <refsect2>
 * <title>Example launch line</title>
 * |[
 * echo "Hello GStreamer" | gst-launch-1.0 -v fdsrc ! fakesink dump=true
 * ]| A simple pipeline to read from the standard input and dump the data
 * with a fakesink as hex ascii block.
 * </refsect2>

Generates this erroneous output:

<para>The message's structure contains one field:</para>
<itemizedlist>
<listitem>
  <para>
  <link linkend="guint64"><type>guint64</type></link>
  <classname>&quot;timeout&quot;</classname>: the timeout in microseconds that
  expired when waiting for data.
  </para>
</listitem>
</itemizedlist>
<para><refsect2> !!!!
<title>Example launch line</title></para> !!!
<informalexample><programlisting><![CDATA[
echo "Hello GStreamer" | gst-launch-1.0 -v fdsrc ! fakesink dump=true
]]></programlisting></informalexample>
<para>
with a fakesink as hex ascii block.
</refsect2><include xmlns="http://www.w3.org/2003/XInclude" href="element-fdsrc-details.xml"><fallback xmlns="http://www.w3.org/2003/XInclude" /></include></para>

I did a bisect and found that the offender commit is this:

commit 5c30b19817dc95e39e57ffe860ff1e2412b61489
Author: Stefan Sauer <ensonic@users.sf.net>
Date:   Thu May 7 09:40:56 2015 +0200

    mkdb: handle footnoots in the markdown parser
    
    Handle docbook that contains non inline docbook. Previously the footnoote link
    was creating a para break. Not the para stays intact.

:100755 100755 41336c935d7e1dcbae2be178b6ba47974aa9fe4e bd2d83842da928de0e6fe2cc18d7897dd7a3efb6 M      gtkdoc-mkdb.in
Comment 5 Stefan Sauer (gstreamer, gtkdoc dev) 2015-05-12 08:37:49 UTC
I can't just revert the other commit as that would also cause an regression. I am fixing this for good now and make a new release right after.
Comment 6 Stefan Sauer (gstreamer, gtkdoc dev) 2015-05-12 13:56:55 UTC
This should fix it - sorry for any hassle. Would you be able to retest and confirm that it fixes it for you too. I'll cut a new release then.

commit 0ea674a534ba1fd6be2285c25c8a30351efa4b80
Author: Stefan Sauer <ensonic@users.sf.net>
Date:   Tue May 12 15:52:12 2015 +0200

    mkdb: improve mixed markup/down handling
    
    The state machinery for multiline text-level blocks was wrong and caused extra para blocks.
    Fixes #749142
Comment 7 Víctor Manuel Jáquez Leal 2015-05-12 14:59:29 UTC
Works for me! Thanks Stefan!
Comment 8 Stefan Sauer (gstreamer, gtkdoc dev) 2015-05-15 10:16:59 UTC
*** Bug 749268 has been marked as a duplicate of this bug. ***