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 652732 - Duplicate ID errors for enums and structs
Duplicate ID errors for enums and structs
Status: RESOLVED OBSOLETE
Product: gtk-doc
Classification: Platform
Component: general
1.17
Other Linux
: Normal major
: ---
Assigned To: gtk-doc maintainers
gtk-doc maintainers
Depends on:
Blocks:
 
 
Reported: 2011-06-16 13:30 UTC by Yeti
Modified: 2018-05-22 13:04 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Yeti 2011-06-16 13:30:03 UTC
Building the documentation of a package that does not explicitly exclude headers generated by glib-mkenums leads to duplicate ID errors from xsltproc.  This is a regression as it used to work fine in 1.15.

The errors look like

    ../xml/menu.xml:59: element refsect2: validity error : ID GwyMenuSensFlags already defined <refsect2 id="GwyMenuSensFlags" role="enum">

and appear because both the <refect2> with the enum description and the <anchor> in the summary gets the same ID, namely GwyMenuSensFlags here.

Why it happens?

The anchors in the summary are generated for symbols for which CheckIsObject() returns true.  This is anything present in the hierarchy file.  But if an enum or flag type was scanned it was also introspected.  And if it was introspected it appears as a child or GEnum/GFlags type in the hierarchy file.  Bang!

A quick workaround is to disable scanning of glib-mkenums generated headers. Unfortunately this does not make existing tarballs compile.  Also, I do not like it as a permanent solution because at the end I *would* like to see all enum and flag types listed in the generated docs in a kind of hierarchy.

I don't know what has changed since 1.15 in this regard.
Comment 1 Emmanuele Bassi (:ebassi) 2015-05-19 11:46:53 UTC
This also happens for struct types that are typedefs to another structure — e.g. ClutterMatrix inside Clutter. By design, ClutterMatrix is a typedef to a CoglMatrix; other structure types get a id="TypeName-struct", but plain typedefs get an id="TypeName" which collides with the anchor id.
Comment 3 Stefan Sauer (gstreamer, gtkdoc dev) 2015-05-20 07:32:41 UTC
Emmanuele, could you please attach such an xml file that triggers the warning? I cannot build clutter in jhbuild on ubuntu LTS anymore :/
Comment 4 Stefan Sauer (gstreamer, gtkdoc dev) 2016-01-05 11:54:46 UTC
Ping? Alternatively I also take a patch for the testsuite that reproduces the problem.
Comment 5 GNOME Infrastructure Team 2018-05-22 13:04:57 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gtk-doc/issues/16.