folly icon indicating copy to clipboard operation
folly copied to clipboard

Build Error on Debian 12: mixing character types in fmt

Open ShamimShahraeini opened this issue 1 year ago • 2 comments

Issue Summary: Encountering build errors while attempting to compile Folly on Debian 12, even after ensuring all dependencies are installed and trying different compiler versions. The error message indicates issues with mixing character types in fmt::v10 during compilation of IPAddress.cpp, IPAddressV4.cpp, and IPAddressV6.cpp.

Error Message:

/root/mc/install/include/fmt/base.h: In instantiation of ‘constexpr fmt::v10::detail::value<Context> fmt::v10::detail::make_arg(T&) [with bool PACKED = true; Context = fmt::v10::context; T = folly::Range<const char*>; typename std::enable_if<PACKED, int>::type <anonymous> = 0]’:
/root/mc/install/include/fmt/base.h:2006:74:   required from ‘constexpr fmt::v10::detail::format_arg_store<Context, NUM_ARGS, 0, DESC> fmt::v10::make_format_args(T& ...) [with Context = fmt::v10::context; T = {folly::Range<const char*>}; 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]’
/root/mc/install/include/fmt/format.h:4386:44:   required from ‘std::string fmt::v10::format(fmt::v10::format_string<T ...>, T&& ...) [with T = {folly::Range<const char*>&}; std::string = std::__cxx11::basic_string<char>; fmt::v10::format_string<T ...> = fmt::v10::basic_format_string<char, folly::Range<const char*>&>]’
/root/mc/pkgs/folly/folly/IPAddress.cpp:102:20:   required from here
/root/mc/install/include/fmt/base.h:1598:17: error: static assertion failed: Mixing character types is disallowed.
 1598 |   static_assert(formattable_char, "Mixing character types is disallowed.");
      |                 ^~~~~~~~~~~~~~~~
/root/mc/install/include/fmt/base.h: In instantiation of ‘constexpr fmt::v10::detail::value<Context> fmt::v10::detail::make_arg(T&) [with bool PACKED = true; Context = fmt::v10::context; T = const folly::Range<const char*>; typename std::enable_if<PACKED, int>::type <anonymous> = 0]’:
/root/mc/install/include/fmt/base.h:2006:74:   required from ‘constexpr fmt::v10::detail::format_arg_store<Context, NUM_ARGS, 0, DESC> fmt::v10::make_format_args(T& ...) [with Context = fmt::v10::context; T = {const folly::Range<const char*>}; 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]’
/root/mc/install/include/fmt/format.h:4386:44:   required from ‘std::string fmt::v10::format(fmt::v10::format_string<T ...>, T&& ...) [with T = {const folly::Range<const char*>&}; std::string = std::__cxx11::basic_string<char>; fmt::v10::format_string<T ...> = fmt::v10::basic_format_string<char, const folly::Range<const char*>&>]’
/root/mc/pkgs/folly/folly/IPAddress.cpp:113:57:   required from here
/root/mc/install/include/fmt/base.h:1598:17: error: static assertion failed: Mixing character types is disallowed.
In file included from /root/mc/install/include/fmt/format.h:54,
                 from /root/mc/pkgs/folly/folly/FBString.h:34,
                 from /root/mc/pkgs/folly/folly/IPAddressV4.h:34,
                 from /root/mc/pkgs/folly/folly/IPAddressV4.cpp:17:
/root/mc/install/include/fmt/base.h: In instantiation of ‘constexpr fmt::v10::detail::value<Context> fmt::v10::detail::make_arg(T&) [with bool PACKED = true; Context = fmt::v10::context; T = folly::Range<const char*>; typename std::enable_if<PACKED, int>::type <anonymous> = 0]’:
/root/mc/install/include/fmt/base.h:2006:74:   required from ‘constexpr fmt::v10::detail::format_arg_store<Context, NUM_ARGS, 0, DESC> fmt::v10::make_format_args(T& ...) [with Context = fmt::v10::context; T = {folly::Range<const char*>}; 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]’
/root/mc/install/include/fmt/format.h:4386:44:   required from ‘std::string fmt::v10::format(fmt::v10::format_string<T ...>, T&& ...) [with T = {folly::Range<const char*>&}; std::string = std::__cxx11::basic_string<char>; fmt::v10::format_string<T ...> = fmt::v10::basic_format_string<char, folly::Range<const char*>&>]’
/root/mc/pkgs/folly/folly/IPAddressV4.cpp:73:64:   required from here
/root/mc/install/include/fmt/base.h:1598:17: error: static assertion failed: Mixing character types is disallowed.
 1598 |   static_assert(formattable_char, "Mixing character types is disallowed.");
      |                 ^~~~~~~~~~~~~~~~
make[3]: *** [CMakeFiles/folly_base.dir/build.make:245: CMakeFiles/folly_base.dir/IPAddress.cpp.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: *** [CMakeFiles/folly_base.dir/build.make:258: CMakeFiles/folly_base.dir/IPAddressV4.cpp.o] Error 1
In file included from /root/mc/install/include/fmt/format.h:54,
                 from /root/mc/pkgs/folly/folly/FBString.h:34,
                 from /root/mc/pkgs/folly/folly/IPAddressV6.h:37,
                 from /root/mc/pkgs/folly/folly/IPAddressV6.cpp:17:
/root/mc/install/include/fmt/base.h: In instantiation of ‘constexpr fmt::v10::detail::value<Context> fmt::v10::detail::make_arg(T&) [with bool PACKED = true; Context = fmt::v10::context; T = folly::Range<const char*>; typename std::enable_if<PACKED, int>::type <anonymous> = 0]’:
/root/mc/install/include/fmt/base.h:2006:74:   required from ‘constexpr fmt::v10::detail::format_arg_store<Context, NUM_ARGS, 0, DESC> fmt::v10::make_format_args(T& ...) [with Context = fmt::v10::context; T = {folly::Range<const char*>}; 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]’
/root/mc/install/include/fmt/format.h:4386:44:   required from ‘std::string fmt::v10::format(fmt::v10::format_string<T ...>, T&& ...) [with T = {folly::Range<const char*>&}; std::string = std::__cxx11::basic_string<char>; fmt::v10::format_string<T ...> = fmt::v10::basic_format_string<char, folly::Range<const char*>&>]’
/root/mc/pkgs/folly/folly/IPAddressV6.cpp:216:53:   required from here
/root/mc/install/include/fmt/base.h:1598:17: error: static assertion failed: Mixing character types is disallowed.
 1598 |   static_assert(formattable_char, "Mixing character types is disallowed.");
      |                 ^~~~~~~~~~~~~~~~
make[3]: *** [CMakeFiles/folly_base.dir/build.make:271: CMakeFiles/folly_base.dir/IPAddressV6.cpp.o] Error 1

Steps to Reproduce:

  • Try to install mcrouter and as it depends on Folly, it tries to build and install it or:
  • Clone Folly repository.
  • Configure build environment on Debian 12.
  • Run build command (cmake, make).
  • Observe error during compilation.

Expected Behavior: Folly compiles successfully without encountering errors.

Attempts to Resolve:

  • Ensured all dependencies are installed.
  • Tried different tag versions of Folly.
  • Attempted to use different versions of gcc/g++ (9, 11, 12, 13).
  • Tested on Ubuntu 20.04.

Question: What am I missing? What could be causing the mixing character types error during compilation of Folly on Debian 12, and how can this issue be resolved?

Any insights or suggestions would be greatly appreciated. Thank you!

ShamimShahraeini avatar Apr 07 '24 06:04 ShamimShahraeini

I has the same problem, with latest fmt library and ubuntu 24.04.

zhangzq avatar Apr 30 '24 08:04 zhangzq

I degrade the fmt library from 10.2 to 10.1, everything go well now.

so folly not compatitable the newest 10.2 fmt.

zhangzq avatar Apr 30 '24 09:04 zhangzq

Should be fixed: 21e8dcd464ee46b2144a1e4d4c0e452355ae15f0.

yfeldblum avatar Aug 19 '24 15:08 yfeldblum