build: default Seastar_DEPRECATED_OSTREAM_FORMATTERS to OFF#3439
Open
avikivity wants to merge 3 commits into
Open
build: default Seastar_DEPRECATED_OSTREAM_FORMATTERS to OFF#3439avikivity wants to merge 3 commits into
avikivity wants to merge 3 commits into
Conversation
e8e13d5 to
5530dca
Compare
Member
Author
|
v2: convert all tests to prefer fmt to std::ostream |
tchaikov
reviewed
Jun 1, 2026
| std::ignore = co_await i2e(); | ||
| std::ignore = co_await e2i(); | ||
| BOOST_REQUIRE_EQUAL(co_await co_return_vector(0), (std::vector<std::string>{})); | ||
| SEASTAR_BOOST_REQUIRE_EQUAL(co_await co_return_vector(0), (std::vector<std::string>{})); |
Contributor
There was a problem hiding this comment.
we'd need to #include <fmt/ranges.h> to format range-alike types like std::vector<std::string>. see https://godbolt.org/z/5n3KqTjj8 for a reproducer.
Member
Author
There was a problem hiding this comment.
Somehow it builds locally, I'll need to reproduce the CI environment.
5530dca to
f9f60b5
Compare
Member
Author
|
v3:L sprinkled #include <fmt/ranges.h> where needed |
BOOST_REQUIRE_EQUAL and friends print the inputs to show failures using operator<<(std::ostream&, ...). This isn't available for many types with -DSeastar_DEPRECATED_OSTREAM_FORMATTERS=OFF. To make is possible to use -DSeastar_DEPRECATED_OSTREAM_FORMATTERS=OFF, introduce wrappers around that macro family (only available within Seastar itself) to wrap the value with a comparable_formattable wrapper, that supplies comparisons via the type's comparison operators and formatting via fmt. Since not all types have formatters, the wrapper is able to fall back to operator<<. Since the existing tests contain many signed/unsigned comparisons, suppress gcc warnings about them, since apparently Boost.Test does as well. Special-case const char*, as Boost.Test does, by promoting it to a string_view, so it's compared by string value rather than address.
…ents Support data types that don't have std::ostream support, but do have formatters. The two cases disabled by 4b1542d are re-enabled.
In order for us to be able to eventually drop the deprecated functions, we must alert users that they are deprecated by defaulting to OFF.
f9f60b5 to
894fc82
Compare
Member
Author
|
v4: special-case const char* to compare by string value rather than pointer address (following boost.test) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In order for us to be able to eventually drop the deprecated functions, we must alert users that they are deprecated by defaulting to OFF.
Since some tests compare std::vectors which don't have std::ostream formatters, add a wrapper
to funnel printing to a fmt::formatter if available, and fall back to std::ostream if not.