io_tester: disambiguate sstring streaming to YAML::Emitter#284
Merged
dotnwat merged 1 commit intoJun 11, 2026
Merged
Conversation
Newer yaml-cpp (>= 0.8.0) adds an
operator<<(Emitter&, const std::string_view&)
overload alongside the existing const std::string& one. Since
seastar::sstring is implicitly convertible to both std::string and
std::string_view, streaming an sstring directly into a YAML::Emitter
became ambiguous and broke the build (seen on the Alpine CI image):
error: ambiguous overload for 'operator<<'
(operand types are 'YAML::Emitter' and 'seastar::sstring')
Explicitly convert to std::string at the two affected call sites. The
std::string overload has always existed, so this remains correct on
older yaml-cpp versions as well.
There was a problem hiding this comment.
Pull request overview
This PR fixes an io_tester build break with yaml-cpp >= 0.8.0 by disambiguating YAML::Emitter << ... streaming when the streamed value is a seastar::sstring (implicitly convertible to both std::string and std::string_view).
Changes:
- Convert metric name keys from
sstringtostd::stringbefore streaming intoYAML::Emitter. - Convert class name keys from
sstringtostd::stringbefore streaming intoYAML::Emitter.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dotnwat
approved these changes
Jun 11, 2026
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.
Cherry-pick of scylladb#3454 onto v26.2.x.
Newer yaml-cpp (>= 0.8.0) adds an
operator<<(Emitter&, const std::string_view&)overload alongside the existingconst std::string&one. Sinceseastar::sstringis implicitly convertible to bothstd::stringandstd::string_view, streaming an sstring directly into aYAML::Emitterbecame ambiguous and broke the io_tester build:Explicitly convert to
std::stringat the two affected call sites. Thestd::stringoverload has always existed, so this remains correct on older yaml-cpp versions as well.