Skip to content

rgw: format the URL port through std::string_view - #70993

Merged
tchaikov merged 1 commit into
ceph:mainfrom
tchaikov:wip-rgw-fmt
Aug 14, 2026
Merged

tchaikov merged 1 commit into
ceph:mainfrom
tchaikov:wip-rgw-fmt

Conversation

@tchaikov

Copy link
Copy Markdown
Contributor

Building against system fmt 10 fails:

  /usr/include/fmt/core.h:2548:45: error: 'fmt::v10::detail::type_is_unformattable_for<boost::core::basic_string_view<char>, char> _' has incomplete type
  /usr/include/fmt/core.h:1580:7: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt

url_view::port() returns a boost::core::string_view. It does convert to std::string_view, but only through a template conversion operator, and the trait fmt uses to decide whether an argument is string-like does not look through those until fmt 11. The other argument is fine: host() goes through the token API and hands back a std::string.

Do the conversion at the call site. src/CMakeLists.txt takes system fmt anywhere from 8.1.1 to 11.1.4, so this has to compile against the old ones as well, and the bundled 11.1.4 does not care either way.

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

Building against system fmt 10 fails:

  /usr/include/fmt/core.h:2548:45: error: 'fmt::v10::detail::type_is_unformattable_for<boost::core::basic_string_view<char>, char> _' has incomplete type
  /usr/include/fmt/core.h:1580:7: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt

url_view::port() returns a boost::core::string_view. It does convert to
std::string_view, but only through a template conversion operator, and
the trait fmt uses to decide whether an argument is string-like does not
look through those until fmt 11. The other argument is fine: host() goes
through the token API and hands back a std::string.

Do the conversion at the call site. src/CMakeLists.txt takes system fmt
anywhere from 8.1.1 to 11.1.4, so this has to compile against the old
ones as well, and the bundled 11.1.4 does not care either way.

Signed-off-by: Kefu Chai <[email protected]>
@github-actions github-actions Bot added the rgw label Aug 12, 2026
@tchaikov
tchaikov marked this pull request as ready for review August 12, 2026 06:48
@tchaikov
tchaikov requested a review from a team as a code owner August 12, 2026 06:48
@anrao19

anrao19 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

pr testing completed and approved by @ivancich , more details in : https://tracker.ceph.com/issues/79449
@tchaikov, if there no further testing is needed then this pr can be merged

@tchaikov
tchaikov merged commit 50efa7c into ceph:main Aug 14, 2026
7 of 8 checks passed
@tchaikov

Copy link
Copy Markdown
Contributor Author

@anrao19 thanks for testing! merged.

@tchaikov
tchaikov deleted the wip-rgw-fmt branch August 14, 2026 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants