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

Broken ABI in 7.1.0 without SONAME change #1961

Closed
himikof opened this issue Oct 27, 2020 · 2 comments
Closed

Broken ABI in 7.1.0 without SONAME change #1961

himikof opened this issue Oct 27, 2020 · 2 comments

Comments

@himikof
Copy link

himikof commented Oct 27, 2020

In a recent 7.1.0 release, this change was made:

-extern template format_context::iterator detail::vformat_to(
-    detail::buffer<char>&, string_view, basic_format_args<format_context>);
+extern template void detail::vformat_to(detail::buffer<char>&, string_view,
+                                        basic_format_args<format_context>,
+                                        detail::locale_ref);

The old version of this function was a part of the exported library ABI, leading to the following error when linking together with the new library version:

spdlog.cpp:function spdlog::details::M_formatterspdlog::details::null_scoped_padder::format(spdlog::details::log_msg const&, tm const&, fmt::v7::basic_memory_buffer<char, 250ul, std::allocator >&): error: undefined reference to 'fmt::v7::basic_format_context<std::back_insert_iterator<fmt::v7::detail::buffer >, char>::iterator fmt::v7::detail::vformat_to(fmt::v7::detail::buffer&, fmt::v7::basic_string_view, fmt::v7::basic_format_args<fmt::v7::basic_format_context<std::back_insert_iterator<fmt::v7::detail::buffer<fmt::v7::type_identity::type> >, fmt::v7::type_identity::type> >)'

If this ABI break is intended, shouldn't the SOVERSION in CMakeLists.txt be set to something other than the major library version (7), or this release should have been 8.0.0 instead?

I haven't actually checked if there are other problems with the ABI in this release, because the full set of changes is huge. I suggest keeping a list of expected exported symbols in the source repository and checking for an exact match in CI to help catching these sorts of ABI breaks before release. Downstream consumers start to rely on a shared fmt library in many places (which is great!), and keeping the ABI stability and the SONAME in sync is generally expected.

@eli-schwartz
Copy link

Same thing happened in the past e.g. #1471

@vitaut
Copy link
Contributor

vitaut commented Oct 29, 2020

Fixed in 4081b2f. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants