-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
2.1 only: add tests/scripts/doxygen.sh and fix make apidoc #2011
2.1 only: add tests/scripts/doxygen.sh and fix make apidoc #2011
Conversation
Doxygen 1.8.10 warns that those tags are obsolete. Since we're not generating XML anyway, it seems harmless to remove them even for earlier versions.
Apparently travis has an old version of doxygen that doesn't know all tags in our config. That's not something we care about, we only want to know about warnings in our doxygen content
Previous change to include excluded the content in doxygen/input
This partially reverts 1989caf (only the changes to Makefile and CMakeLists, the addition to scripts/config.pl is kept). Modifying config.h in the apidoc target creates a race condition with make -j4 all apidoc where some parts of the library, tests or programs could be built with the wrong config.h, resulting in all kinds of (semi-random) errors. Recent versions of CMake mitigate this by adding a .NOTPARALLEL target to the generated Makefile, but people would still get errors with older CMake versions that are still in use (eg in RHEL 5), and with plain make. An additional issue is that, by failing to use cp -p, the apidoc target was updating the timestamp on config.h, which seems to cause further build issues. Let's get back to the previous, safe, situation. The improved apidoc building will be resurrected in a script in the next commit. fixes Mbed-TLS#390 fixes Mbed-TLS#391
This re-introduces the apidoc with full config.h, but hopefully with the race conditions and other issues that the previous implementation had. Adapt doxygen test script to use that new script, and also check for errors in addition to warnings while at it.
retest |
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.
@gilles-peskine-arm: Thanks for the PR, I think the changes look good.
Before approving I have a quick question: Why are there some differences in the backported changes between the 2.1 branch and development? For example, I think the 2.1 branch assumes that doxygen is run from the project root while development assumes that it is run from the doxygen directory. I do not know why this is the case, but perhaps its ideal to keep them in sync?
@andresag01 That's a good question. The change in directory was made in #1284. I'd initially preferred to keep the changes minimal and only backport what had been done for 2.2. However I hadn't paid attention that #1284 is already present in 2.7 (it was merged just before the 2.7 release), so 2.1 remains the odd man out. Backports should minimize behavior changes, but this patch already changes the behavior of |
@gilles-peskine-arm: I agree that generally we should aim to maintain behaviour in the LTS. However, the change in #1284 seems minor as it is just regarding the place where the docs are generated. It would be a different discussion if we were talking about a change in the API or ABI of the code. I am not sure about the warnings. Are they also being ignored in the development and 2.7 branches? If this is the case, then I do not think we should be too concerned about that. In summary, I would prefer it to be backported as well. |
@gilles-peskine-arm @andresag01 I'm sorry, can you clarify what the behaviour changes are currently, and what additional behaviour change would be introduced by backporting #1284 too? By "the place where the docs are generated", do you mean (a) what the working directory needs to be when invoking the script, or (b) the final place where the docs are going to be found after generation, or (c) something else? |
The following changes were made in 2.2 (via a PR-less branch), and this PR backports them:
The following change was made in 2.7 (via #1284) and I'm considering backporting it:
|
@gilles-peskine-arm Thanks for that very clear summary! The changes that this PR already backports are obviously fine and desirable. In my opinion, the change introduced by #1284 is also acceptable for the 2.1 branch, as the behaviour when invoking |
I think Andres and me both think #1284 should be backported, and you don't seem to disagree, so I'm adding "needs work" and will review once that additional part has been backported. |
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.
This looks like a proper backport of the set of doxygen-related things we want to backport.
I'm really open to discussion or debate, but I'm really not sold on changing the targets in the Makefile on a maintained branch. I see no strong or compelling reason to do it. |
I agree about reverting the backport of #1284 for that reason, but I think the other behaviour change was necessary to fix a bug, hence its inclusion in a maintained branch was justified. The bug is that
I checked the history and I don't think the behaviour was really Paul's intention. That change was introduced in 2.2.1 and backported in 2.1.4, so we would merely be reverting to what the behaviour was from 2.1.0 to 2.1.3. For some reason we backported the faulty commit but forgot to backport its reversal (that is, until this PR). I think that strengthens my previous point: not only is this fixing a bug, it's fixing a bug that we introduced in a maintained branch (while trying to fix another one, but going the wrong way about it). (By the way, if we followed your advice back then and tried harder to avoid changing behaviour in maintained branches, we probably would have been forced to fix the warnings another way and would have avoided introducing this bug in the first place. So I think your care is justified - I just happen to disagree about this particular instance.) |
The current version of the PR as I write (which I'm archiving to https://github.com/gilles-peskine-arm/mbedtls/tree/doxygen-fixes-2.1-make_apidoc_is_not_full) makes two changes which are at the border between enhancements and bugs. They don't reconcile the behavior between the implementation and the documentation because we didn't document the intended behavior — but by the same token they don't break documented behavior.
As Manuel notes, both expectations were met until 2.1.3, which is an argument for fulfilling them again. On the other hand, they've been broken on the 2.1 branch for 2½ years and nobody has complained that I could find, which is an argument for leaving things as they are. I have a preference for fixing the arguably-bugs, but it isn't a strong preference. I have a strong preference for getting |
A branch that preserves the 2.1.4+ behavior ( |
Generate the documentation from include and doxygen/input only. Don't get snared by files containing Doxygen comments that lie in other directories such as tests, yotta, crypto/include, ... The only difference this makes in a fresh checkout is that the documentation no longer lists target_config.h. This file is from yotta, does not contain any Doxygen comment, and its inclusion in the rendered documentation was clearly an oversight.
Ok, I can accept @mpg's point. We're just reverting it back to the way it was done in Therefore I accept the change. |
Since you've both approved the PR, I take it this is approved for design. The CI job that was breaking has successfully run |
retest |
retest |
1 similar comment
retest |
CI passes! Yay! Labelling as 'Ready to Merge'. |
The Changelog merged the PR #2011 entry under the wrong version. This corrects that merge error, and also clarifies the entry.
Add
tests/scripts/doxygen.sh
like in 2.7 and development. This lets us keep our CI scripts uniform. Fix #2010.Fix the doxygen configuration to work with modern Doxygen versions without warnings.
make apidoc
now generates the documentation for the current configuration. Runscripts/apidoc_full.sh
to generate the full documentation. This aligns the behavior with Mbed TLS 2.2+ and permits parallel builds (#390 #391).This is a backport of a branch that was merged in 2.2.2 at 9a3ee57 without a Github pull request.
Additionally, there is a backport of the commit “Look for documentation only in specific directories” from #2031, which was not included in #2033 because it interacts with other changes in this PR.
We also debated backporting #1284 for uniformity with the other maintained branches but this is a change in behavior and not a bug fix in any way.