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] Clean up NLopt vendoring patches #20453

Merged

Conversation

jwnimmer-tri
Copy link
Collaborator

@jwnimmer-tri jwnimmer-tri commented Oct 30, 2023

Rename "vendoring.patch" to the more Drake-conventional "vendor.patch".

Instead of patching extern 'C' into the external code, adjust the BUILD file to distinguish between C++ code and C code and only run the vendor_cxx tool on C++ code.

Amends #17288.
Towards #17231.


+@SeanCurtis-TRI how do you feel about both feature and platform review? Otherwise we can tag Rico for feature.


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 Oct 30, 2023
Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-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: X2

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: 2 unresolved discussions


tools/workspace/nlopt_internal/package.BUILD.bazel line 173 at r1 (raw file):


_SRCS_STOGO_CABI = [
    "src/algs/stogo/stogo.cc",

BTW I was surprised to see a .cc file located in a CABI group. I had to look at the code to see why. For simple pattern matchers like myself, it might be worth making a note about why this counterintuitive pattern is nevertheless correct ("C-callable front-end" definition).

(Same on the AGS CABI below.)


tools/workspace/nlopt_internal/patches/vendor.patch line 18 at r1 (raw file):

 // to the BFGS code below
 #if 0
-#include "nlopt.h"

BTW What's the value of removing a line guarded by #if 0?

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


tools/workspace/nlopt_internal/package.BUILD.bazel line 173 at r1 (raw file):

Previously, SeanCurtis-TRI (Sean Curtis) wrote…

BTW I was surprised to see a .cc file located in a CABI group. I had to look at the code to see why. For simple pattern matchers like myself, it might be worth making a note about why this counterintuitive pattern is nevertheless correct ("C-callable front-end" definition).

(Same on the AGS CABI below.)

Added comments.

Also this one had both CABI symbols as well as what should have been a file-local class. I also added a patch file to mark it as such.


tools/workspace/nlopt_internal/patches/vendor.patch line 18 at r1 (raw file):

Previously, SeanCurtis-TRI (Sean Curtis) wrote…

BTW What's the value of removing a line guarded by #if 0?

The vendor_cxx tool has some rough edges. An include statement here would cause the inline namespace to cross the #if 0 block.

Rename "vendoring.patch" to the more Drake-conventional "vendor.patch".

Instead of patching "extern 'C'" into the external code, adjust the
BUILD file to distinguish between C++ code and C code and only run the
vendor_cxx tool on C++ code.
Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-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 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! all discussions resolved, LGTM from assignee SeanCurtis-TRI(platform)


tools/workspace/nlopt_internal/patches/vendor.patch line 18 at r1 (raw file):

Previously, jwnimmer-tri (Jeremy Nimmer) wrote…

The vendor_cxx tool has some rough edges. An include statement here would cause the inline namespace to cross the #if 0 block.

Ahhhh.

@SeanCurtis-TRI SeanCurtis-TRI merged commit aa3c85c into RobotLocomotion:master Oct 31, 2023
1 check passed
@jwnimmer-tri jwnimmer-tri deleted the vendor-nlopt-tidy branch October 31, 2023 13:32
WawasCode pushed a commit to WawasCode/drake that referenced this pull request Oct 31, 2023
Rename "vendoring.patch" to the more Drake-conventional "vendor.patch".

Instead of patching "extern 'C'" into the external code, adjust the
BUILD file to distinguish between C++ code and C code and only run the
vendor_cxx tool on C++ code.
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