marzer / poxy

Documentation generator for C++
https://pypi.org/project/poxy
MIT License
135 stars 5 forks source link

AssertionError when C++20 Concepts are present #1

Closed jake-arkinstall closed 2 years ago

jake-arkinstall commented 2 years ago

MCSS, specifically the mcss fork that Poxy uses (the issues tab isn't present on the fork), compares each fundamental element type against a list (doxygen.py, line 3222) including struct, enum, etc. As concept isn't present, the chain of comparisons ends up at the else condition, which simply asserts False and crashes the entire documentation generation process.

I would appreciate concept generation being added, but I'm also happy for the else condition to simply ignore unknown element types (generating a warning instead of asserting False).

marzer commented 2 years ago

Ooooh, exciting, a concepts-related bug! Thanks for the report. I'll have a look into it and try to come up with a workaround over the weekend.

mosra commented 2 years ago

If it's rainy enough over the weekend, I could look into adding concepts support into m.css. Was one of my TODO items for Doxygen 1.9 support, apart from everything else in https://github.com/mosra/m.css/issues/215.

No promises though :P

marzer commented 2 years ago

@jake-arkinstall I've added a workaround for this in 0.5.5. Now if a C++20 concept is found during the XML preprocess it will be removed and a warning emitted:

Warning: C++20 concepts are not currently supported! No documentation will be generated for 'toml::is_pair'. Surround your concepts in a '@cond poxy_supports_concepts' block to suppress this warning until poxy is updated to support them.

If you do as the warning says and stick your concepts inside an appropriately labeled @cond block it should 'just work' whenever m.css supports concepts and I update poxy accordingly.

jake-arkinstall commented 2 years ago

Astounding turnaround.

Hit me up if you set up github sponsors in future. Same to @mosra.

marzer commented 2 years ago

@jake-arkinstall Oh, hey, I'm flattered! But honestly I don't think I'd ever bother with the whole sponsorship thing. My job pays me well enough to live a comfortable life, and the open-source bits+pieces I do on the side are pretty firmly in the realm of "bit of fun on the weekends", so they don't really need incentivizing.

Having said that, if you want to throw 5 bucks into a charity of your choice in my name, I won't try to stop you :)

marzer commented 2 years ago

@mosra would you like an additional maintainer for m.css, at least for the doxygen part? I'd be willing to put my hand up for that, if so. Adding concepts seems like it would be fun, and I'm not yet too burned out on doxygen's (mis)behaviour 😅

marzer commented 1 year ago

@wroyca since you're using modules it occurs to me that it's also very likely you'll be creating/using C++20's concept too - this issue is one you might want to be aware of

wroyca commented 1 year ago

@wroyca since you're using modules it occurs to me that it's also very likely you'll be creating/using C++20's concept too - this issue is one you might want to be aware of

Thanks for the heads up! Concept aside, there is also the issue of doxygen not recognizing the new import, export, module keywords and thus incorrectly treating exports as variables. But then again, I knew what I was getting into with modules, so I don't mind :)

marzer commented 1 year ago

@jake-arkinstall as of v0.9.0 support for C++20 concepts has been implemented 🎉

You'll need to add 'concepts' to your navbar option for the index link to show up, but search and auto-links will work out-of-the-box.

Note that it's an evolving story as they're not even merged into m.css yet (I have a PR for that), so the way they're presented or organized might change a bit over the coming versions. Happy to hear any feedback.

Some snippets: image image image