facebook / watchman

Watches files and records, or triggers actions, when they change.
https://facebook.github.io/watchman/
MIT License
12.42k stars 989 forks source link

Unable to compile with fmt 10.0.0 #1140

Closed FtZPetruska closed 9 months ago

FtZPetruska commented 1 year ago

Compilation fails when building using fmt 10.0.0.

This is most likely due to the following breaking change:

Removed deprecated implicit conversions for enums and conversions to primitive types for compatibility with std::format and to prevent potential ODR violations. Use format_as instead.
Failure logs ``` [ 29%] Building CXX object CMakeFiles/streamingeden_thrift.dir/eden/fs/service/gen-cpp2/StreamingEdenService_processmap_compact.cpp.o /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/shims/linux/super/g++-11 -DBOOST_ATOMIC_DYN_LINK -DBOOST_ATOMIC_NO_LIB -DBOOST_CONTEXT_DYN_LINK -DBOOST_CONTEXT_NO_LIB -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_FILESYSTEM_NO_LIB -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_PROGRAM_OPTIONS_NO_LIB -DBOOST_REGEX_DYN_LINK -DBOOST_REGEX_NO_LIB -DBOOST_SYSTEM_DYN_LINK -DBOOST_SYSTEM_NO_LIB -DBOOST_THREAD_DYN_LINK -DBOOST_THREAD_NO_LIB -DFMT_SHARED -DGFLAGS_IS_A_DLL=0 -DGLOG_NO_ABBREVIATED_SEVERITIES -I/tmp/watchman-20230513-12521-46pjw8/watchman-2023.05.08.00 -I/tmp/watchman-20230513-12521-46pjw8/watchman-2023.05.08.00/build -I/tmp/watchman-20230513-12521-46pjw8/watchman-2023.05.08.00/external/install/include -g -Wall -Wextra -std=gnu++17 -g -Wall -Wextra -std=gnu++17 -O3 -std=gnu++17 -fsized-deallocation -MD -MT CMakeFiles/streamingeden_thrift.dir/eden/fs/service/gen-cpp2/StreamingEdenService_processmap_compact.cpp.o -MF CMakeFiles/streamingeden_thrift.dir/eden/fs/service/gen-cpp2/StreamingEdenService_processmap_compact.cpp.o.d -o CMakeFiles/streamingeden_thrift.dir/eden/fs/service/gen-cpp2/StreamingEdenService_processmap_compact.cpp.o -c /tmp/watchman-20230513-12521-46pjw8/watchman-2023.05.08.00/build/eden/fs/service/gen-cpp2/StreamingEdenService_processmap_compact.cpp In file included from /tmp/watchman-20230513-12521-46pjw8/watchman-2023.05.08.00/watchman/bser.h:10, from /tmp/watchman-20230513-12521-46pjw8/watchman-2023.05.08.00/watchman/bser.cpp:8: /home/linuxbrew/.linuxbrew/include/fmt/core.h: In instantiation of ‘constexpr fmt::v10::detail::value fmt::v10::detail::make_value(T&&) [with Context = fmt::v10::basic_format_context; T = json_type&]’: /home/linuxbrew/.linuxbrew/include/fmt/core.h:1711:29: required from ‘constexpr fmt::v10::detail::value fmt::v10::detail::make_arg(T&&) [with bool IS_PACKED = true; Context = fmt::v10::basic_format_context; fmt::v10::detail::type = fmt::v10::detail::type::custom_type; T = json_type&; typename std::enable_if::type = 0]’ /home/linuxbrew/.linuxbrew/include/fmt/core.h:1827:77: required from ‘constexpr fmt::v10::format_arg_store::format_arg_store(T&& ...) [with T = {json_type&}; Context = fmt::v10::basic_format_context; Args = {json_type}]’ /home/linuxbrew/.linuxbrew/include/fmt/core.h:1844:31: required from ‘constexpr fmt::v10::format_arg_store::type>::type ...> fmt::v10::make_format_args(T&& ...) [with Context = fmt::v10::basic_format_context; T = {json_type&}]’ /home/linuxbrew/.linuxbrew/include/fmt/core.h:2817:44: required from ‘std::string fmt::v10::format(fmt::v10::format_string, T&& ...) [with T = {json_type}; std::string = std::__cxx11::basic_string; fmt::v10::format_string = fmt::v10::basic_format_string]’ /tmp/watchman-20230513-12521-46pjw8/watchman-2023.05.08.00/watchman/bser.h:27:27: required from ‘BserParseError::BserParseError(fmt::v10::format_string, T&& ...) [with T = {json_type}; fmt::v10::format_string = fmt::v10::basic_format_string]’ /tmp/watchman-20230513-12521-46pjw8/watchman-2023.05.08.00/watchman/bser.cpp:605:73: required from here /home/linuxbrew/.linuxbrew/include/fmt/core.h:1691:7: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter specialization: https://fmt.dev/latest/api.html#udt 1691 | formattable, | ^~~~~~~~~~~ /home/linuxbrew/.linuxbrew/include/fmt/core.h:1691:7: note: ‘formattable’ evaluates to false /home/linuxbrew/.linuxbrew/include/fmt/core.h: In instantiation of ‘constexpr fmt::v10::detail::value fmt::v10::detail::make_value(T&&) [with Context = fmt::v10::basic_format_context; T = w_string_type_t&]’: /home/linuxbrew/.linuxbrew/include/fmt/core.h:1711:29: required from ‘constexpr fmt::v10::detail::value fmt::v10::detail::make_arg(T&&) [with bool IS_PACKED = true; Context = fmt::v10::basic_format_context; fmt::v10::detail::type = fmt::v10::detail::type::custom_type; T = w_string_type_t&; typename std::enable_if::type = 0]’ /home/linuxbrew/.linuxbrew/include/fmt/core.h:1827:77: required from ‘constexpr fmt::v10::format_arg_store::format_arg_store(T&& ...) [with T = {char*&, const char (&)[4], const char*&, const char (&)[3], const char (&)[27], w_string_type_t&}; Context = fmt::v10::basic_format_context; Args = {char*, char [4], const char*, char [3], char [27], w_string_type_t}]’ /home/linuxbrew/.linuxbrew/include/fmt/core.h:1844:31: required from ‘constexpr fmt::v10::format_arg_store::type>::type ...> fmt::v10::make_format_args(T&& ...) [with Context = fmt::v10::basic_format_context; T = {char*&, const char (&)[4], const char*&, const char (&)[3], const char (&)[27], w_string_type_t&}]’ /home/linuxbrew/.linuxbrew/include/fmt/core.h:2885:59: required from ‘size_t fmt::v10::formatted_size(fmt::v10::format_string, T&& ...) [with T = {char*&, const char (&)[4], const char*&, const char (&)[3], const char (&)[27], w_string_type_t&}; size_t = long unsigned int; fmt::v10::format_string = fmt::v10::basic_format_string]’ /tmp/watchman-20230513-12521-46pjw8/watchman-2023.05.08.00/watchman/watchman_string.h:482:40: required from ‘static w_string w_string::format(fmt::v10::string_view, Args&& ...) [with Args = {char*, const char (&)[4], const char*, const char (&)[3], const char (&)[27], w_string_type_t}; fmt::v10::string_view = fmt::v10::basic_string_view]’ /tmp/watchman-20230513-12521-46pjw8/watchman-2023.05.08.00/watchman/watchman_string.h:472:28: required from ‘static w_string w_string::build(Args&& ...) [with Args = {char*, const char (&)[4], const char*, const char (&)[3], const char (&)[27], w_string_type_t}]’ /tmp/watchman-20230513-12521-46pjw8/watchman-2023.05.08.00/watchman/Logging.h:53:47: required from ‘void watchman::Log::log(watchman::LogLevel, Args&& ...) [with Args = {const char (&)[27], w_string_type_t}]’ /tmp/watchman-20230513-12521-46pjw8/watchman-2023.05.08.00/watchman/Logging.h:124:15: required from ‘void watchman::log(watchman::LogLevel, Args&& ...) [with Args = {const char (&)[27], w_string_type_t}]’ /tmp/watchman-20230513-12521-46pjw8/watchman-2023.05.08.00/watchman/bser.cpp:329:11: required from here /home/linuxbrew/.linuxbrew/include/fmt/core.h:1691:7: error: static assertion failed: Cannot format an argument. To make type T formattable provide a formatter specialization: https://fmt.dev/latest/api.html#udt /home/linuxbrew/.linuxbrew/include/fmt/core.h:1691:7: note: ‘formattable’ evaluates to false ```