marzer / poxy

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

Poxy v0.13.8 runs into an assertion on Ubuntu Focal #33

Closed tim-janik closed 1 year ago

tim-janik commented 1 year ago

Environment

version and/or commit hash:

Poxy v0.13.8 on Ubuntu Focal via pip.

Describe the bug

Trying Poxy v0.13.8 after marzer/poxy/issues/32 was fixed triggers an assertion:

$ poxy
Poxy v0.13.8
Reading /anklang/poxy.toml

*************

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/poxy/main.py", line 303, in main
    run(
  File "/usr/local/lib/python3.8/dist-packages/poxy/run.py", line 1679, in run
    with timer(rf'Generating XML files with Doxygen {doxygen.version_string()}') as t:
  File "/usr/local/lib/python3.8/dist-packages/poxy/doxygen.py", line 128, in version_string
    return rf'{version()[0]}.{version()[1]}.{version()[2]}'
  File "/usr/local/lib/python3.8/dist-packages/poxy/doxygen.py", line 122, in version
    assert ret
AssertionError

*************

You appear to have triggered an internal bug!
Please re-run poxy with --bug-report and file an issue at github.com/marzer/poxy/issues
Many thanks!

*************

Additional information

The setup is still the same as described in marzer/poxy/issues/32, but now I can finally generate a bug-report.

--bug-report

poxy_bug_report.zip

marzer commented 1 year ago

This turned out to be two weird behaviours of Doxygen 1.8.17.

1. doxgen --version gave unexpected junk in the output

Most versions of doxygen will emit just the version triplet, or a version triplet followed by a hash, which my version parse was expecting, but Doxygen 1.8.17 emitted this:

1.8.17 (b5fa3cd1c6e6240e20d3b80a70e3f04040b32021*)

Which I wasn't accounting for. I've relaxed the version parse to just look for "a version triplet, then maybe any junk afterward".

2. Specifying DOXYFILE_ENCODING as a string crashed doxygen

Poxy's internal Doxyfile generator emits all string options as quoted strings for the sake of disambiguation, since this should be valid according to their schema. For some reason specifying the encoding in this manner crashed doxygen. That is:

# this would crash
DOXYFILE_ENCODING = "UTF-8"

# whereas this would be fine
DOXYFILE_ENCODING = UTF-8

So I've added a step to special-case this value.

I've also added additional CI machinery to catch regressions in these areas. Hope that's the end of your troubles with Ubuntu Focal 😅

marzer commented 1 year ago

On an unrelated note @tim-janik, I took a look at the documentation you're generating at https://tim-janik.github.io/docs/anklang/, and the shell script responsible for it at https://github.com/tim-janik/anklang/blob/trunk/doc/poxy.sh, and noticed that you have theme = 'light' set by default. Is that intentional? Your theme overrides for the light theme seem incomplete (it has odd colouring in the navbar that makes it looks like the theme is still a work-in-progress), while your custom dark theme looks quite nice.

tim-janik commented 7 months ago

On an unrelated note @tim-janik, I took a look at the documentation you're generating at https://tim-janik.github.io/docs/anklang/, and the shell script responsible for it at https://github.com/tim-janik/anklang/blob/trunk/doc/poxy.sh, and noticed that you have theme = 'light' set by default. Is that intentional? Your theme overrides for the light theme seem incomplete (it has odd colouring in the navbar that makes it looks like the theme is still a work-in-progress), while your custom dark theme looks quite nice.

You are right, I tried fixing a contrast issue back then and have since reverted the change.