Skip to content

io_tester: disambiguate sstring streaming to YAML::Emitter#284

Merged
dotnwat merged 1 commit into
redpanda-data:v26.2.xfrom
travisdowns:td-io-tester-yaml-fix-26.2
Jun 11, 2026
Merged

io_tester: disambiguate sstring streaming to YAML::Emitter#284
dotnwat merged 1 commit into
redpanda-data:v26.2.xfrom
travisdowns:td-io-tester-yaml-fix-26.2

Conversation

@travisdowns

Copy link
Copy Markdown
Member

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 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 io_tester build:

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.

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.
Copilot AI review requested due to automatic review settings June 11, 2026 19:04

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 sstring to std::string before streaming into YAML::Emitter.
  • Convert class name keys from sstring to std::string before streaming into YAML::Emitter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@travisdowns travisdowns requested a review from dotnwat June 11, 2026 19:06
@dotnwat dotnwat merged commit 833472b into redpanda-data:v26.2.x Jun 11, 2026
20 checks passed
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

Successfully merging this pull request may close these issues.

3 participants