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

[workspace] Improve qhull hidden visibility #17229

Merged
merged 1 commit into from
Jun 2, 2022

Conversation

jwnimmer-tri
Copy link
Collaborator

@jwnimmer-tri jwnimmer-tri commented May 19, 2022

When building C++ code, we should not use -fvisibility=hidden because it infects all #included code, even the standard library. This causes a lot of console spam during macOS builds, and is a typeinfo (vtable) problem even on Ubuntu, potentially leading to ODR violation. Instead, we should wrap the third-party C++ code in a inline hidden namespace. That way, only the third-party code itself is hidden, not anything that it #includes.

We are substantially patching and subsetting this library to weave it into Drake. We shouldn't give the illusion to users that it's available for reuse downstream; therefore, we'll add an "_internal" suffix and deprecate the original repository name.

Towards #17231.

Requires:


This change is Reviewable

@jwnimmer-tri jwnimmer-tri added priority: low release notes: none This pull request should not be mentioned in the release notes labels May 19, 2022
@jwnimmer-tri jwnimmer-tri force-pushed the vendor-qhull branch 2 times, most recently from 3fddbe1 to 9415357 Compare May 26, 2022 21:45
@jwnimmer-tri jwnimmer-tri force-pushed the vendor-qhull branch 2 times, most recently from f947fd1 to fed060d Compare June 1, 2022 14:59
@jwnimmer-tri jwnimmer-tri marked this pull request as ready for review June 1, 2022 15:00
@jwnimmer-tri
Copy link
Collaborator Author

@drake-jenkins-bot mac-big-sur-clang-bazel-experimental-release please

@jwnimmer-tri jwnimmer-tri added release notes: newly deprecated This pull request contains new deprecations and removed status: do not review release notes: none This pull request should not be mentioned in the release notes labels Jun 1, 2022
@jwnimmer-tri
Copy link
Collaborator Author

+@rpoyner-tri for feature review, please.

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.

:lgtm:

Reviewed 10 of 10 files at r1, all commit messages.
Reviewable status: needs at least two assigned reviewers (waiting on @jwnimmer-tri)

@jwnimmer-tri
Copy link
Collaborator Author

+@sammy-tri for platform review per schedule, please.

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.

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: LGTM missing from assignee sammy-tri(platform) (waiting on @sammy-tri)

Copy link
Contributor

@sammy-tri sammy-tri left a comment

Choose a reason for hiding this comment

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

Reviewed 9 of 10 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: 1 unresolved discussion, LGTM missing from assignee sammy-tri(platform) (waiting on @jwnimmer-tri)


tools/workspace/deprecation.bzl line 13 at r2 (raw file):

        " and will be removed from Drake on or after {}.".format(date),
    ])
    for label, actual in cc_aliases.items():

It doesn't look like "actual" is used here. Does this still create an alias to the library, or just print a deprecation warning?

When building C++ code, we should not use -fvisibility=hidden because it
infects all #included code, even the standard library. This causes a lot of
console spam during macOS builds, and is a typeinfo (vtable) problem even on
Ubuntu, potentially leading to ODR violation. Instead, we should wrap the
third-party C++ code in a inline hidden namespace.  That way, only the
third-party code itself is hidden, not anything that it #includes.

We are substantially patching and subsetting this library to weave it into
Drake. We shouldn't give the illusion to users that it's available for reuse
downstream; therefore, we'll add an "_internal" suffix and deprecate the
original repository name.
Copy link
Collaborator Author

@jwnimmer-tri jwnimmer-tri left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 unresolved discussion, LGTM missing from assignee sammy-tri(platform) (waiting on @rpoyner-tri and @sammy-tri)


tools/workspace/deprecation.bzl line 13 at r2 (raw file):

Previously, sammy-tri (Sam Creasey) wrote…

It doesn't look like "actual" is used here. Does this still create an alias to the library, or just print a deprecation warning?

Done.

Good find. I'd tested with using @qhull_internal and @qhull both at once (and saw the deprecation) but failed to test just @qhull on its own. Locally I've confirmed that r2 fails that manual test case, and now the change in r3 makes it pass again.

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.

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: 1 unresolved discussion, LGTM missing from assignee sammy-tri(platform) (waiting on @sammy-tri)

Copy link
Contributor

@sammy-tri sammy-tri left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignees rpoyner-tri(platform),sammy-tri(platform) (waiting on @jwnimmer-tri)

@sammy-tri sammy-tri merged commit b7c0b58 into RobotLocomotion:master Jun 2, 2022
@jwnimmer-tri jwnimmer-tri deleted the vendor-qhull branch June 2, 2022 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: low release notes: newly deprecated This pull request contains new deprecations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants