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

Downstream packages may have ABI issues if GZ_*_VERSION_NAMESPACE is not defined #412

Open
4 tasks done
scpeters opened this issue Feb 6, 2024 · 1 comment
Open
4 tasks done
Labels
bug Something isn't working

Comments

@scpeters
Copy link
Member

scpeters commented Feb 6, 2024

Environment

  • OS Version:
  • Source or binary build?

Description

  • Expected behavior: The GZ_*_VERSION_NAMESPACE macro should be defined in the config.hh.in file for each package
  • Actual behavior: It is not defined in some packages, and then when you add it in, it can change ABI (first noticed in Merge 6 ➡️ 7 gz-physics#594 (comment)

Fixes needed on main

Output

I have several gz-* packages installed on my macOS laptop, and gripping for VERSION_NAMESPACE in the output of nm shows that this macro definition is missing for several packages:

$ for lib in $(ls /usr/local/lib/libgz-* | grep -v '[0-9]\.[0-9]' | grep -v '\.[0-9]*\.dylib' | grep 'libgz-[a-z0-9]*.dylib'); do echo $lib;  nm $lib | c++filt | grep VERSION_NAMESPACE; done
libgz-common5.dylib
libgz-common6.dylib
libgz-gui7.dylib
libgz-gui8.dylib
libgz-gui9.dylib
000000000004a15e T gz::gui::GZ_GUI_VERSION_NAMESPACE::getInstallPrefix()
000000000002791c T gz::gui::GZ_GUI_VERSION_NAMESPACE::getPluginInstallDir()
libgz-launch7.dylib
00000000000045fe T gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Manager::Stop()
0000000000003be6 T gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Manager::RunConfig(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)
0000000000003b26 T gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Manager::Manager()
00000000000038e0 T gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Manager::Manager()
0000000000003bdc T gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Manager::~Manager()
0000000000003b30 T gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Manager::~Manager()
000000000000d4da t gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>::SpecializedPlugin()
000000000000d578 t gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>::~SpecializedPlugin()
000000000000d56a t gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>::~SpecializedPlugin()
000000000000d95e t gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>::TemplatePluginPtr(gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>> const&)
000000000000d468 t gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>::TemplatePluginPtr<gz::plugin::Plugin>(gz::plugin::TemplatePluginPtr<gz::plugin::Plugin> const&)
000000000000d8d0 t gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>::Hash() const
000000000000d924 t gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>::operator==(gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>> const&) const
0000000000007c14 t std::__1::unordered_set<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::hash<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::equal_to<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> gz::plugin::Loader::PluginsImplementing<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>() const
000000000000dacc t void std::__1::__hash_table<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>, std::__1::hash<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>, std::__1::equal_to<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>, std::__1::allocator<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>>::__do_rehash<true>(unsigned long)
0000000000008ed8 t std::__1::__hash_table<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>, std::__1::hash<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>, std::__1::equal_to<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>, std::__1::allocator<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>>::__deallocate_node(std::__1::__hash_node_base<std::__1::__hash_node<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>, void*>*>*)
000000000000d846 t std::__1::unique_ptr<std::__1::__hash_node<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>, void*>, std::__1::__hash_node_destructor<std::__1::allocator<std::__1::__hash_node<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>, void*>>>> std::__1::__hash_table<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>, std::__1::hash<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>, std::__1::equal_to<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>, std::__1::allocator<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>>::__construct_node_hash<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>> const&>(unsigned long, gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>> const&)
000000000000d5d8 t std::__1::pair<std::__1::__hash_iterator<std::__1::__hash_node<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>, void*>*>, bool> std::__1::__hash_table<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>, std::__1::hash<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>, std::__1::equal_to<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>, std::__1::allocator<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>>::__emplace_unique_key_args<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>, gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>> const&>(gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>> const&, gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>> const&)
0000000000008e8a t std::__1::__hash_table<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>, std::__1::hash<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>, std::__1::equal_to<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>, std::__1::allocator<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>>::clear()
000000000000d9d8 t void std::__1::__hash_table<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>, std::__1::hash<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>, std::__1::equal_to<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>, std::__1::allocator<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>>::__rehash<true>(unsigned long)
0000000000008f16 t std::__1::__hash_table<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>, std::__1::hash<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>, std::__1::equal_to<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>, std::__1::allocator<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>>>::~__hash_table()
000000000000dbfc t std::__1::__hash_node_destructor<std::__1::allocator<std::__1::__hash_node<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>, void*>>>::operator()[abi:v15006](std::__1::__hash_node<gz::plugin::TemplatePluginPtr<gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>>, void*>*)
0000000000010280 S typeinfo for gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>
000000000000f377 S typeinfo name for gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin
000000000000f3a8 S typeinfo name for gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>
0000000000010230 s vtable for gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>
000000000000d5ae t virtual thunk to gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>::~SpecializedPlugin()
000000000000d598 t virtual thunk to gz::plugin::SpecializedPlugin<gz::launch::GZ_LAUNCH_VERSION_NAMESPACE::Plugin>::~SpecializedPlugin()
libgz-math7.dylib
libgz-math8.dylib
libgz-msgs10.dylib
libgz-msgs11.dylib
libgz-msgs9.dylib
libgz-physics6.dylib
0000000000004238 T gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::checkWindowsPath(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>)
000000000000ec40 T gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::getInstallPrefix()
00000000000048f5 T gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::getEngineInstallDir()
000000000000468f T gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::joinPaths(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)
0000000000004190 T gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::separator(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)
00000000000047ec t gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::joinPaths(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)::$_0::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, bool) const
libgz-physics7.dylib
0000000000004238 T gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::checkWindowsPath(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>)
000000000000ec40 T gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::getInstallPrefix()
00000000000048f5 T gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::getEngineInstallDir()
000000000000468f T gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::joinPaths(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)
0000000000004190 T gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::separator(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)
00000000000047ec t gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::joinPaths(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)::$_0::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, bool) const
libgz-physics8.dylib
0000000000004228 T gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::checkWindowsPath(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>)
000000000000ec30 T gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::getInstallPrefix()
00000000000048e5 T gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::getEngineInstallDir()
000000000000467f T gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::joinPaths(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)
0000000000004180 T gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::separator(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)
00000000000047dc t gz::physics::GZ_PHYSICS_VERSION_NAMESPACE::joinPaths(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&)::$_0::operator()(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, bool) const
libgz-plugin2.dylib
libgz-plugin3.dylib
libgz-rendering7.dylib
libgz-rendering8.dylib
libgz-rendering9.dylib
libgz-sensors7.dylib
libgz-sensors8.dylib
libgz-sensors9.dylib
libgz-sim7.dylib
libgz-sim8.dylib
000000000009eef7 t gz::msgs::GZ_MSGS_VERSION_NAMESPACE::Set(gz::msgs::SphericalCoordinates*, gz::math::v7::SphericalCoordinates const&)
000000000002b72b t gz::msgs::GZ_MSGS_VERSION_NAMESPACE::Set(gz::msgs::Inertial*, gz::math::v7::Inertial<double> const&)
00000000000f8688 t gz::msgs::GZ_MSGS_VERSION_NAMESPACE::Set(gz::math::v7::SphericalCoordinates*, gz::msgs::SphericalCoordinates const&)
000000000002c15a t gz::msgs::GZ_MSGS_VERSION_NAMESPACE::Set(gz::math::v7::Inertial<double>*, gz::msgs::Inertial const&)
libgz-sim9.dylib
000000000009e8c7 t gz::msgs::GZ_MSGS_VERSION_NAMESPACE::Set(gz::msgs::SphericalCoordinates*, gz::math::v8::SphericalCoordinates const&)
000000000002b47b t gz::msgs::GZ_MSGS_VERSION_NAMESPACE::Set(gz::msgs::Inertial*, gz::math::v8::Inertial<double> const&)
00000000000f8598 t gz::msgs::GZ_MSGS_VERSION_NAMESPACE::Set(gz::math::v8::SphericalCoordinates*, gz::msgs::SphericalCoordinates const&)
000000000002beaa t gz::msgs::GZ_MSGS_VERSION_NAMESPACE::Set(gz::math::v8::Inertial<double>*, gz::msgs::Inertial const&)
libgz-transport12.dylib
libgz-transport13.dylib
libgz-transport14.dylib
libgz-utils2.dylib
libgz-utils3.dylib
@scpeters scpeters added the bug Something isn't working label Feb 6, 2024
scpeters added a commit to gazebosim/gz-gui that referenced this issue Feb 16, 2024
scpeters added a commit to gazebosim/gz-launch that referenced this issue Feb 16, 2024
scpeters added a commit to gazebosim/gz-msgs that referenced this issue Feb 16, 2024
This includes gz/msgs/config.hh wherever the
GZ_MSGS_VERSION_NAMESPACE macro is used in order
to provide the macro definition.

Part of gazebosim/gz-cmake#412.

Signed-off-by: Steve Peters <[email protected]>
mjcarroll pushed a commit to gazebosim/gz-msgs that referenced this issue Feb 20, 2024
This includes gz/msgs/config.hh wherever the
GZ_MSGS_VERSION_NAMESPACE macro is used in order
to provide the macro definition.

Part of gazebosim/gz-cmake#412.

Signed-off-by: Steve Peters <[email protected]>
mjcarroll pushed a commit to gazebosim/gz-gui that referenced this issue Feb 20, 2024
@scpeters
Copy link
Member Author

I believe all our packages are now fixed on main.

@j-rivero did you have thoughts on how to write a test to avoid regressions of this in the future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In progress
Development

No branches or pull requests

1 participant