[PR #360] [CLOSED] [MooncakeStore] Update vendored fmtlib to v11.2.0 to fix GCC-14.2 war… #1512

Closed
opened 2026-10-29 21:28:05 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/Mooncake/pull/360
Author: @tchaikov
Created: 5/13/2025
Status: ❌ Closed

Base: main ← Head: store-bump-up-fmt


📝 Commits (3)

  • 0d483a8 [CI] Add typos.toml to exclude fmtlib from typo checks
  • 8019ac9 [MooncakeStore] Update vendored fmtlib to v11.2.0 to fix GCC-14.2 warning
  • 518aea7 [MooncakeStore] Replace fmt/core.h with fmt/base.h

📊 Changes

17 files changed (+11827 additions, -9048 deletions)

View changed files

➕ .typos.toml (+5 -0)
📝 mooncake-store/include/cachelib_memory_allocator/SlabAllocator.h (+1 -1)
📝 mooncake-store/include/cachelib_memory_allocator/include/fmt/args.h (+85 -97)
➕ mooncake-store/include/cachelib_memory_allocator/include/fmt/base.h (+2989 -0)
📝 mooncake-store/include/cachelib_memory_allocator/include/fmt/chrono.h (+1670 -648)
📝 mooncake-store/include/cachelib_memory_allocator/include/fmt/color.h (+292 -282)
📝 mooncake-store/include/cachelib_memory_allocator/include/fmt/compile.h (+152 -252)
📝 mooncake-store/include/cachelib_memory_allocator/include/fmt/core.h (+4 -3001)
📝 mooncake-store/include/cachelib_memory_allocator/include/fmt/format-inl.h (+1160 -1832)
📝 mooncake-store/include/cachelib_memory_allocator/include/fmt/format.h (+3249 -1835)
➖ mooncake-store/include/cachelib_memory_allocator/include/fmt/locale.h (+0 -2)
📝 mooncake-store/include/cachelib_memory_allocator/include/fmt/os.h (+177 -265)
📝 mooncake-store/include/cachelib_memory_allocator/include/fmt/ostream.h (+118 -132)
📝 mooncake-store/include/cachelib_memory_allocator/include/fmt/printf.h (+287 -306)
📝 mooncake-store/include/cachelib_memory_allocator/include/fmt/ranges.h (+658 -276)
➕ mooncake-store/include/cachelib_memory_allocator/include/fmt/std.h (+728 -0)
📝 mooncake-store/include/cachelib_memory_allocator/include/fmt/xchar.h (+252 -119)

📄 Description

Fix compiler warning when building with GCC-14.2 related to a potentially dangling reference in the format_arg_store implementation. The latest fmtlib stable release (v11.2.0) resolves this issue by changing how format_arg_store is defined.

This update ensures clean builds with newer GCC versions while maintaining compatibility with our existing code.

The specific warning was:

[5/18] Building CXX object mooncake-store/src/cachelib_memory_allocator/CMakeFiles/cachelib_memory_allocator.dir/SlabAllocator.cpp.o
In file included from /home/kefu/dev/Mooncake/mooncake-store/include/cachelib_memory_allocator/SlabAllocator.h:26,
                 from /home/kefu/dev/Mooncake/mooncake-store/src/cachelib_memory_allocator/SlabAllocator.cpp:17:
/home/kefu/dev/Mooncake/mooncake-store/include/cachelib_memory_allocator/include/fmt/core.h: In instantiation of ‘constexpr fmt::v8::detail::value<Context> fmt::v8::detail::make_arg(const T&) [with bool IS_PACKED = true; Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; type <anonymous> = fmt::v8::detail::type::string_type; T = fmt::v8::basic_string_view<char>; typename std::enable_if<IS_PACKED, int>::type <anonymous> = 0]’:
/home/kefu/dev/Mooncake/mooncake-store/include/cachelib_memory_allocator/include/fmt/core.h:1694:64:   required from ‘constexpr fmt::v8::format_arg_store<Context, Args>::format_arg_store(const Args& ...) [with Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; Args = {fmt::v8::basic_string_view<char>, char [3]}]’
 1692 |         data_{detail::make_arg<
      |               ~~~~~~~~~~~~~~~~~
 1693 |             is_packed, Context,
      |             ~~~~~~~~~~~~~~~~~~~
 1694 |             detail::mapped_type_constant<Args, Context>::value>(args)...} {
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
/home/kefu/dev/Mooncake/mooncake-store/include/cachelib_memory_allocator/include/fmt/core.h:1710:18:   required from ‘OutputIt fmt::v8::format_to(OutputIt, format_string<T ...>, T&& ...) [with OutputIt = appender; T = {basic_string_view<char>&, const char (&)[3]}; typename std::enable_if<detail::is_output_iterator<OutputIt, char>::value, int>::type <anonymous> = 0; format_string<T ...> = basic_format_string<char, basic_string_view<char>&, const char (&)[3]>]’
 1710 |   return {args...};
      |                  ^
/home/kefu/dev/Mooncake/mooncake-store/include/cachelib_memory_allocator/include/fmt/format-inl.h:74:14:   required from here
   74 |     format_to(it, FMT_STRING("{}{}"), message, SEP);
      |     ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/kefu/dev/Mooncake/mooncake-store/include/cachelib_memory_allocator/include/fmt/core.h:2915:52:   in ‘constexpr’ expansion of ‘fmt::v8::make_format_args<>(((const fmt::v8::basic_string_view<char>&)args#0), args#1)’
/home/kefu/dev/Mooncake/mooncake-store/include/cachelib_memory_allocator/include/fmt/core.h:1566:15: warning: possibly dangling reference to a temporary [-Wdangling-reference]
 1566 |   const auto& arg = arg_mapper<Context>().map(val);
      |               ^~~
/home/kefu/dev/Mooncake/mooncake-store/include/cachelib_memory_allocator/include/fmt/core.h:1566:46: note: the temporary was destroyed at the end of the full expression ‘fmt::v8::detail::arg_mapper<fmt::v8::basic_format_context<fmt::v8::appender, char> >().fmt::v8::detail::arg_mapper<fmt::v8::basic_format_context<fmt::v8::appender, char> >::map<fmt::v8::basic_string_view<char> >((* & val))’
 1566 |   const auto& arg = arg_mapper<Context>().map(val);
      |                     ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/Mooncake/pull/360 **Author:** [@tchaikov](https://github.com/tchaikov) **Created:** 5/13/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `store-bump-up-fmt` --- ### 📝 Commits (3) - [`0d483a8`](https://github.com/kvcache-ai/Mooncake/commit/0d483a812d1be0b5559b31916ba8baaad2777107) [CI] Add typos.toml to exclude fmtlib from typo checks - [`8019ac9`](https://github.com/kvcache-ai/Mooncake/commit/8019ac96bd6e729851db3bd239f69f4cb4d2c06e) [MooncakeStore] Update vendored fmtlib to v11.2.0 to fix GCC-14.2 warning - [`518aea7`](https://github.com/kvcache-ai/Mooncake/commit/518aea7454fec33952fc5a53809f29457d340902) [MooncakeStore] Replace fmt/core.h with fmt/base.h ### 📊 Changes **17 files changed** (+11827 additions, -9048 deletions) <details> <summary>View changed files</summary> ➕ `.typos.toml` (+5 -0) 📝 `mooncake-store/include/cachelib_memory_allocator/SlabAllocator.h` (+1 -1) 📝 `mooncake-store/include/cachelib_memory_allocator/include/fmt/args.h` (+85 -97) ➕ `mooncake-store/include/cachelib_memory_allocator/include/fmt/base.h` (+2989 -0) 📝 `mooncake-store/include/cachelib_memory_allocator/include/fmt/chrono.h` (+1670 -648) 📝 `mooncake-store/include/cachelib_memory_allocator/include/fmt/color.h` (+292 -282) 📝 `mooncake-store/include/cachelib_memory_allocator/include/fmt/compile.h` (+152 -252) 📝 `mooncake-store/include/cachelib_memory_allocator/include/fmt/core.h` (+4 -3001) 📝 `mooncake-store/include/cachelib_memory_allocator/include/fmt/format-inl.h` (+1160 -1832) 📝 `mooncake-store/include/cachelib_memory_allocator/include/fmt/format.h` (+3249 -1835) ➖ `mooncake-store/include/cachelib_memory_allocator/include/fmt/locale.h` (+0 -2) 📝 `mooncake-store/include/cachelib_memory_allocator/include/fmt/os.h` (+177 -265) 📝 `mooncake-store/include/cachelib_memory_allocator/include/fmt/ostream.h` (+118 -132) 📝 `mooncake-store/include/cachelib_memory_allocator/include/fmt/printf.h` (+287 -306) 📝 `mooncake-store/include/cachelib_memory_allocator/include/fmt/ranges.h` (+658 -276) ➕ `mooncake-store/include/cachelib_memory_allocator/include/fmt/std.h` (+728 -0) 📝 `mooncake-store/include/cachelib_memory_allocator/include/fmt/xchar.h` (+252 -119) </details> ### 📄 Description Fix compiler warning when building with GCC-14.2 related to a potentially dangling reference in the format_arg_store implementation. The latest fmtlib stable release (v11.2.0) resolves this issue by changing how format_arg_store is defined. This update ensures clean builds with newer GCC versions while maintaining compatibility with our existing code. The specific warning was: ``` [5/18] Building CXX object mooncake-store/src/cachelib_memory_allocator/CMakeFiles/cachelib_memory_allocator.dir/SlabAllocator.cpp.o In file included from /home/kefu/dev/Mooncake/mooncake-store/include/cachelib_memory_allocator/SlabAllocator.h:26, from /home/kefu/dev/Mooncake/mooncake-store/src/cachelib_memory_allocator/SlabAllocator.cpp:17: /home/kefu/dev/Mooncake/mooncake-store/include/cachelib_memory_allocator/include/fmt/core.h: In instantiation of ‘constexpr fmt::v8::detail::value<Context> fmt::v8::detail::make_arg(const T&) [with bool IS_PACKED = true; Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; type <anonymous> = fmt::v8::detail::type::string_type; T = fmt::v8::basic_string_view<char>; typename std::enable_if<IS_PACKED, int>::type <anonymous> = 0]’: /home/kefu/dev/Mooncake/mooncake-store/include/cachelib_memory_allocator/include/fmt/core.h:1694:64: required from ‘constexpr fmt::v8::format_arg_store<Context, Args>::format_arg_store(const Args& ...) [with Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; Args = {fmt::v8::basic_string_view<char>, char [3]}]’ 1692 | data_{detail::make_arg< | ~~~~~~~~~~~~~~~~~ 1693 | is_packed, Context, | ~~~~~~~~~~~~~~~~~~~ 1694 | detail::mapped_type_constant<Args, Context>::value>(args)...} { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ /home/kefu/dev/Mooncake/mooncake-store/include/cachelib_memory_allocator/include/fmt/core.h:1710:18: required from ‘OutputIt fmt::v8::format_to(OutputIt, format_string<T ...>, T&& ...) [with OutputIt = appender; T = {basic_string_view<char>&, const char (&)[3]}; typename std::enable_if<detail::is_output_iterator<OutputIt, char>::value, int>::type <anonymous> = 0; format_string<T ...> = basic_format_string<char, basic_string_view<char>&, const char (&)[3]>]’ 1710 | return {args...}; | ^ /home/kefu/dev/Mooncake/mooncake-store/include/cachelib_memory_allocator/include/fmt/format-inl.h:74:14: required from here 74 | format_to(it, FMT_STRING("{}{}"), message, SEP); | ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/kefu/dev/Mooncake/mooncake-store/include/cachelib_memory_allocator/include/fmt/core.h:2915:52: in ‘constexpr’ expansion of ‘fmt::v8::make_format_args<>(((const fmt::v8::basic_string_view<char>&)args#0), args#1)’ /home/kefu/dev/Mooncake/mooncake-store/include/cachelib_memory_allocator/include/fmt/core.h:1566:15: warning: possibly dangling reference to a temporary [-Wdangling-reference] 1566 | const auto& arg = arg_mapper<Context>().map(val); | ^~~ /home/kefu/dev/Mooncake/mooncake-store/include/cachelib_memory_allocator/include/fmt/core.h:1566:46: note: the temporary was destroyed at the end of the full expression ‘fmt::v8::detail::arg_mapper<fmt::v8::basic_format_context<fmt::v8::appender, char> >().fmt::v8::detail::arg_mapper<fmt::v8::basic_format_context<fmt::v8::appender, char> >::map<fmt::v8::basic_string_view<char> >((* & val))’ 1566 | const auto& arg = arg_mapper<Context>().map(val); | ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 21:28:05 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#1512
No description provided.