Skip to content

Doxygen: Only render public files #10206

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

felixc-arm
Copy link
Contributor

@felixc-arm felixc-arm commented Jun 4, 2025

mbedtls part of and resolves Mbed-TLS/TF-PSA-Crypto#281

Changes doxygen so that only files in ./include, ./tf-psa-crypto/include, and ./tests/include/alt-dummy are rendered (i.e. only public files).

You may notice that ./drivers/builtin/include is still present in INCLUDE_PATH in the doxyfile. According to doxygen documentation: "The INCLUDE_PATH tag can be used to specify one or more directories that contain include files that are not input files but should be processed by the preprocessor."

In practice, removing this gave weird results, e.g. some macros like MBEDTLS_PSA_HMAC_OPERATION_INIT from crypto_builtin_composites.h were not available in the documentation, and it thought that MBEDTLS_PRIVATE was a function with a few different signatures, so it seems to be correct to leave it.

As the mbedtls CI has a readthedocs build, the resulting changes should be viewable there.

PR checklist

Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.

  • changelog not required because: Documentation change, covered under overall documentation about public/private headers
  • development PR provided: HERE
  • TF-PSA-Crypto PR provided: Doxygen: Only render public files TF-PSA-Crypto#305
  • framework PR not required
  • 3.6 PR not required because: 4.0/1.0 change only
  • tests not required because: documentation change

EXCLUDE = \
../tf-psa-crypto/drivers/builtin/include/mbedtls/build_info.h \
../tf-psa-crypto/drivers/builtin/include/mbedtls/oid.h
INPUT = ../include ../tf-psa-crypto/include ../tests/include/alt-dummy
Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm Jun 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may notice that ./drivers/builtin/include is still present in INCLUDE_PATH in the doxyfile. According to doxygen documentation: "The INCLUDE_PATH tag can be used to specify one or more directories that contain include files that are not input files but should be processed by the preprocessor."

In practice, removing this gave weird results, e.g. some macros like MBEDTLS_PSA_HMAC_OPERATION_INIT from crypto_builtin_composites.h were not available in the documentation, and it thought that MBEDTLS_PRIVATE was a function with a few different signatures, so it seems to be correct to leave it.

Yes, I think that makes sense.

I'm not actually sure we want MBEDTLS_PRIVATE expanded. After all, a private field foo should be undocumented, not documented under the name private_foo. But that's not related to the repository split or to the API changes, it's a preexisting quality issue, so it's not particularly relevant for the 1.0/4.0 release. And anyway the correct solution would be more complicated than just leaving MBEDTLS_PRIVATE unexpanded, since as you note this understandably confuses Doxygen.

Copy link
Contributor

@mpg mpg Jun 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-existing and unrelated - question: why is ../tests/include/alt-dummy here? I find it surprising to have something from tests in the public rendered documentation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 5186014

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, alt-dummy probably shouldn't be needed anymore, since we've removed MBEDTLS_xxx_ALT. But that's a post-1.0 cleanup.

@felixc-arm felixc-arm added needs-review Every commit must be reviewed by at least two team members, component-docs Docs / website issues filed here for tracking needs-reviewer This PR needs someone to pick it up for review priority-high High priority - will be reviewed soon labels Jun 4, 2025
@felixc-arm felixc-arm changed the title Doxygen doxyfile public only Doxygen: Only render public files Jun 5, 2025
@felixc-arm felixc-arm force-pushed the doxygen-doxyfile-public-only branch from 5e6df91 to 1704578 Compare June 11, 2025 09:30
@felixc-arm
Copy link
Contributor Author

Quick rebase to remove tf-psa-crypto conflict, unfortunately couldn't remove the tf-psa-crypto pointer commit entirely as the pre-work has not been picked up in another commit yet.

@mpg mpg removed the needs-reviewer This PR needs someone to pick it up for review label Jun 11, 2025
Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Copy link
Contributor

@gilles-peskine-arm gilles-peskine-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-project-automation github-project-automation bot moved this from In Development to Has Approval in Roadmap pull requests (new board) Jun 11, 2025
@gilles-peskine-arm gilles-peskine-arm added approved Design and code approved - may be waiting for CI or backports size-xs Estimated task size: extra small (a few hours at most) and removed needs-review Every commit must be reviewed by at least two team members, component-docs Docs / website issues filed here for tracking labels Jun 11, 2025
@gilles-peskine-arm gilles-peskine-arm added this pull request to the merge queue Jun 11, 2025
Merged via the queue into Mbed-TLS:development with commit c2b7f85 Jun 11, 2025
4 of 6 checks passed
@github-project-automation github-project-automation bot moved this from Has Approval to Done in Roadmap pull requests (new board) Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Design and code approved - may be waiting for CI or backports priority-high High priority - will be reviewed soon size-xs Estimated task size: extra small (a few hours at most)
Development

Successfully merging this pull request may close these issues.

Ensure Doxygen documentation doesn't render files in drivers/builtin/include/mbedtls
3 participants