-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
mark fmt::formatter<..>::format() const #1566
Conversation
d34e56f
to
2fee665
Compare
Hi @tchaikov, thanks for the PR, it seems like fmt update to 11 is a breaking change, and signature for the |
@Yaraslaut , i would like to have atomic changes if possible, and each change should focus on one thing only. so if we are switching to |
let's see then if we can bump fmt version in install-deps scripts |
Oh, sorry @tchaikov I though that we need to update fmt version, looks like only clang-format is required and then we can merge |
mark all `fmt::formatter<..>::format()` with const specifier. otherwise the tree does not build with fmt 11, like: ``` /usr/include/fmt/base.h: In instantiation of ‘static void fmt::v11::detail::value<Context>::format_custom_arg(void*, typename Context::parse_context_type&, Context&) [with T = crispy::native_handle<int, -1>; Formatter = fmt::v11::formatter<crispy::native_handle<int, -1> >; Context = fmt::v11::context; typename Context::parse_context_type = fmt::v11::basic_format_parse_context<char>]’: /usr/include/fmt/base.h:1373:19: required from ‘constexpr fmt::v11::detail::value<Context>::value(T&) [with T = const crispy::native_handle<int, -1>; Context = fmt::v11::context]’ 1373 | custom.format = format_custom_arg< | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ 1374 | value_type, typename Context::template formatter_type<value_type>>; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/fmt/base.h:1631:41: required from ‘constexpr fmt::v11::detail::format_arg_store<Context, NUM_ARGS, 0, DESC> fmt::v11::make_format_args(T& ...) [with Context = context; T = {const crispy::native_handle<int, -1>}; long unsigned int NUM_ARGS = 1; long unsigned int NUM_NAMED_ARGS = 0; long long unsigned int DESC = 15; typename std::enable_if<(NUM_NAMED_ARGS == 0), int>::type <anonymous> = 0]’ 1631 | return {arg_mapper<Context>().map(val)}; | ^ /builddir/build/BUILD/contour-terminal-0.4.3.6442-build/contour-0.4.3.6442/src/crispy/logstore.h:111:59: required from ‘logstore::message_builder& logstore::message_builder::operator()(std::string_view, const Ts& ...) [with Ts = {crispy::native_handle<int, -1>}; std::string_view = std::basic_string_view<char>]’ 111 | _buffer += fmt::vformat(fmt, fmt::make_format_args(args...)); | ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~ /builddir/build/BUILD/contour-terminal-0.4.3.6442-build/contour-0.4.3.6442/src/vtpty/UnixPty.cpp:215:13: required from here 215 | ptyLog()("PTY destroying master (file descriptor {}).", _masterFd); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/include/fmt/base.h:1392:29: error: passing ‘const fmt::v11::formatter<crispy::native_handle<int, -1> >’ as ‘this’ argument discards qualifiers [-fpermissive] 1392 | ctx.advance_to(cf.format(*static_cast<qualified_type*>(arg), ctx)); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /builddir/build/BUILD/contour-terminal-0.4.3.6442-build/contour-0.4.3.6442/src/vtpty/UnixPty.h:8: ``` Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2fee665
to
9515551
Compare
v2:
|
Thanks @tchaikov I will merge it now |
It seems that the build failed after the bump to fmt 11 in install-deps scripts. https://github.com/topazus/contour/actions/runs/9969117451/job/27545529480?pr=5 |
@topazus hi Felix, we might need to have contour-terminal/boxed-cpp#24 also to build with fmt 11. |
Thanks for contour-terminal/boxed-cpp#24 @tchaikov , I will try to update #1463 to merge it and then we can bump boxed-cpp version |
Thanks. The build succeeded with the lastest release of boxed-cpp |
otherwise the tree does not build with fmt 11, like:
Description
Describe your changes in detail
Motivation and Context
Why is this change required? What problem does it solve?
How Has This Been Tested?
Checklist:
Go over all the following points, and put an
x
in all the boxes that apply.If you're unsure about any of these, don't hesitate to ask. We're here to help!
CONTRIBUTING
document in my spoken language, and understand the terms