Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doxygen 1.9+ support tasklist #215

Open
31 of 49 tasks
mosra opened this issue Jan 10, 2022 · 2 comments
Open
31 of 49 tasks

Doxygen 1.9+ support tasklist #215

mosra opened this issue Jan 10, 2022 · 2 comments

Comments

@mosra
Copy link
Owner

mosra commented Jan 10, 2022

Because dealing with this project is never easy ALWAYS AN ABSOLUTE HORRID NIGHTMARE. Things to do:

  • Ignoring the new Doxyfile.xml to avoid an assert -- 45911a1
  • Adapt to changes in how friend classes are listed to avoid an assert -- c7ee89e
  • Bisect and work around breakage of inline namespaces from 1.9.1 -- in test_doxygen.test_compound.InlineNamespace.test, Foo::Bar and Foo::Bar::Baz are inline, but Foo::Bar::Baz is being listed as Foo::Baz even though stored in namespaceFoo_1_1Bar_1_1Baz.xml and referenced correctly from the parent, hitting an assert. Workaround could be doable but dirty (detecting if inline and extracting from filename).
    • Bisected to doxygen/doxygen@4372054. OFF COARSE the commit message has no mention of the XML output.
    • Worked around in 54fbc1a. LOOK AT THE COMMIT, LOOK AT HOW MUCH EXTRA WORK IT IS TO UNDO THIS
  • HAVE_DOT has to be explicitly enabled for 1.9.2+ to make graphs appear in XML output -- 901988f
  • Dot files no longer have an absolute path but are copied to the XML directory instead, handle that (and check how that treats filename conflicts rather not, 'nuff nightmares already) -- e92be04
  • Certain functions have different hashes (test_doxygen.test_compound.Listing.test_class, test_doxygen.test_cpp.FunctionAttributes.test, test_doxygen.test_search.LongSuffixLength.test) -- replacing the hashes with a constant value to sidestep this altogether
    • The tag file in 1.12 has some functions with const Foo& changed to constFoo& (lol), probably may cause some pain also?
  • test_doxygen.test_compound.Includes no longer exhibits the broken behavior, treating the file where a class was defined as the include file, not the file with a fwdecl; update the test file -- dd1b6f5
  • test_doxygen/contents_blocks/input.dox:29: warning: End of list marker found without any preceding list items, same on line 39, nothing suspicious in the output, although happening on 1.8.18 already
  • The damn thing started inserting <zwj/> to random places (test_doxygen.test_contents.Typography.test, test_doxygen.test_contents.Code.test, test_doxygen.test_contents.Blocks.test, log output in test_doxygen.test_contents.AutobriefBlockquote.test). What's the point of that?! -- 58a04dd
  • Different spacing around inline elements (test_doxygen.test_contents.Custom.test) -- should hopefully be consistent across versions with 50a7fc5
  • list of xrefitems has changed order again (test_doxygen.test_contents.Blocks.test_xrefitem, inverse of 4ec09a2), what the hell -- was a temporary 1.8.18-1.8.20 regression, 228c9b8
  • As of Include qualified names in <memberdef>s in XML output doxygen/doxygen#8983, XML files now include <qualifiedname> elements, which could help with restoring scopes in file docs? The NamespaceMembersInFileScope test in particular.
  • warning: documented empty return type of, fix the test files -- 568edda, a0a0032
  • There's a potential change in behavior related to ignored asterisks at line beginnings, which I was always working around with * *foo* instead of *foo*, investigate the impact (Markdown **emphasis** at the beginning of the line is not rendered. doxygen/doxygen#8615)
  • Fix / report all bugs caused by the nightmare commit doxygen/doxygen@b290399 (1.9.5+)
    • Linking to Namespace::function(Type) fails if Type is inside Namespace as well, have to link to Namespace::function(Namespace::Type). Same happens for Class::function(Type) if Type is within Class, somehow it lost the capability since 1.8. Repro case is easy.
      • Switching to call getDefsOld() instead of getDefsNew() "fixes" everything
    • Cannot link to any enum values from tagfiles
      • Using getDefsOld() fixes that right after this commit, but somehow it's still broken if the function gets switched to in 1.12 instead
      • Fix in mosra/doxygen@7560c15, PR linked from there
    • Macros with @related can no longer be linked to
      • Looks like getDefsOld() fixes that too
    • Linking to map(), set(), list() fails if there's a STL tag file (where map, set, list are header names), commenting those out in the tagfile or explicitly qualifying the @refs makes it work
      • also any(), version(), ...
      • possibly also attribute(), but attributeType() etc fails too, it's unlikely that there's such a header... dot() reference from within Math also fails for some reason
      • getDefsOld() makes that go away again :/
    • Linking to operator"" from the same namespace doesn't work with getDefsNew(), fully qualified links work tho
    • Copydoc from an overload picks some completely random overload, FFS
      • happens only with getDefsNew() and doxygen/doxygen@2007519 doesn't help with it at all
      • Spotted only because in certain cases I'm copying also @param with it, which if not correctly matches is then missing, causing doxygen to complain that a parameter isn't documented (Color4(T, T) is the case)
      • So far impossible to make a reduced test case for this
    • No links to GL::Renderer::Error work with getDefsNew() for some reason
    • Trade::AnimationTrackData::track() has the R template argument linking to MaterialTextureSwizzle::R. That's so fucking horrible I can't even.
      • Not sure if limited to getDefsNew(), discovered only because with it the m.css-side generation complained that there's no R argument to document with @tparam
      • Might be related to some of the "fixes" in doxygen/doxygen@35711f2, where the removal of getResolvedNamespaceMutable() may make enums again taken way too broadly
  • Run on Magnum docs to discover the remaining 96 new bugs and regressions
    • The damn thing doesn't understand anchors in Markdown links anymore It now reports links to unkown anchors as warnings, so [scalar/vector functions](#scalarvector-functions) no longer works. That's fine and good for avoiding link rot, converting those few cases to HTML anchors instead.
    • unable to resolve reference to 'PixelFormat::RGBA8Unorm/@ref' for \ref command because apparently / is now considered a part of the reference? could be a good thing tho (yeah there's warning: expected whitespace after \ref command for the same line)
    • warning: unable to resolve reference to 'Platform' for \ref command from a class inside that namespace (basically no link to Platform works for some reason?!) -- it's because some classes derive from Platform::WindowlessApplication which is unknown to Doxygen at the time of parse, which then causes it to generate an empty ::Platform namespace for those, and because it's empty, links then don't work as it gets a priority over Magnum::Platform
    • THE DAMN THING no longer knows how to link to stuff defined in parent classes doesn't seem to happen with 1.12 anymore, or maybe it was all related to doxygen/doxygen@b290399 again
      • Magnum/Math/Vector3.h:139: warning: @copybrief or @copydoc target 'Vector::Vector(T)' not found
      • Magnum/SceneGraph/AbstractTranslationRotation3D.h:210: warning: unable to resolve reference to 'rotate(const Math::Quaternion<T>&)' for \ref command, the original doc work so i suppose this is because the same function is overriden in a subclass with no docstring?
    • Relative linking in @related docblocks no longer works
    • Tagfiles generated with 1.12 then fail to link to many typedefs and other APIs, tagfiles generated with 1.8 work It's because some commit stops duplicating everything into <compound kind="file">, which then just uncovered many cases where I was improperly linking to a different namespace without fully qualifying it
      • On the other hand, a lot of existing workarounds which required explicit @ref Magnum:: or @relativeref{Magnum, might be obsoleted by that Can't remove them just yet because I still need to be able to build on 1.8.16 until 1.12 is practically usable without nasty local patches
    • Wrapping a " in backticks seems to make the "code block" bit stuck in markdown parser until the end of times
      • Could be related to doxygen/doxygen@5db5808, maybe? " gets expanded to &quot;, so ...
      • Impossible to reproduce in a standalone file, and I wanted this to be @cb{.ini} " @ce anyway. Won't bother.
    • @endcode (or the @ce alias?) followed by - without a space no longer works -- can be worked around by making it alias @endcode<b></b> instead (sigh)
    • "Potential recursion while resolving ref" when @ref is part of a @section section headings are links themselves in m.css, and likely now in doxygen as well, which is probably why it warns
    • Links to complex overloads such as Ui::UserInterfaceGL::create() silently fail, taking just the function name and leaving the rest
      • Maybe that's related to the other weird linking errors and has the same culprit?
    • Section / @par / @note right after a code block with @m_class in between loses the class and has to be worked around with putting another <b></b> in between, update the paragraph fixup to handle this
  • 1.9.5 changelog says "The specific options DOT_FONTNAME and DOT_FONTSIZE have been replaced be more generic options DOT_COMMON_ATTR, DOT_EDGE_ATTR, and DOT_NODE_ATTR that can be used to customize the way dot images are rendered. When upgrading the Doxyfile (using doxygen -u) the existing values of DOT_FONTNAME and DOT_FONTSIZE will be migrated.", adapt to that
    • In particular, for Magnum, with the upgraded Doxyfile the custom buildsystems etc. graphs no longer use Source Sans Pro but some other font (different g)
    • Fortunately it seems that if I don't upgrade the Doxyfile, the original options are still recognized and work correctly, so this isn't too critical
  • SHOW_HEADERFILE is the way to control showing the corresponding include for a class/function/... since 1.9.2, not SHOW_INCLUDE_FILES, adapt to that
  • Range assertion in string_view::operator[] in markdown parser -- and --- detection if GLIBCXX_ASSERTIONS are enabled
  • Anonymous namespaces (and structs, etc.) are no longer with @, make sure there's an explicit test case for those that differentiates between 1.8 and 1.12 -- 8ed4a9f
  • <member> "references" in groups cause file docs to be useless when groups are used since doxygen/doxygen@d460544.
  • Certain typedefs are now treated as functions.
    • Likely related to the other typedef bugs listed above?
    • Bisected to doxygen/doxygen@a7179f0, which itself is a fix attempt for doxygen/doxygen@b290399 YET AGAIN
    • Fix in mosra/doxygen@dbb7f93, PR linked from there
    • typedef Corrade::NoInitT NoInitT is completely ignored by that thing, causing all links to be broken, with ::Corrade that works, wtf?! -- fixed by the above also
    • In 1.12 the NamespaceMembersInFileScope test no longer contains the file-level typedefs, what the hell happened there again -- fixed by the above also
  • Update the CI to run against something newer -- 109fdf7
    • 1.12 requires at the very least a build of Doxygen with the typedef deduplication fix because that breaks many tests
    • from older 1.9.1 and 1.9.8 both work (and are in Ubuntu distros by default, thus important to test against), 1.10 + 1.11 have some silly bug with HTML escaping so they cannot
  • Inline namespaces for literals don't get detected as such for some reason (there's a workaround for older Doxygen, but even with it removed the XML doesn't say it's inline ... is it because there's external documentation for those? ffs)
@marzer
Copy link
Contributor

marzer commented Apr 15, 2022

Something else for this list: It appears that in some recent doxygen version they've changed the way = default is handled, in that now it no longer leaks into the argsstring, meaning that this code isn't strictly correct anymore:

m.css/documentation/doxygen.py

Lines 2031 to 2036 in 6f5c7d5

signature: str = element.find('argsstring').text
if signature.endswith('=default'):
signature = signature[:-8]
func.is_defaulted = True
else:
func.is_defaulted = False

Doesn't appear that they've added any way to compensate for this (there's no defaulted="yes" attribute or similar) :(

@mosra
Copy link
Owner Author

mosra commented Sep 15, 2024

I'm going to stop here for now. The remaining checkboxes are quite nightmarish, fortunately the "fix" that makes things behave like before 1.9 is quite short:

diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 45f86b340..ccd4e55e3 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -6432,6 +6432,7 @@ static void addOverloaded(const Entry *root,MemberName *mn,
 
 static void insertMemberAlias(Definition *outerScope,const MemberDef *md)
 {
+  return; // TODO for some reason the function makes the alias no longer available for linking in @related
   if (outerScope && outerScope!=Doxygen::globalScope)
   {
     auto aliasMd = createMemberDefAlias(outerScope,md);
diff --git a/src/util.cpp b/src/util.cpp
index ab30eb461..f1292652a 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -2789,7 +2789,7 @@ GetDefResult getDefs(const GetDefInput &input)
   }
   else // do one of the two getDefs routines (comment out the other one)
   {
-    return getDefsNew(input);
+    return getDefsOld(input);
   }
 }

Together with the three PRs linked from above, this makes 1.12 work on all my repos without regressions and warning-free.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants