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

ign -> gz Migrate Ignition Headers : gz-math #483

Merged
merged 2 commits into from
Aug 30, 2022

Conversation

methylDragon
Copy link
Contributor

@codecov
Copy link

codecov bot commented Aug 12, 2022

Codecov Report

Merging #483 (12010bb) into ign-math6 (29e3f41) will not change coverage.
The diff coverage is 99.87%.

❗ Current head 12010bb differs from pull request most recent head 2b65247. Consider uploading reports for the commit 2b65247 to get more accurate results

@@            Coverage Diff             @@
##           ign-math6     #483   +/-   ##
==========================================
  Coverage      99.68%   99.68%           
==========================================
  Files             73       73           
  Lines           6913     6913           
==========================================
  Hits            6891     6891           
  Misses            22       22           
Impacted Files Coverage Δ
include/gz/math/detail/Capsule.hh 96.49% <ø> (ø)
include/gz/math/detail/Cylinder.hh 100.00% <ø> (ø)
include/gz/math/detail/Ellipsoid.hh 100.00% <ø> (ø)
include/gz/math/detail/WellOrderedVector.hh 100.00% <ø> (ø)
include/gz/math/graph/Graph.hh 100.00% <ø> (ø)
include/gz/math/graph/GraphAlgorithms.hh 100.00% <ø> (ø)
include/gz/math/graph/Vertex.hh 100.00% <ø> (ø)
src/Angle.cc 100.00% <ø> (ø)
src/AxisAlignedBox.cc 100.00% <ø> (ø)
src/Color.cc 98.58% <ø> (ø)
... and 102 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@chapulina chapulina added the ign to gz Renaming Ignition to Gazebo. label Aug 15, 2022
@methylDragon methylDragon force-pushed the citadel_header_redirects branch 9 times, most recently from a46935b to fd1ffb9 Compare August 19, 2022 19:24
@methylDragon methylDragon changed the title ign -> gz Reverse Ignition Headers : gz-math ign -> gz Migrate Ignition Headers : gz-math Aug 22, 2022
@scpeters
Copy link
Member

I've been looking at the abichecker CI failures, and I think it's a problem that the classes are defined in the gz namespace. I've checked the symbols using nm on a .so file from this branch, and there are no ignition:: symbols in the library, so I believe this approach breaks ABI.

We can use the namespace gz { using namespace ignition; } trick, but I think the class definitions need to remain in the ignition namespace

@methylDragon methylDragon force-pushed the citadel_header_redirects branch 8 times, most recently from 0fad0f7 to 0fc7ef2 Compare August 26, 2022 07:43
@methylDragon
Copy link
Contributor Author

methylDragon commented Aug 26, 2022

I've been looking at the abichecker CI failures, and I think it's a problem that the classes are defined in the gz namespace. I've checked the symbols using nm on a .so file from this branch, and there are no ignition:: symbols in the library, so I believe this approach breaks ABI.

We can use the namespace gz { using namespace ignition; } trick, but I think the class definitions need to remain in the ignition namespace

I got this to work, and I'll copy paste my notes regarding my approach here:

  • To not break ABI, the headers need to be using the ignition namespace, and the ignition namespace needs to be the "primary" namespace. So I'm back to using reverse redirection (any gz namespaces will be using ignition )
    • To this end, I've put the namespace directives in config.hh for BOTH gz and ignition
  • For msgs, since generation happens automatically with protoc, I can't force the headers to use ignition (it's directory dependent), so I can't migrate them to gz. msgs will hence not be migrated in Citadel (and Fortress)
  • I've tried my best to migrate in-source namespace declarations to gz, but this cannot happen in a sweeping manner across the board, so there will be some interspersing of ignition and gz, but the diffs should be reduced, which still fits with the goal of making forward/backports easier. Some instances of these exceptions include:
    • Some packages don't use config.hh , so can't pick up the namespace redirections (common, plugin, fuel-tools)
    • Sometimes the redirections don't apply to namespace XXX declarations, so those aren't migrated
    • Some gz:: usages don't work (e.g. inside an explicitly ignition namespaced class)

@scpeters
Copy link
Member

nice work on fixing the ABI checker.

how do you feel about squashing the last commit (0fc7ef2) into the second commit (9309be0)?

@methylDragon
Copy link
Contributor Author

nice work on fixing the ABI checker.

how do you feel about squashing the last commit (0fc7ef2) into the second commit (9309be0)?

Once everything is ok, I'll squash all the commits into the second commit (leaving the first commit (the move) alone) for the rebase-merge!

@methylDragon methylDragon force-pushed the citadel_header_redirects branch from 0fc7ef2 to 1d94041 Compare August 26, 2022 18:56
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

Great work, the general idea is ok to me, I just have some minor comments / questions

// Make sure the ignition namespace still works
TEST(Deprecated, IgnitionNamespace)
{
gz::math::Angle angle;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be

Suggested change
gz::math::Angle angle;
ignition::math::Angle angle;

include/ignition/math/config.hh Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
Signed-off-by: methylDragon <methylDragon@gmail.com>
methylDragon added a commit that referenced this pull request Aug 30, 2022
Signed-off-by: methylDragon <methylDragon@gmail.com>
@methylDragon methylDragon force-pushed the citadel_header_redirects branch from 90dcc7c to 612cccb Compare August 30, 2022 20:47
methylDragon added a commit that referenced this pull request Aug 30, 2022
Signed-off-by: methylDragon <methylDragon@gmail.com>
@methylDragon methylDragon force-pushed the citadel_header_redirects branch from 612cccb to 6925fe9 Compare August 30, 2022 20:57
Signed-off-by: methylDragon <methylDragon@gmail.com>
@methylDragon methylDragon force-pushed the citadel_header_redirects branch from 6925fe9 to 2b65247 Compare August 30, 2022 20:57
@methylDragon methylDragon merged commit 6de6120 into ign-math6 Aug 30, 2022
@methylDragon methylDragon deleted the citadel_header_redirects branch August 30, 2022 23:38
methylDragon added a commit that referenced this pull request Aug 30, 2022
Signed-off-by: methylDragon <methylDragon@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏰 citadel Ignition Citadel 🏯 fortress Ignition Fortress ign to gz Renaming Ignition to Gazebo.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants