shiiion / dolphin

Dolphin fork intended to give Metroid Prime Trilogy mouselook controls
Other
466 stars 43 forks source link

git master or 1.0.5 tag fail to build with fmt version 8.1.1 #93

Closed dmccombs closed 2 years ago

dmccombs commented 2 years ago

Trying to build this on a current Archlinux machine fails with some fmt errors:

mkdir Build
cd Build
cmake ..
make
[ 11%] Building CXX object Source/Core/Common/CMakeFiles/common.dir/Thread.cpp.o
[ 11%] Building CXX object Source/Core/Common/CMakeFiles/common.dir/Timer.cpp.o
[ 11%] Building CXX object Source/Core/Common/CMakeFiles/common.dir/TraversalClient.cpp.o
In file included from /usr/include/fmt/format.h:48,
                 from /home/dmccombs/git/dolphin/Source/Core/Common/Logging/Log.h:7,
                 from /home/dmccombs/git/dolphin/Source/Core/Common/TraversalClient.cpp:10:
/usr/include/fmt/core.h: In instantiation of ‘constexpr decltype (ctx.begin()) fmt::v8::detail::parse_format_specs(ParseContext&) [with T = TraversalPacketType; ParseContext = fmt::v8::detail::compile_parse_context<char, fmt::v8::detail::error_handler>; decltype (ctx.begin()) = const char*]’:
/usr/include/fmt/core.h:2906:9:   required from ‘constexpr fmt::v8::detail::format_string_checker<Char, ErrorHandler, Args>::format_string_checker(fmt::v8::basic_string_view<Char>, ErrorHandler) [with Char = char; ErrorHandler = fmt::v8::detail::error_handler; Args = {TraversalPacketType}]’
/usr/include/fmt/core.h:2947:33:   required from ‘void fmt::v8::detail::check_format_string(S) [with <template-parameter-1-1> = {TraversalPacketType}; S = TraversalClient::HandleServerPacket(TraversalPacket*)::<lambda()>::FMT_COMPILE_STRING; typename std::enable_if<fmt::v8::is_compile_string<S>::value, int>::type <anonymous> = 0]’
/usr/include/fmt/format.h:843:39:   required from ‘fmt::v8::format_arg_store<fmt::v8::basic_format_context<typename std::conditional<std::is_same<Char, char>::value, fmt::v8::appender, std::back_insert_iterator<fmt::v8::detail::buffer<Char> > >::type, Char>, typename std::remove_reference<Args>::type ...> fmt::v8::make_args_checked(const S&, fmt::v8::remove_reference_t<Args>& ...) [with Args = {TraversalPacketType}; S = TraversalClient::HandleServerPacket(TraversalPacket*)::<lambda()>::FMT_COMPILE_STRING; Char = char; typename std::conditional<std::is_same<Char, char>::value, fmt::v8::appender, std::back_insert_iterator<fmt::v8::detail::buffer<Char> > >::type = fmt::v8::appender]’
/home/dmccombs/git/dolphin/Source/Core/Common/Logging/Log.h:98:52:   required from ‘void Common::Log::GenericLogFmt(Common::Log::LogLevel, Common::Log::LogType, const char*, int, const S&, const Args& ...) [with long unsigned int NumFields = 1; S = TraversalClient::HandleServerPacket(TraversalPacket*)::<lambda()>::FMT_COMPILE_STRING; Args = {TraversalPacketType}]’
/home/dmccombs/git/dolphin/Source/Core/Common/TraversalClient.cpp:197:5:   required from here
/usr/include/fmt/core.h:2672:12: error: use of deleted function ‘fmt::v8::detail::fallback_formatter<T, Char, Enable>::fallback_formatter() [with T = TraversalPacketType; Char = char; Enable = void]’
 2672 |   auto f = conditional_t<has_formatter<mapped_type, context>::value,
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2673 |                          formatter<mapped_type, char_type>,
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 2674 |                          fallback_formatter<T, char_type>>();
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/fmt/core.h:1041:3: note: declared here
 1041 |   fallback_formatter() = delete;
      |   ^~~~~~~~~~~~~~~~~~
/usr/include/fmt/core.h: In instantiation of ‘constexpr fmt::v8::detail::value<Context> fmt::v8::detail::make_arg(T&&) [with bool IS_PACKED = true; Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; fmt::v8::detail::type <anonymous> = fmt::v8::detail::type::custom_type; T = const TraversalPacketType&; typename std::enable_if<IS_PACKED, int>::type <anonymous> = 0]’:
/usr/include/fmt/core.h:1855:77:   required from ‘constexpr fmt::v8::format_arg_store<Context, Args>::format_arg_store(T&& ...) [with T = {const TraversalPacketType&}; Context = fmt::v8::basic_format_context<fmt::v8::appender, char>; Args = {TraversalPacketType}]’
/usr/include/fmt/format.h:844:18:   required from ‘fmt::v8::format_arg_store<fmt::v8::basic_format_context<typename std::conditional<std::is_same<Char, char>::value, fmt::v8::appender, std::back_insert_iterator<fmt::v8::detail::buffer<Char> > >::type, Char>, typename std::remove_reference<Args>::type ...> fmt::v8::make_args_checked(const S&, fmt::v8::remove_reference_t<Args>& ...) [with Args = {TraversalPacketType}; S = TraversalClient::HandleServerPacket(TraversalPacket*)::<lambda()>::FMT_COMPILE_STRING; Char = char; typename std::conditional<std::is_same<Char, char>::value, fmt::v8::appender, std::back_insert_iterator<fmt::v8::detail::buffer<Char> > >::type = fmt::v8::appender]’
/home/dmccombs/git/dolphin/Source/Core/Common/Logging/Log.h:98:52:   required from ‘void Common::Log::GenericLogFmt(Common::Log::LogLevel, Common::Log::LogType, const char*, int, const S&, const Args& ...) [with long unsigned int NumFields = 1; S = TraversalClient::HandleServerPacket(TraversalPacket*)::<lambda()>::FMT_COMPILE_STRING; Args = {TraversalPacketType}]’
/home/dmccombs/git/dolphin/Source/Core/Common/TraversalClient.cpp:197:5:   required from here
/usr/include/fmt/core.h:1728: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
 1728 |       formattable,
      |       ^~~~~~~~~~~
/usr/include/fmt/core.h:1728:7: note: ‘formattable’ evaluates to false
make[2]: *** [Source/Core/Common/CMakeFiles/common.dir/build.make:720: Source/Core/Common/CMakeFiles/common.dir/TraversalClient.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1350: Source/Core/Common/CMakeFiles/common.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

Downgrading to fmt 8.0.1 allows it to build.

It looks like this was fixed in upstream dolphin in https://github.com/dolphin-emu/dolphin/pull/10367

SirMangler commented 2 years ago

PrimeHack stays up to date with the latest beta in order to balance new changes with stability. Currently, we are on the latest Dolphin beta. We will merge with the next beta when it releases (hopefully soon) and this should be resolved.

SuperSamus commented 2 years ago

The latest Dolphin beta released 8 days ago.

SirMangler commented 2 years ago

Lost track of time, my bad. Merged with the latest beta. This should be resolved now. Feel free to comment/reopen if there is still a problem. https://github.com/shiiion/dolphin/commit/afc0fb127d0d5a6446976f32023e28736b2d88be