sogou / srpc

RPC framework based on C++ Workflow. Supports SRPC, Baidu bRPC, Tencent tRPC, thrift protocols.
Apache License 2.0
1.96k stars 386 forks source link

Protobuf v5 support #406

Closed Tradias closed 2 months ago

Tradias commented 2 months ago

In order to update the protobuf port within vcpkg, srpc must support the new version. Can you add support for it?

Potential patch: https://github.com/microsoft/vcpkg/blob/052b06a95da4cee184bab4422e02e7f316055a99/ports/srpc/protobuf-v5.patch

holmes1412 commented 2 months ago

Thank you for updating vcpkg for srpc!

Now I notice the compatibility issues in protobuf 26.x. I read the document and have some questions, because I cannot find the new define in this document: https://protobuf.dev/reference/cpp/api-docs/google.protobuf.util.json_util/.

Is the always_print_default_values ​​mentioned in https://protobuf.dev/news/v26/ the same as always_print_primitive_fields?

Tradias commented 2 months ago

Interesting observation. I cannot find any mentioning of always_print_default_values in the code. I suspect it is a bug in the documentation.

Looking at the code they clearly changed always_print_primitive_fields to always_print_fields_with_no_presence from v25 to v26.

holmes1412 commented 2 months ago

lol I see~ I will check the protobuf v26 and update srpc as your patch mentioned. Thank you again for your kind reminder.

holmes1412 commented 2 months ago

Hi, we have made this modification to support the new field. Please check this Pull Request https://github.com/sogou/srpc/issues/406 if you are interested.