-
Notifications
You must be signed in to change notification settings - Fork 2k
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
doc, buildsystem: Add a Version Check for Doxygen, Fix doc* Target Execution #21277
Conversation
I like the idea. However, I think you need to tweak the warning a bit to make it more visible. Right now the output of |
I tend to go for "Warning" (no caps) to emphasize that the user should pay attention but it is only a warning (no error). In the end, probably >90% of all developers who ever run |
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 like this one a lot, thx :)
3cdddec
to
f9fb9ef
Compare
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.
Thanks for tackling! I've tried it on my machine with doxygen 1.9.4
and unfortunately it doesn't print the warning. It does though when comparing to be greater than. I guess awk
doesn't compare the numbers as expected.
No, that was an oversight :-/ |
No worries. Without having to distinguish between the doc-targets, the Makefile got a little simpler, so that's a good thing :) |
Some test traces to verify that everything works as it should:
The important part here is that the
|
Makefile
Outdated
# Extract the documentation type that is to be generated and export it for | ||
# the doxygen Makefile | ||
ifneq ($(findstring doc-,$(MAKECMDGOALS)),) | ||
DOCUMENTATION_FORMAT := $(patsubst doc-%,%,$(filter doc-%, $(MAKECMDGOALS))) |
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.
Wouldn't his break with make doc doc-man doc-latex
?
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.
Yes. It broke in many ways :D
I pushed a commit to fix it. Now the approach is to give the Doxygen Makefile the original target and have it determine the DOCUMENTATION_FORMAT
itself. Otherwise it is impossible to distinguish it.
I added an option to have html
for make doc
as well, but now the issue I had was that got called nine times, three times for the targets and three times due to the DOCUMENTATION_FORMAT
.
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.
The trace of make doc doc-man doc-latex
with stderr piped to /dev/null to get rid of the Doxygen warnings:
$ make doc doc-man doc-latex 2>/dev/null
"make" -BC doc/doxygen doc
make[1]: Entering directory '/home/cbuec/RIOTstuff/riot-debug-doc/RIOT/doc/doxygen'
awk 'NR == 1 {print $0,"{#coc}"} NR > 1 {print $0}' ../../CODE_OF_CONDUCT.md > src/coc.md
( cat riot.doxyfile ; echo "GENERATE_HTML = yes" ) | doxygen -
RIOT documentation successfully generated at file:///home/cbuec/RIOTstuff/riot-debug-doc/RIOT/doc/doxygen/html/index.html
Warning: Doxygen version 1.12.0 is too old. It is recommended to use at least version 1.14.0 to avoid incorrectly formatted output.
make[1]: Leaving directory '/home/cbuec/RIOTstuff/riot-debug-doc/RIOT/doc/doxygen'
"make" -BC doc/doxygen doc-man
make[1]: Entering directory '/home/cbuec/RIOTstuff/riot-debug-doc/RIOT/doc/doxygen'
awk 'NR == 1 {print $0,"{#coc}"} NR > 1 {print $0}' ../../CODE_OF_CONDUCT.md > src/coc.md
( cat riot.doxyfile ; echo "GENERATE_MAN = yes" ) | doxygen -
RIOT documentation successfully generated at file:///home/cbuec/RIOTstuff/riot-debug-doc/RIOT/doc/doxygen/man/man3
Warning: Doxygen version 1.12.0 is too old. It is recommended to use at least version 1.14.0 to avoid incorrectly formatted output.
make[1]: Leaving directory '/home/cbuec/RIOTstuff/riot-debug-doc/RIOT/doc/doxygen'
"make" -BC doc/doxygen doc-latex
make[1]: Entering directory '/home/cbuec/RIOTstuff/riot-debug-doc/RIOT/doc/doxygen'
awk 'NR == 1 {print $0,"{#coc}"} NR > 1 {print $0}' ../../CODE_OF_CONDUCT.md > src/coc.md
( cat riot.doxyfile ; echo "GENERATE_LATEX= yes" ) | doxygen -
RIOT documentation successfully generated at file:///home/cbuec/RIOTstuff/riot-debug-doc/RIOT/doc/doxygen/latex/index.tex
Warning: Doxygen version 1.12.0 is too old. It is recommended to use at least version 1.14.0 to avoid incorrectly formatted output.
make[1]: Leaving directory '/home/cbuec/RIOTstuff/riot-debug-doc/RIOT/doc/doxygen'
Oh and unfortunately this PR also breaks |
This does not seem to work for me with
|
I also added the "Documentation successfully generated" strings for the |
So what happens is that Lines 882 to 883 in 999220c
And for some reason, when the This does not change even when I add the typical Even when commenting out the includes, this error is shown: |
With all debug information enabled, we get some more clues: Make Log
The important part here is in the lower part, when
The But IMO this is way out of scope for this PR already 😅 |
@mguetschow let me know when I can squash this. I created a separate issue I added the fix for the issue to this PR and added the testing procedure to the first message. |
bef9041
to
1e3202d
Compare
Sorry for not interfering before, but yeah indeed, this would make more sense as a separate PR 🙈 |
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.
Looks good now, locally confirmed to work as expected. Let's not go through the additional loop to split the two changes into separate PRs again (unless you feel like it).
Please squash!
1e3202d
to
7728ef2
Compare
On one hand it would've made more sense as a separate PR, but on the other hand it would've created a hen-and-egg situation again like the STM32 ADC PRs. You need one PR to properly test the other and vice versa. With the two commits, it's somewhat separated I guess. |
Thank you for your inputs and patience. I learned a lot about Make and the RIOT build system again and we even found some bugs along the way :) |
Contribution description
Doxygen receives a lot of updates (and lately some updates that fixed issues found when generating the RIOT documentation) and releases happen more recently than a couple of years ago.
Unfortunately some (cough debian based) distributions don't update it. Ubuntu 22.04 LTS for example will probably be forever stuck at version 1.9.1 from 2021.
To avoid issues with malformatted documentation due to an outdated Doxygen version, this PR adds a warning if the Doxygen version is too old. The warning is delibrately put at the end of the Make process due to the wall of warnings generated by Doxygen.
Request for comments: I don't think the solution with
awk
is super pretty, but doing stuff like that with Make is quite annoying. Another option would be to have a dedicatedcheck_version.sh
.It probably makes sense to wait with merging this until after Doxygen 1.14.0 is released. But on the other hand, the note is still valid, even before the release 🤷♂️
During the development of this PR, some issues with the build system surfaced regarding the
doc
anddoc-
targets. Thebuildsystem: fix execution of doc targets
commit fixes that. The details are outlined in issue #21278.Testing procedure
Run
make doc
on a machine with a current release version of Doxygen (1.14.0 is not released yet) and observe the output:If you updated to the latest master branch of Doxygen and compiled it yourself, the warning will not be generated:
The second part of this PR can be tested with the following commands:
Current master:
This PR:
Issues/PRs references
Related to the work in #21106 and #21220.
Fixes #21278.