Closed
Description
Using the latest version of protobuf (v27.1), I see the following compiler errors when trying to compile the javascript generator:
external/com_google_protobuf_javascript/generator/js_generator.cc:457:7: error: 'OneofDescriptorLegacy' was not declared in this scope; did you mean 'FileDescriptorLegacy'?
457 | if (OneofDescriptorLegacy(oneof).is_synthetic()) return true;
| ^~~~~~~~~~~~~~~~~~~~~
| FileDescriptorLegacy
external/com_google_protobuf_javascript/generator/js_generator.cc: In function 'std::string google::protobuf::compiler::js::{anonymous}::JSOneofIndex(const google::protobuf::OneofDescriptor*)':
external/com_google_protobuf_javascript/generator/js_generator.cc:566:9: error: 'OneofDescriptorLegacy' was not declared in this scope; did you mean 'FileDescriptorLegacy'?
566 | if (OneofDescriptorLegacy(o).is_synthetic()) continue;
| ^~~~~~~~~~~~~~~~~~~~~
| FileDescriptorLegacy
external/com_google_protobuf_javascript/generator/js_generator.cc: In function 'bool google::protobuf::compiler::js::{anonymous}::InRealOneof(const google::protobuf::FieldDescriptor*)':
external/com_google_protobuf_javascript/generator/js_generator.cc:787:11: error: 'OneofDescriptorLegacy' was not declared in this scope; did you mean 'FileDescriptorLegacy'?
787 | !OneofDescriptorLegacy(field->containing_oneof()).is_synthetic();
| ^~~~~~~~~~~~~~~~~~~~~
| FileDescriptorLegacy
external/com_google_protobuf_javascript/generator/js_generator.cc: In function 'bool google::protobuf::compiler::js::{anonymous}::DeclaredReturnTypeIsNullable(const google::protobuf::compiler::js::GeneratorOptions&, const google::protobuf::FieldDescriptor*)':
external/com_google_protobuf_javascript/generator/js_generator.cc:987:43: error: 'class google::protobuf::FileDescriptorLegacy' has no member named 'syntax'
987 | if (FileDescriptorLegacy(field->file()).syntax() == FileDescriptorLegacy::Syntax::SYNTAX_PROTO3 &&
| ^~~~~~
external/com_google_protobuf_javascript/generator/js_generator.cc:987:77: error: 'google::protobuf::FileDescriptorLegacy::Syntax' has not been declared
987 | if (FileDescriptorLegacy(field->file()).syntax() == FileDescriptorLegacy::Syntax::SYNTAX_PROTO3 &&
| ^~~~~~
external/com_google_protobuf_javascript/generator/js_generator.cc: In member function 'void google::protobuf::compiler::js::Generator::GenerateClassFieldToObject(const google::protobuf::compiler::js::GeneratorOptions&, google::protobuf::io::Printer*, const google::protobuf::FieldDescriptor*) const':
external/com_google_protobuf_javascript/generator/js_generator.cc:2350:45: error: 'class google::protobuf::FileDescriptorLegacy' has no member named 'syntax'
2350 | if (FileDescriptorLegacy(field->file()).syntax() == FileDescriptorLegacy::Syntax::SYNTAX_PROTO3 &&
| ^~~~~~
external/com_google_protobuf_javascript/generator/js_generator.cc:2350:79: error: 'google::protobuf::FileDescriptorLegacy::Syntax' has not been declared
2350 | if (FileDescriptorLegacy(field->file()).syntax() == FileDescriptorLegacy::Syntax::SYNTAX_PROTO3 &&
| ^~~~~~
external/com_google_protobuf_javascript/generator/js_generator.cc: In member function 'void google::protobuf::compiler::js::Generator::GenerateClassField(const google::protobuf::compiler::js::GeneratorOptions&, google::protobuf::io::Printer*, const google::protobuf::FieldDescriptor*) const':
external/com_google_protobuf_javascript/generator/js_generator.cc:2758:45: error: 'class google::protobuf::FileDescriptorLegacy' has no member named 'syntax'
2758 | if (FileDescriptorLegacy(field->file()).syntax() == FileDescriptorLegacy::Syntax::SYNTAX_PROTO3 &&
| ^~~~~~
external/com_google_protobuf_javascript/generator/js_generator.cc:2758:79: error: 'google::protobuf::FileDescriptorLegacy::Syntax' has not been declared
2758 | if (FileDescriptorLegacy(field->file()).syntax() == FileDescriptorLegacy::Syntax::SYNTAX_PROTO3 &&
|
It looks like perhaps the latest version might have removed some legacy classes.