`ninja clean` is not enough to clean up Sphinx temporary files
Doing a build check across multiple commits that change Spinx documentation bits may fail, because the outdated temporary files, which ninja clean
does not remove, cause warnings or errors in the doc build. Running ninja docs
manually does not fix the issue.
It seems the foremost culprit are .rst
files copied to the build directory by Meson. They do not get deleted when rewinding to before a commit that adds some, but Sphinx will still read them. The stale files may have references to things that do not exist after rewinding, like some Doxygen entities (e.g. a group used with doxygengroup
Sphinx directive).