mosra / m.css

A no-nonsense, no-JavaScript CSS framework, site and documentation theme for content-oriented websites
https://mcss.mosra.cz
Other
409 stars 92 forks source link

Problem with parsing Doxygen.xml #206

Closed raidgar98 closed 2 years ago

raidgar98 commented 3 years ago

Hello, cannot find solution for this so i opening new one.

Here is my project: serek, and as you can see in workflows, CI passes with properly generated documentation: https://github.com/raidgar98/serek/actions/runs/1208747792

But if I try to create documentation same way locally, I got this error:

...
Generate XML output for dir /home/raidg/git/serek/
Generate XML output for dir /home/raidg/git/serek/include/serek/
Generate XML output for dir /home/raidg/git/serek/src/
Generating XML output for the main page
Running plantuml with JAVA...
lookup cache used 318/65536 hits=841 misses=330
finished...
Traceback (most recent call last):
  File "/home/raidg/git/serek/docs/theme/documentation/doxygen.py", line 3859, in <module>
    run(state, templates=os.path.abspath(args.templates), wildcard=args.wildcard, index_pages=args.index_pages, search_merge_subtrees=not args.search_no_subtree_merging, search_add_lookahead_barriers=not args.search_no_lookahead_barriers, search_merge_prefixes=not args.search_no_prefix_merging)
  File "/home/raidg/git/serek/docs/theme/documentation/doxygen.py", line 3688, in run
    extract_metadata(state, file)
  File "/home/raidg/git/serek/docs/theme/documentation/doxygen.py", line 2195, in extract_metadata
    if compounddef.attrib['kind'] not in ['namespace', 'group', 'class', 'struct', 'union', 'dir', 'file', 'page']:
AttributeError: 'NoneType' object has no attribute 'attrib'
make[3]: *** [CMakeFiles/docs_impl.dir/build.make:71: CMakeFiles/docs_impl] Error 1
make[2]: *** [CMakeFiles/Makefile2:405: CMakeFiles/docs_impl.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:672: CMakeFiles/docs.dir/rule] Error 2
make: *** [Makefile:426: docs] Error 2

Following error occurs when parsing Doxygen.xml (I've printed it) I were 'workarounding' doxygen.py as long as script returned 0. My work is avaiable in attached patch

Workflow enviroment is ubuntu 20.04, my setup is:

Operating System: Manjaro Linux                   
Kernel: Linux 5.10.61-1-MANJARO
Architecture: x86-64
Doxygen version: 1.9.2

Does any of you have same problem? Can concepts be source of this problem?

rajatjain1997 commented 3 years ago

Looks like Doxygen 1.9.x breaks m.css. I see that 1.9.x generates a DoxyFile.xml that m.css is unable to parse. I don't see the file in 1.8.x and downgrading to 1.8.20 works.

raidgar98 commented 3 years ago

ok i will downgrade doxygen to 1.8.x and retry running script

crf8472 commented 3 years ago

Had this problem, too. Another workaround that avoids downgrading can be to change the build process.

  1. Run doxygen 1.9.x.
  2. Delete Doxyfile.xml in the output directory.
  3. Run m.css (using --no-doxygen).

Since m.css does not respect Doxyfile.xml, the absence of this file won't hurt. This worked for me.

Not really nice though if you are used to letting m.css call doxygen automatically!

As I understand, the XML processing of m-css does not just discard unexpected input files to proceed with the next but just fails and stops. I proposed a fix as #207.

mscofield0 commented 2 years ago

Please fix this @mosra, the downgrade to doxygen 1.8.x doesn't work for me and the Doxyfile.xml deletion just isn't possible in my case. I like everything about this project and I wouldn't want to use an worse alternative :/

raidgar98 commented 2 years ago

@crf8472 I've tried your solution (with removing step) and all i got is such error output.log

now i will try downgrading

raidgar98 commented 2 years ago

in my case downgrading solves issue

crf8472 commented 2 years ago

@raidgar98 Glad to hear that downgrading helped!

If you are yet interested in inspecting the error you mentioned, I may take a look on that. It would help to have the input file that caused that error (conceptserek_1_1requirements_1_1detail_1_1fundamental__req.xml).

raidgar98 commented 2 years ago

@crf8472 unfortunately i've removed it but i will reinstall to doxygen 1.9.* and will try to reproduce

HotelCalifornia commented 2 years ago

@raidgar98 Glad to hear that downgrading helped!

If you are yet interested in inspecting the error you mentioned, I may take a look on that. It would help to have the input file that caused that error (conceptserek_1_1requirements_1_1detail_1_1fundamental__req.xml).

I get what I think is an equivalent error with this file. my assumption is that it has to do with the addition of concepts to both c++ and doxygen, and m.css hasn't yet handled generating docs for them

(running doxygen 1.9.3 and m.css@9385194)

mosra commented 2 years ago

Please bear with me, I'll look into this as soon as I adapt to changes that happened in various other dependencies (pygments, docutils, latex, graphviz, matplotlib, ...) during the past year so it passes at least the existing tests against the old 1.8 :sweat_smile:

I see Doxygen 1.9.3 being released a few days ago, so I'll try adapting directly to that. Hopefully it won't be as huge nightmare as all the previous versions, but I'm not holding my breath.

mosra commented 2 years ago

Finally fixed with a variant of #207, commited as 45911a188292a62b49ca4b226f590e9ca8cb75fa.

While the commit makes Doxygen 1.9 finally not blow up, please note the tool is not fully updated to it yet -- there's still about 10 test errors and 4 nasty assertions triggered by changes to the XML files. I still have to patch that up, which will be happening over the next days.

mosra commented 2 years ago

FYI for whoever is subscribed to this issue: #215 tracks remaining issues for proper Doxygen 1.9 support. Some of them are rather nasty (like the inline namespace regression), so until these boxes are all ticked off I don't recommend updating.