Skip to content

Write doxygen XML outside the published tree, re-enable doxystat - #36

Open
meshinspector-agent[bot] wants to merge 1 commit into
masterfrom
agent/ghio-doxystat-xml-outside-tree
Open

Write doxygen XML outside the published tree, re-enable doxystat#36
meshinspector-agent[bot] wants to merge 1 commit into
masterfrom
agent/ghio-doxystat-xml-outside-tree

Conversation

@meshinspector-agent

Copy link
Copy Markdown

XML_OUTPUT was a relative path, so Doxygen resolved it against OUTPUT_DIRECTORY — the published directory — and the deploy step's git add -A committed the XML. Nothing reads it except the doxystat metrics, which are themselves disabled.

Changed

  • update_doc.sh: XML_OUTPUT → an absolute, git-ignored doxystat-xml/ at the repo root (both in generate_documentation_simple() and the currently-unused generate_documentation()).
  • Re-enabled show_statistics(), reading that dir and tee-ing to doxystat-metrics.txt so CI can upload it as an artifact.
  • .gitignore: added doxystat-xml/, doxystat-metrics.txt, /stats.txt; widened MeshLib/xml/MeshLib/xml*/ (same under dev/) so a regressed path can't leak in.

Surfaced by re-enabling doxystat — dead code until now, so neither was ever hit:

  • doxystat/{index,compound}.py (generateDS output) need six, and their namespace handling only works with lxml; the xml.etree fallback they import raises AttributeError: … has no attribute 'nsmap'. Hence the new scripts/doxystat/requirements.txt plus a guarded install.
  • metrics.py writes stats.txt into the cwd — i.e. the repo root, a new published junk file. It now runs from inside the XML dir, so each module's stats.txt lands beside its XML.

Metrics can never fail the docs run: missing XML or uninstallable dependencies warn and return 0.

Deleting the already-committed xml_* and dev/test/ is a separate change that must land after this one, or the next docs run re-commits the XML.

Verification

No doxygen 1.14 or bindings artifacts available locally, so I drove the real update_doc.sh in a sandbox against a stub doxygen implementing the documented rule ("if a relative path is entered the value of OUTPUT_DIRECTORY will be put in front of it").

  • Before (master's script + .gitignore): git add -A stages MeshLib/dev/xml_Cpp/* and MeshLib/dev/xml_Py/* — bug reproduced.
  • After: doxygen is invoked with XML_OUTPUT=[/…/doxystat-xml/xml_Cpp]; the published tree has no xml* directory; git add -A stages only MeshLib/dev/html/**.
  • git check-ignore -v confirms coverage of doxystat-xml/, doxystat-metrics.txt, MeshLib/xml_*/, MeshLib/dev/xml_*/ and the old MeshLib/xml/.
  • metrics.py really parses the out-of-tree XML — doxystat-metrics.txt gets a Classes: 1 (1 documented) table per module.
  • Guards: XML dir missing → [WARN] no doxygen XML for Py, skipping its metrics, rc=0; dependencies unavailable → [WARN] could not install doxystat dependencies, skipping metrics, rc=0.
  • bash -n clean.

Not tested: a real doxygen 1.14 run. HTML generation is untouched, but the first CI docs run is the real check — worth confirming there that doxystat-metrics.txt is non-empty and /dev/ pages still render.

No CI labels: this repo has no workflows.

Doxygen's XML output is consumed only by the doxystat metrics, but XML_OUTPUT
was a relative path, so it resolved against OUTPUT_DIRECTORY and the deploy
step's `git add -A` committed ~940 MB of it into the published site. Point it
at a git-ignored directory instead, and re-enable show_statistics() so the
metrics land in doxystat-metrics.txt for CI to upload as an artifact.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants