mirror of
https://github.com/php-win-ext/grpc.git
synced 2026-03-24 00:52:08 +01:00
[Fix][Compiler] Plugins fall back to the edition 2023 for older protobuf (#41357)
Fixes the issue with gRPC protobuf plugins declaring the support for `protobuf::Edition::EDITION_2024`, which is higher than the one supported by the protobuf we're using at the moment: `EDITION_2023` at google/protobuf@74211c0dfc. Related: - Effectively undoes #40957 Closes #41357 COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/41357 from sergiitk:fix/compiler/protobuf-edition-2023 c3d7b9b27ead199e5e4c66052d4d91d32a7370c6 PiperOrigin-RevId: 853371790
This commit is contained in:
committed by
Copybara-Service
parent
518f4a5ef0
commit
9b77c0d4df
@@ -45,7 +45,13 @@ class CppGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
|
||||
return grpc::protobuf::Edition::EDITION_PROTO2;
|
||||
}
|
||||
grpc::protobuf::Edition GetMaximumEdition() const override {
|
||||
// TODO(yuanweiz): Remove when the protobuf is updated to a version
|
||||
// that supports edition 2024.
|
||||
#if !defined(GOOGLE_PROTOBUF_VERSION) || GOOGLE_PROTOBUF_VERSION >= 6032000
|
||||
return grpc::protobuf::Edition::EDITION_2024;
|
||||
#else
|
||||
return grpc::protobuf::Edition::EDITION_2023;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -42,7 +42,13 @@ class CSharpGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
|
||||
return grpc::protobuf::Edition::EDITION_PROTO2;
|
||||
}
|
||||
grpc::protobuf::Edition GetMaximumEdition() const override {
|
||||
// TODO(yuanweiz): Remove when the protobuf is updated to a version
|
||||
// that supports edition 2024.
|
||||
#if !defined(GOOGLE_PROTOBUF_VERSION) || GOOGLE_PROTOBUF_VERSION >= 6032000
|
||||
return grpc::protobuf::Edition::EDITION_2024;
|
||||
#else
|
||||
return grpc::protobuf::Edition::EDITION_2023;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -93,7 +93,13 @@ class ObjectiveCGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
|
||||
return grpc::protobuf::Edition::EDITION_PROTO2;
|
||||
}
|
||||
grpc::protobuf::Edition GetMaximumEdition() const override {
|
||||
// TODO(yuanweiz): Remove when the protobuf is updated to a version
|
||||
// that supports edition 2024.
|
||||
#if !defined(GOOGLE_PROTOBUF_VERSION) || GOOGLE_PROTOBUF_VERSION >= 6032000
|
||||
return grpc::protobuf::Edition::EDITION_2024;
|
||||
#else
|
||||
return grpc::protobuf::Edition::EDITION_2023;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -46,7 +46,13 @@ class PHPGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
|
||||
return grpc::protobuf::Edition::EDITION_PROTO2;
|
||||
}
|
||||
grpc::protobuf::Edition GetMaximumEdition() const override {
|
||||
// TODO(yuanweiz): Remove when the protobuf is updated to a version
|
||||
// that supports edition 2024.
|
||||
#if !defined(GOOGLE_PROTOBUF_VERSION) || GOOGLE_PROTOBUF_VERSION >= 6032000
|
||||
return grpc::protobuf::Edition::EDITION_2024;
|
||||
#else
|
||||
return grpc::protobuf::Edition::EDITION_2023;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -59,7 +59,13 @@ class PythonGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
|
||||
return grpc::protobuf::Edition::EDITION_PROTO2;
|
||||
}
|
||||
grpc::protobuf::Edition GetMaximumEdition() const override {
|
||||
// TODO(yuanweiz): Remove when the protobuf is updated to a version
|
||||
// that supports edition 2024.
|
||||
#if !defined(GOOGLE_PROTOBUF_VERSION) || GOOGLE_PROTOBUF_VERSION >= 6032000
|
||||
return grpc::protobuf::Edition::EDITION_2024;
|
||||
#else
|
||||
return grpc::protobuf::Edition::EDITION_2023;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -42,7 +42,13 @@ class RubyGrpcGenerator : public grpc::protobuf::compiler::CodeGenerator {
|
||||
return grpc::protobuf::Edition::EDITION_PROTO2;
|
||||
}
|
||||
grpc::protobuf::Edition GetMaximumEdition() const override {
|
||||
// TODO(yuanweiz): Remove when the protobuf is updated to a version
|
||||
// that supports edition 2024.
|
||||
#if !defined(GOOGLE_PROTOBUF_VERSION) || GOOGLE_PROTOBUF_VERSION >= 6032000
|
||||
return grpc::protobuf::Edition::EDITION_2024;
|
||||
#else
|
||||
return grpc::protobuf::Edition::EDITION_2023;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user