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

Use visibility hidden by default #392

Merged
merged 5 commits into from
Jan 26, 2024
Merged

Conversation

j-rivero
Copy link
Contributor

🎉 New feature

Part of #166

Note: all Ionic branches need to be checked and fixed before merging.

Summary

The commit changes the gz-cmake projects to use C/C++ visibility hidden by default. This is a potential breaking changed for projects using gz-cmake but the benefits in terms of creating portable code and time spend by the loader could be huge.

To avoid this change, the EXPOSE_SYMBOLS_BY_DEFAULT flag can be used in the gz_configure_project call.

The change deprecates the HIDDEN_SYMBOLS_BY_DEFAULT flag.

Test it

Create an Ionic colcon workspace and build it with this branch.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

The commit changes the gz-cmake projects to use C/C++ visibility hidden
by default. This is a potential breaking changed for projects using
gz-cmake but the benefits in terms of creating portable code and
time spend by the loader could be huge.

To avoid this change, the EXPOSE_SYMBOLS_BY_DEFAULT flag can be used
in the gz_configure_project call.

The change deprecates the HIDDEN_SYMBOLS_BY_DEFAULT flag.

Signed-off-by: Jose Luis Rivero <[email protected]>
@azeey
Copy link
Contributor

azeey commented Oct 31, 2023

This is a good example of a PR that needs CI runs on all downstream libraries building this PR from source. Cross-ref gazebo-tooling/release-tools#851

@scpeters
Copy link
Member

scpeters commented Nov 4, 2023

This is a good example of a PR that needs CI runs on all downstream libraries building this PR from source. Cross-ref gazebo-tooling/release-tools#851

example for testing with gz-utils in gazebosim/gz-utils#115

scpeters added a commit to gazebosim/gz-math that referenced this pull request Nov 6, 2023
Part of testing gazebosim/gz-cmake#392

Signed-off-by: Steve Peters <[email protected]>

Signed-off-by: Steve Peters <[email protected]>
scpeters added a commit to gazebosim/gz-plugin that referenced this pull request Nov 6, 2023
Part of testing gazebosim/gz-cmake#392.

Signed-off-by: Steve Peters <[email protected]>
scpeters added a commit to gazebosim/gz-plugin that referenced this pull request Nov 7, 2023
Part of testing gazebosim/gz-cmake#392.

Signed-off-by: Steve Peters <[email protected]>
@j-rivero
Copy link
Contributor Author

j-rivero commented Nov 7, 2023

@osrf-jenkins run tests

1 similar comment
@j-rivero
Copy link
Contributor Author

j-rivero commented Nov 7, 2023

@osrf-jenkins run tests

scpeters added a commit to gazebosim/gz-math that referenced this pull request Nov 8, 2023
* Use single header for MovingWindowFilter
* Use HIDE_SYMBOLS_BY_DEFAULT

Part of testing gazebosim/gz-cmake#392

Signed-off-by: Jose Luis Rivero <[email protected]>
Signed-off-by: Steve Peters <[email protected]>
Co-authored-by: Steve Peters <[email protected]>
scpeters added a commit to gazebosim/gz-common that referenced this pull request Nov 8, 2023
Part of testing gazebosim/gz-cmake#392.

Signed-off-by: Steve Peters <[email protected]>
scpeters added a commit to gazebosim/gz-msgs that referenced this pull request Nov 8, 2023
Part of testing gazebosim/gz-cmake#392.

Signed-off-by: Steve Peters <[email protected]>
@scpeters
Copy link
Member

scpeters commented Nov 8, 2023

wow, apparently we've already been using HIDE_SYMBOLS_BY_DEFAULT in sdformat since gazebosim/sdformat#780 (comment)

scpeters added a commit to gazebosim/gz-msgs that referenced this pull request Nov 13, 2023
Part of testing gazebosim/gz-cmake#392.

Signed-off-by: Steve Peters <[email protected]>
scpeters added a commit to gazebosim/gz-transport that referenced this pull request Nov 13, 2023
Part of testing gazebosim/gz-cmake#392.

Signed-off-by: Steve Peters <[email protected]>

Signed-off-by: Steve Peters <[email protected]>
scpeters added a commit to gazebosim/gz-fuel-tools that referenced this pull request Nov 13, 2023
Part of testing gazebosim/gz-cmake#392.

Signed-off-by: Steve Peters <[email protected]>

Signed-off-by: Steve Peters <[email protected]>
scpeters added a commit to gazebosim/gz-rendering that referenced this pull request Nov 13, 2023
Part of testing gazebosim/gz-cmake#392.

Signed-off-by: Steve Peters <[email protected]>

Signed-off-by: Steve Peters <[email protected]>
iche033 pushed a commit to gazebosim/gz-rendering that referenced this pull request Nov 13, 2023
Part of testing gazebosim/gz-cmake#392.

Signed-off-by: Steve Peters <[email protected]>
scpeters added a commit to gazebosim/gz-transport that referenced this pull request Nov 13, 2023
Part of testing gazebosim/gz-cmake#392.

Signed-off-by: Steve Peters <[email protected]>
scpeters added a commit to gazebosim/gz-physics that referenced this pull request Nov 14, 2023
Part of testing gazebosim/gz-cmake#392.

Signed-off-by: Steve Peters <[email protected]>

Signed-off-by: Steve Peters <[email protected]>
scpeters added a commit to gazebosim/gz-fuel-tools that referenced this pull request Nov 16, 2023
Part of testing gazebosim/gz-cmake#392.

Signed-off-by: Steve Peters <[email protected]>
scpeters added a commit to gazebosim/gz-physics that referenced this pull request Nov 16, 2023
Part of testing gazebosim/gz-cmake#392.

Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Jose Luis Rivero <[email protected]>
Co-authored-by: Jose Luis Rivero <[email protected]>
@caguero
Copy link
Contributor

caguero commented Jan 4, 2024

@j-rivero , any outstanding PR in any downstream libraries that we should merge before this one?

@j-rivero
Copy link
Contributor Author

j-rivero commented Jan 4, 2024

@j-rivero , any outstanding PR in any downstream libraries that we should merge before this one?

Nop! we are good to go.

Signed-off-by: Jose Luis Rivero <[email protected]>
@j-rivero
Copy link
Contributor Author

Before merging, just found that we don't have a Migration.md entry for this, done in 75ae798

@scpeters
Copy link
Member

@j-rivero , any outstanding PR in any downstream libraries that we should merge before this one?

Nop! we are good to go.

actually, do we want to remove the HIDE_SYMBOLS_BY_DEFAULT parameter from all the downstream libraries now that we've confirmed that it works? I think if we merge this now it will add cmake deprecation warnings everywhere

@j-rivero
Copy link
Contributor Author

@j-rivero , any outstanding PR in any downstream libraries that we should merge before this one?

Nop! we are good to go.

actually, do we want to remove the HIDE_SYMBOLS_BY_DEFAULT parameter from all the downstream libraries now that we've confirmed that it works? I think if we merge this now it will add cmake deprecation warnings everywhere

Yep. See #166 (comment) and linked PRs after the comment.

@j-rivero
Copy link
Contributor Author

j-rivero commented Jan 22, 2024

Time has come. Ready to merge 🚀

Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

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

LGTM! Just a few documentation related comments

Migration.md Outdated Show resolved Hide resolved
@@ -9,6 +9,17 @@ release will remove the deprecated code.

1. The minimum required cmake version is now 3.22.1.

1. **Breaking**: C/C++ projects enable the visibility=hidden by default
gz-cmake4 changes the gz-cmake projects to use C/C++ visibility hidden
by default. This is a potential breaking changed for projects using
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
by default. This is a potential breaking changed for projects using
by default. This is a potential breaking change for projects using

gz-cmake4 changes the gz-cmake projects to use C/C++ visibility hidden
by default. This is a potential breaking changed for projects using
gz-cmake but the benefits in terms of creating portable code and
time spend by the loader could be relevant.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
time spend by the loader could be relevant.
reducing the time spent by the loader could be significant.

by default. This is a potential breaking changed for projects using
gz-cmake but the benefits in terms of creating portable code and
time spend by the loader could be relevant.
To avoid this change, the EXPOSE_SYMBOLS_BY_DEFAULT flag can be used in
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
To avoid this change, the EXPOSE_SYMBOLS_BY_DEFAULT flag can be used in
To avoid this change, the `EXPOSE_SYMBOLS_BY_DEFAULT` flag can be used in

Comment on lines +18 to +19
the gz_configure_project call.
The change deprecates the HIDDEN_SYMBOLS_BY_DEFAULT flag that can be
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
the gz_configure_project call.
The change deprecates the HIDDEN_SYMBOLS_BY_DEFAULT flag that can be
the `gz_configure_project` call.
The change deprecates the `HIDDEN_SYMBOLS_BY_DEFAULT` flag that can be

Co-authored-by: Addisu Z. Taddese <[email protected]>
Signed-off-by: Jose Luis Rivero <[email protected]>
Copy link
Contributor Author

@j-rivero j-rivero left a comment

Choose a reason for hiding this comment

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

Thanks!

@j-rivero j-rivero merged commit 646292a into main Jan 26, 2024
4 of 7 checks passed
@j-rivero j-rivero deleted the jrivero/visibility_hidden_by_default branch January 26, 2024 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants