-
Notifications
You must be signed in to change notification settings - Fork 8.2k
doc: fix incremental build by fixing doxygen output mtime #13159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Doxygen doesn't support incremental builds. It could be ok because it doesn't take much time in this codebase. However it's not because it makes old output look new which has a cascade effect on sphinx: https://sourceforge.net/p/doxygen/mailman/message/36580807/ Make doxygen artificially smarter by saving and restoring modify timestamps on the filesystem for doxygen output files that haven't changed. On my system this brings down the time to run an incremental "make htmldocs" from 75s down to 8s (cmake -DKCONFIG_TURBO_MODE=1 used in both cases) This optimization speeds-up non-doxygen documentation work only. Signed-off-by: Marc Herbert <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #13159 +/- ##
=======================================
Coverage 48.73% 48.73%
=======================================
Files 315 315
Lines 46540 46540
Branches 10743 10743
=======================================
Hits 22679 22679
Misses 19349 19349
Partials 4512 4512Continue to review full report at Codecov.
|
|
sphinx-html was just mentioned to me. Unlike sphinx-html, this doesn't take any shortcut hence safely regenerates everything that's needed; slowly in case of some actual doxygen change and faster otherwise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey thank you! This had been in my list to look into for a while. I have no objections to this, but have you tested on Windows? I will try to give it a go myself.
dcpleung
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Note there's a much simpler solution if rsync becomes an acceptable Windows requirement, no need for the new python script https://sourceforge.net/p/doxygen/mailman/message/36582383/ According to cmake's documentation, "copy_if_different" copies files and not directories recursively: |
|
The patch isn't as dramatic a performance gain on windows, but still quite significant: goes from 5 minute rebuild without this patch to 2 mins. On a Linux box, it's worth noting that this patch gives a doc rebuild time of about 12 seconds for a full doc build (including all the configuration docs), so for developers building local documents a few times to validate changes, this is a big win for subsequent rebuilds. |
dbkinder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I just tested So the only alternative solution left is requesting Windows users to install rsync; however there's a high risk of making Windows a better place https://www.microsoft.com/en-us/p/ubuntu/9nblggh4msv6 |
|
So this fixes the incremental build time for pure .rst changes but not yet for doxygen changes, there's another and unrelated issue when doing doxygen work. I observed that changing 1 doxygen XML file has the exact same effect as changing all doxygen files. I investigated further and found that the sphinx extension for doxygen "breathe" wrongly believes that "everything depends on everything". I reported this unrelated breathe issue in breathe-doc/breathe#420 |
|
@marc-hb |
|
There is at least one native rsync build for Windows too: DeltaCopy https://serverfault.com/questions/35336/why-hasnt-rsync-caught-on-in-the-windows-world |
|
I just tested this on a Macbook Pro with Mojave. It brings the time to run |
I suspect most of these 2 mins are spent re-running doxygen: fix submitted in PR #13442 and tested on Linux and macOS. Curious how it fares on Windows. |
|
For the record there is - at least in theory - a simpler, one-way solution: https://sourceforge.net/p/doxygen/mailman/message/36582383/
|
The ability to make a one-line .rst change and quickly regenerate the docs has been broken at least three times in the past: zephyrproject-rtos#13159, zephyrproject-rtos#36033 and zephyrproject-rtos#57624. Add a small, final check to make sure this can't happen again. Signed-off-by: Marc Herbert <[email protected]>
Doxygen doesn't support incremental builds. It could be ok because it
doesn't take much time in this codebase. However it's not because it
makes old output look new which has a cascade effect on sphinx:
https://sourceforge.net/p/doxygen/mailman/message/36580807/
Make doxygen artificially smarter by saving and restoring modify
timestamps on the filesystem for doxygen output files that haven't
changed.
On my system this brings down the time to run an incremental "make
htmldocs" from 75s down to 8s (cmake -DKCONFIG_TURBO_MODE=1 used in both
cases)
This optimization speeds-up non-doxygen documentation work only.
Signed-off-by: Marc Herbert [email protected]