Skip to content
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

[vcpkg] build failure against fmt 9.0.0 #25673

Closed
xvitaly opened this issue Jul 10, 2022 · 4 comments · Fixed by microsoft/vcpkg-tool#679
Closed

[vcpkg] build failure against fmt 9.0.0 #25673

xvitaly opened this issue Jul 10, 2022 · 4 comments · Fixed by microsoft/vcpkg-tool#679
Assignees
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly

Comments

@xvitaly
Copy link

xvitaly commented Jul 10, 2022

Host Environment

  • OS: Fedora 37
  • Compiler: GCC 12.1.1

To Reproduce
Steps to reproduce the behavior:
Run standard build against packaged version of fmt 9.0.0.

Failure logs

[1/107] /usr/bin/g++ -DFMT_SHARED -DVCPKG_BASE_VERSION=2022-06-15 -DVCPKG_VERSION=2022-06-15 -I/builddir/build/BUILD/vcpkg-tool-2022-06-15/include -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -DNDEBUG -include /builddir/build/BUILD/vcpkg-tool-2022-06-15/include/pch.h -pthread -std=c++17 -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/base/checks.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/base/checks.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/base/checks.cpp.o -c /builddir/build/BUILD/vcpkg-tool-2022-06-15/src/vcpkg/base/checks.cpp
FAILED: CMakeFiles/vcpkglib.dir/src/vcpkg/base/checks.cpp.o 
/usr/bin/g++ -DFMT_SHARED -DVCPKG_BASE_VERSION=2022-06-15 -DVCPKG_VERSION=2022-06-15 -I/builddir/build/BUILD/vcpkg-tool-2022-06-15/include -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -DNDEBUG -include /builddir/build/BUILD/vcpkg-tool-2022-06-15/include/pch.h -pthread -std=c++17 -MD -MT CMakeFiles/vcpkglib.dir/src/vcpkg/base/checks.cpp.o -MF CMakeFiles/vcpkglib.dir/src/vcpkg/base/checks.cpp.o.d -o CMakeFiles/vcpkglib.dir/src/vcpkg/base/checks.cpp.o -c /builddir/build/BUILD/vcpkg-tool-2022-06-15/src/vcpkg/base/checks.cpp
In file included from /builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/format.h:3,
                 from /builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/messages.h:7,
                 from /builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/basic_checks.h:4,
                 from /builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/checks.h:3,
                 from /builddir/build/BUILD/vcpkg-tool-2022-06-15/src/vcpkg/base/checks.cpp:1:
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:14:17: error: 'formatter' is not a class template
   14 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<Base, Char, void>                                         \
      |                 ^~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/stringview.h:87:1: note: in expansion of macro 'VCPKG_FORMAT_AS'
   87 | VCPKG_FORMAT_AS(vcpkg::ZStringView, vcpkg::StringView);
      | ^~~~~~~~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:14:45: error: qualified name does not name a class before ':' token
   14 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<Base, Char, void>                                         \
      |                                             ^
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/stringview.h:87:1: note: in expansion of macro 'VCPKG_FORMAT_AS'
   87 | VCPKG_FORMAT_AS(vcpkg::ZStringView, vcpkg::StringView);
      | ^~~~~~~~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:14:45: error: expected '{' before ':' token
   14 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<Base, Char, void>                                         \
      |                                             ^
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/stringview.h:87:1: note: in expansion of macro 'VCPKG_FORMAT_AS'
   87 | VCPKG_FORMAT_AS(vcpkg::ZStringView, vcpkg::StringView);
      | ^~~~~~~~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:14:17: error: 'formatter' is not a class template
   14 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<Base, Char, void>                                         \
      |                 ^~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/stringview.h:88:1: note: in expansion of macro 'VCPKG_FORMAT_AS'
   88 | VCPKG_FORMAT_AS(vcpkg::StringLiteral, vcpkg::StringView);
      | ^~~~~~~~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:14:45: error: qualified name does not name a class before ':' token
   14 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<Base, Char, void>                                         \
      |                                             ^
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/stringview.h:88:1: note: in expansion of macro 'VCPKG_FORMAT_AS'
   88 | VCPKG_FORMAT_AS(vcpkg::StringLiteral, vcpkg::StringView);
      | ^~~~~~~~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:14:45: error: expected '{' before ':' token
   14 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<Base, Char, void>                                         \
      |                                             ^
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/stringview.h:88:1: note: in expansion of macro 'VCPKG_FORMAT_AS'
   88 | VCPKG_FORMAT_AS(vcpkg::StringLiteral, vcpkg::StringView);
      | ^~~~~~~~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/format.h:26:12: error: 'formatter' is not a class template
   26 |     struct formatter<vcpkg::LineInfo, char>
      |            ^~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/format.h:27:5: error: explicit specialization of non-template 'fmt::formatter'
   27 |     {
      |     ^
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/format.h:40:12: error: 'formatter' is not a class template
   40 |     struct formatter<vcpkg::StringView, char> : formatter<string_view, char>
      |            ^~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/format.h:40:45: error: 'fmt::formatter' is not a template
   40 |     struct formatter<vcpkg::StringView, char> : formatter<string_view, char>
      |                                             ^
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/format.h:26:12: note: previous declaration here
   26 |     struct formatter<vcpkg::LineInfo, char>
      |            ^~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/format.h:40:49: error: reference to 'formatter' is ambiguous
   40 |     struct formatter<vcpkg::StringView, char> : formatter<string_view, char>
      |                                                 ^~~~~~~~~
In file included from /usr/include/fmt/format.h:48,
                 from /builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fmt.h:12,
                 from /builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/format.h:5:
/usr/include/fmt/core.h:772:8: note: candidates are: 'template<class T, class Char, class Enable> struct fmt::v9::formatter'
  772 | struct formatter {
      |        ^~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:8:16: note:                 'template<class T, class Char, class Enable> struct fmt::v8::formatter'
    8 |         struct formatter;
      |                ^~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/format.h:26:12: note:                 'struct fmt::formatter'
   26 |     struct formatter<vcpkg::LineInfo, char>
      |            ^~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/format.h:40:58: error: expected template-name before '<' token
   40 |     struct formatter<vcpkg::StringView, char> : formatter<string_view, char>
      |                                                          ^
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/format.h:50:12: error: 'formatter' is not a class template
   50 |     struct formatter<std::error_code, char> : formatter<std::string, char>
      |            ^~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/format.h:50:43: error: 'fmt::formatter' is not a template
   50 |     struct formatter<std::error_code, char> : formatter<std::string, char>
      |                                           ^
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/format.h:26:12: note: previous declaration here
   26 |     struct formatter<vcpkg::LineInfo, char>
      |            ^~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/format.h:50:47: error: reference to 'formatter' is ambiguous
   50 |     struct formatter<std::error_code, char> : formatter<std::string, char>
      |                                               ^~~~~~~~~
/usr/include/fmt/core.h:772:8: note: candidates are: 'template<class T, class Char, class Enable> struct fmt::v9::formatter'
  772 | struct formatter {
      |        ^~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:8:16: note:                 'template<class T, class Char, class Enable> struct fmt::v8::formatter'
    8 |         struct formatter;
      |                ^~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/format.h:26:12: note:                 'struct fmt::formatter'
   26 |     struct formatter<vcpkg::LineInfo, char>
      |            ^~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/format.h:50:56: error: expected template-name before '<' token
   50 |     struct formatter<std::error_code, char> : formatter<std::string, char>
      |                                                        ^
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:25:17: error: 'formatter' is not a class template
   25 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<std::string, Char, void>                                  \
      |                 ^~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/messages.h:120:1: note: in expansion of macro 'VCPKG_FORMAT_WITH_TO_STRING'
  120 | VCPKG_FORMAT_WITH_TO_STRING(vcpkg::LocalizedString);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:25:45: error: qualified name does not name a class before ':' token
   25 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<std::string, Char, void>                                  \
      |                                             ^
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/messages.h:120:1: note: in expansion of macro 'VCPKG_FORMAT_WITH_TO_STRING'
  120 | VCPKG_FORMAT_WITH_TO_STRING(vcpkg::LocalizedString);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:25:45: error: expected '{' before ':' token
   25 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<std::string, Char, void>                                  \
      |                                             ^
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/messages.h:120:1: note: in expansion of macro 'VCPKG_FORMAT_WITH_TO_STRING'
  120 | VCPKG_FORMAT_WITH_TO_STRING(vcpkg::LocalizedString);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:25:17: error: 'formatter' is not a class template
   25 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<std::string, Char, void>                                  \
      |                 ^~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/chrono.h:97:1: note: in expansion of macro 'VCPKG_FORMAT_WITH_TO_STRING'
   97 | VCPKG_FORMAT_WITH_TO_STRING(vcpkg::ElapsedTime);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:25:45: error: qualified name does not name a class before ':' token
   25 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<std::string, Char, void>                                  \
      |                                             ^
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/chrono.h:97:1: note: in expansion of macro 'VCPKG_FORMAT_WITH_TO_STRING'
   97 | VCPKG_FORMAT_WITH_TO_STRING(vcpkg::ElapsedTime);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:25:45: error: expected '{' before ':' token
   25 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<std::string, Char, void>                                  \
      |                                             ^
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/chrono.h:97:1: note: in expansion of macro 'VCPKG_FORMAT_WITH_TO_STRING'
   97 | VCPKG_FORMAT_WITH_TO_STRING(vcpkg::ElapsedTime);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:25:17: error: 'formatter' is not a class template
   25 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<std::string, Char, void>                                  \
      |                 ^~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/chrono.h:98:1: note: in expansion of macro 'VCPKG_FORMAT_WITH_TO_STRING'
   98 | VCPKG_FORMAT_WITH_TO_STRING(vcpkg::ElapsedTimer);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:25:45: error: qualified name does not name a class before ':' token
   25 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<std::string, Char, void>                                  \
      |                                             ^
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/chrono.h:98:1: note: in expansion of macro 'VCPKG_FORMAT_WITH_TO_STRING'
   98 | VCPKG_FORMAT_WITH_TO_STRING(vcpkg::ElapsedTimer);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:25:45: error: expected '{' before ':' token
   25 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<std::string, Char, void>                                  \
      |                                             ^
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/chrono.h:98:1: note: in expansion of macro 'VCPKG_FORMAT_WITH_TO_STRING'
   98 | VCPKG_FORMAT_WITH_TO_STRING(vcpkg::ElapsedTimer);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:25:17: error: 'formatter' is not a class template
   25 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<std::string, Char, void>                                  \
      |                 ^~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/chrono.h:99:1: note: in expansion of macro 'VCPKG_FORMAT_WITH_TO_STRING'
   99 | VCPKG_FORMAT_WITH_TO_STRING(vcpkg::CTime);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:25:45: error: qualified name does not name a class before ':' token
   25 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<std::string, Char, void>                                  \
      |                                             ^
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/chrono.h:99:1: note: in expansion of macro 'VCPKG_FORMAT_WITH_TO_STRING'
   99 | VCPKG_FORMAT_WITH_TO_STRING(vcpkg::CTime);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/fwd/format.h:25:45: error: expected '{' before ':' token
   25 |     struct fmt::formatter<Type, Char, void> : fmt::formatter<std::string, Char, void>                                  \
      |                                             ^
/builddir/build/BUILD/vcpkg-tool-2022-06-15/include/vcpkg/base/chrono.h:99:1: note: in expansion of macro 'VCPKG_FORMAT_WITH_TO_STRING'
   99 | VCPKG_FORMAT_WITH_TO_STRING(vcpkg::CTime);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/fmt/core.h: In instantiation of 'constexpr fmt::v9::detail::value<Context> fmt::v9::detail::make_value(T&&) [with Context = fmt::v9::basic_format_context<fmt::v9::appender, char>; T = const vcpkg::LineInfo&]':
/usr/include/fmt/core.h:1753:29:   required from 'constexpr fmt::v9::detail::value<Context> fmt::v9::detail::make_arg(T&&) [with bool IS_PACKED = true; Context = fmt::v9::basic_format_context<fmt::v9::appender, char>; type <anonymous> = fmt::v9::detail::type::custom_type; T = const vcpkg::LineInfo&; typename std::enable_if<IS_PACKED, int>::type <anonymous> = 0]'
/usr/include/fmt/core.h:1877:77:   required from 'constexpr fmt::v9::format_arg_store<Context, Args>::format_arg_store(T&& ...) [with T = {const vcpkg::LineInfo&}; Context = fmt::v9::basic_format_context<fmt::v9::appender, char>; Args = {vcpkg::LineInfo}]'
/usr/include/fmt/core.h:1894:38:   required from 'constexpr fmt::v9::format_arg_store<Context, typename std::remove_cv<typename std::remove_reference<Args>::type>::type ...> fmt::v9::make_format_args(Args&& ...) [with Context = basic_format_context<appender, char>; Args = {const vcpkg::LineInfo&}]'
/usr/include/fmt/core.h:3163:44:   required from 'std::string fmt::v9::format(format_string<T ...>, T&& ...) [with T = {const vcpkg::LineInfo&}; std::string = std::__cxx11::basic_string<char>; format_string<T ...> = basic_format_string<char, const vcpkg::LineInfo&>]'
/builddir/build/BUILD/vcpkg-tool-2022-06-15/src/vcpkg/base/checks.cpp:14:53:   required from here
/usr/include/fmt/core.h:1733: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
 1733 |       formattable,
      |       ^~~~~~~~~~~
/usr/include/fmt/core.h:1733:7: note: 'formattable' evaluates to false

Full build log: https://kojipkgs.fedoraproject.org/work/tasks/7822/89337822/build.log

@LilyWangLL
Copy link
Contributor

Thanks for posting this issue. Did this error is updating your local fmt to 9.0.0, then install failed? PR #25658 is updating fmt to version 9.0.0.

@LilyWangLL LilyWangLL added the requires:more-information This Issue requires more information to solve label Jul 11, 2022
@dg0yt
Copy link
Contributor

dg0yt commented Jul 11, 2022

#25658 is unrelated because it is about ports. But this issue is about vcpkg tool with fmt 9.0.0 from system package manager (or upstream).

@xvitaly
Copy link
Author

xvitaly commented Jul 12, 2022

Did this error is updating your local fmt to 9.0.0, then install failed? PR #25658 is updating fmt to version 9.0.0.

This issue is about building vcpkg-tool itself against the latest version of fmt library.

@LilyWangLL LilyWangLL added requires:repro The issue is not currently repro-able and removed requires:more-information This Issue requires more information to solve labels Jul 13, 2022
@xvitaly
Copy link
Author

xvitaly commented Jul 16, 2022

PR with fix: microsoft/vcpkg-tool#634

@LilyWangLL LilyWangLL added category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly and removed requires:repro The issue is not currently repro-able labels Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants