Skip to content
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

[vtk] Unify include spelling, add comments, fix deps #20024

Merged

Conversation

jwnimmer-tri
Copy link
Collaborator

@jwnimmer-tri jwnimmer-tri commented Aug 19, 2023

Towards #19945 and #16502.


This change is Reviewable

@jwnimmer-tri jwnimmer-tri added priority: low status: single reviewer ok https://drake.mit.edu/reviewable.html release notes: none This pull request should not be mentioned in the release notes labels Aug 19, 2023
@jwnimmer-tri
Copy link
Collaborator Author

jwnimmer-tri commented Aug 19, 2023

+@rpoyner-tri for both reviews, if you please. I'll propose this doesn't necessarily warrant a full cross-check, but rather more like a spot check + endorsement of the approach.

\CC @SeanCurtis-TRI for awareness.

VTK splits its code into libraries, but doesn't use subdir include
paths to reflect the which library has which header. This makes it
difficult to properly update BUILD files as the include statements
evolve. For clarity, we now mark all VTK includes with the library
they come from. We can also add some missing deps now as a result.
Copy link
Contributor

@rpoyner-tri rpoyner-tri left a comment

Choose a reason for hiding this comment

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

/me glances a "What would Lakos do?" rubber bracelet

Sigh. Is there any tool support for maintaining the annotations?

Reviewable status: LGTM missing from assignee rpoyner-tri(platform)

Copy link
Contributor

@rpoyner-tri rpoyner-tri left a comment

Choose a reason for hiding this comment

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

Maybe it would be good enough to have write-up somewhere to guide maintainers for this idiom.

Reviewable status: LGTM missing from assignee rpoyner-tri(platform)

@jwnimmer-tri
Copy link
Collaborator Author

Maybe it would be good enough to have write-up somewhere to guide maintainers for this idiom.

It's difficult for me to put myself in those shoes and guess what they might need. Here's some brain dumping:

For a VTK header we already use somewhere, the easy answer is to cargo cult from an existing Drake #include when including that VTK header in a new Drake file.

If a developer wants to use a particular VTK header for the first time inside Drake, the trick is to find the header in the VTK source tree (e.g., https://github.com/Kitware/VTK/blob/master/IO/Image/vtkImageExport.h) and so #include <vtkImageExport.h> gets the comment // vtkIOImage based on the parent directory names.

As a last resort, I could add that to the commit message. I wonder where else someone would look. Maybe tools/workspace/vtk/README.md is the best option, but I'm not sure anyone would look there?

Copy link
Contributor

@rpoyner-tri rpoyner-tri left a comment

Choose a reason for hiding this comment

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

Yup, I grant that knowing where to write is a hard problem. I'd settle for commit message now, and we see what needs arise later.

:lgtm:

Reviewed 27 of 27 files at r1, all commit messages.
Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignee rpoyner-tri(platform)

@jwnimmer-tri jwnimmer-tri merged commit bd6c96b into RobotLocomotion:master Aug 21, 2023
1 check passed
@jwnimmer-tri
Copy link
Collaborator Author

I'd settle for commit message now, ...

Done.

@jwnimmer-tri jwnimmer-tri deleted the vtk-include-comments branch August 21, 2023 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low release notes: none This pull request should not be mentioned in the release notes status: single reviewer ok https://drake.mit.edu/reviewable.html
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants