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

Fix build failure with fmt 10 #304

Closed
wants to merge 1 commit into from
Closed

Conversation

carlocab
Copy link
Contributor

This change is patterned after facebook/folly#2022.

An alternative fix would be to provide a formatter specialisation1 for quic::LocalErrorCode, but that's a bit more involved.

Footnotes

  1. See https://fmt.dev/10.0.0/api.html#udt.

This change is patterned after facebook/folly#2022.

An alternative fix would be to provide a formatter specialisation[^1] for
`quic::LocalErrorCode`, but that's a bit more involved.

[^1]: See https://fmt.dev/10.0.0/api.html#udt.
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jul 18, 2023
@carlocab
Copy link
Contributor Author

Just for context, without this fix, the build fails with:

  In file included from /tmp/fbthrift--mvfst-20230717-51672-1clpyaf/mvfst-bf7c5e26dfd6f23c47e2fbcf06cbbdcf7924146a/quic/server/QuicServerWorker.cpp:8:
  In file included from /opt/homebrew/include/fmt/format.h:49:
  /opt/homebrew/include/fmt/core.h:1690:3: error: static_assert failed due to requirement 'formattable' "Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt"
    static_assert(
    ^
  /opt/homebrew/include/fmt/core.h:1711:10: note: in instantiation of function template specialization 'fmt::detail::make_value<fmt::basic_format_context<fmt::appender, char>, quic::LocalErrorCode &>' requested here
    return make_value<Context>(val);
           ^
  /opt/homebrew/include/fmt/core.h:1825:23: note: in instantiation of function template specialization 'fmt::detail::make_arg<true, fmt::basic_format_context<fmt::appender, char>, fmt::detail::type::custom_type, quic::LocalErrorCode &, 0>' requested here
          data_{detail::make_arg<
                        ^
  /opt/homebrew/include/fmt/core.h:1844:10: note: in instantiation of function template specialization 'fmt::format_arg_store<fmt::basic_format_context<fmt::appender, char>, const char *, quic::LocalErrorCode, std::basic_string<char>>::format_arg_store<const char *&, quic::LocalErrorCode &, std::basic_string<char> &>' requested here
    return {FMT_FORWARD(args)...};
           ^
  /opt/homebrew/include/fmt/core.h:2817:28: note: in instantiation of function template specialization 'fmt::make_format_args<fmt::basic_format_context<fmt::appender, char>, const char *&, quic::LocalErrorCode &, std::basic_string<char> &>' requested here
    return vformat(fmt, fmt::make_format_args(args...));
                             ^
  /tmp/fbthrift--mvfst-20230717-51672-1clpyaf/mvfst-bf7c5e26dfd6f23c47e2fbcf06cbbdcf7924146a/quic/server/QuicServerWorker.cpp:697:21: note: in instantiation of function template specialization 'fmt::format<const char *, quic::LocalErrorCode, std::basic_string<char>>' requested here
      VLOG(3) << fmt::format(
                      ^
  1 error generated.

See https://github.com/Homebrew/homebrew-core/actions/runs/5578084251/jobs/10191885340?pr=136782#step:3:749.

@carlocab
Copy link
Contributor Author

carlocab commented Jul 18, 2023

Ah, whoops. I didn't see #303 before submitting this. Feel free to close if you prefer the other fix.

@carlocab
Copy link
Contributor Author

Closed by c96bd53.

@carlocab carlocab closed this Jul 19, 2023
@carlocab carlocab deleted the fmt10-fix branch July 19, 2023 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants