Three of these runtimes are based on upb, and the fourth is based on the Java runtime. Both of these already have editions support, so this was mostly just a matter of: - Advertising support to allow editions codegen - Stripping features from the runtime options - Hooking up conformance tests - Adding some lightweight editions tests There are also a few minor orthogonal fixes included here: - Ruby's upb hack for treating all enums as open enums needed tweaking - The `enable_editions` flag is no longer needed in our internal proto rules PiperOrigin-RevId: 616256211pull/16132/head
parent
9ca36df54f
commit
bca8fb6117
30 changed files with 388 additions and 57 deletions
@ -1,8 +0,0 @@ |
||||
Recommended.Proto3.ProtobufInput.GroupUnknownFields_Drop.TextFormatOutput |
||||
Recommended.Proto3.ProtobufInput.GroupUnknownFields_Print.TextFormatOutput |
||||
Recommended.Proto3.ProtobufInput.MessageUnknownFields_Drop.TextFormatOutput |
||||
Recommended.Proto3.ProtobufInput.MessageUnknownFields_Print.TextFormatOutput |
||||
Recommended.Proto3.ProtobufInput.RepeatedUnknownFields_Drop.TextFormatOutput |
||||
Recommended.Proto3.ProtobufInput.RepeatedUnknownFields_Print.TextFormatOutput |
||||
Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Drop.TextFormatOutput |
||||
Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Print.TextFormatOutput |
@ -1,8 +0,0 @@ |
||||
Recommended.Proto3.ProtobufInput.GroupUnknownFields_Drop.TextFormatOutput |
||||
Recommended.Proto3.ProtobufInput.GroupUnknownFields_Print.TextFormatOutput |
||||
Recommended.Proto3.ProtobufInput.MessageUnknownFields_Drop.TextFormatOutput |
||||
Recommended.Proto3.ProtobufInput.MessageUnknownFields_Print.TextFormatOutput |
||||
Recommended.Proto3.ProtobufInput.RepeatedUnknownFields_Drop.TextFormatOutput |
||||
Recommended.Proto3.ProtobufInput.RepeatedUnknownFields_Print.TextFormatOutput |
||||
Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Drop.TextFormatOutput |
||||
Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Print.TextFormatOutput |
@ -0,0 +1,21 @@ |
||||
edition = "2023"; |
||||
|
||||
package basic_test; |
||||
|
||||
import "test_import_proto2.proto"; |
||||
|
||||
option features.enum_type = CLOSED; // Ignored by ruby. |
||||
option features.field_presence = IMPLICIT; |
||||
|
||||
message TestFeaturesMessage { |
||||
int32 implicit = 1; |
||||
int32 explicit = 2 [features.field_presence = EXPLICIT]; |
||||
int32 legacy_required = 3 [features.field_presence = LEGACY_REQUIRED]; |
||||
|
||||
repeated int32 packed = 50; |
||||
repeated int32 expanded = 51 [features.repeated_field_encoding = EXPANDED]; |
||||
repeated foo_bar.proto2.TestImportedMessage unpackable = 52; |
||||
|
||||
TestFeaturesMessage delimited = 100 [features.message_encoding = DELIMITED]; |
||||
TestFeaturesMessage length_prefixed = 101; |
||||
} |
@ -0,0 +1,96 @@ |
||||
edition = "2023"; |
||||
|
||||
package a.b.editions; |
||||
|
||||
option features.repeated_field_encoding = EXPANDED; |
||||
option features.utf8_validation = NONE; |
||||
|
||||
message TestMessage { |
||||
int32 optional_int32 = 1; |
||||
int64 optional_int64 = 2; |
||||
uint32 optional_uint32 = 3; |
||||
uint64 optional_uint64 = 4; |
||||
bool optional_bool = 5; |
||||
double optional_double = 6; |
||||
float optional_float = 7; |
||||
string optional_string = 8; |
||||
bytes optional_bytes = 9; |
||||
TestEnum optional_enum = 10; |
||||
TestMessage optional_msg = 11; |
||||
repeated int32 repeated_int32 = 21; |
||||
repeated int64 repeated_int64 = 22; |
||||
repeated uint32 repeated_uint32 = 23; |
||||
repeated uint64 repeated_uint64 = 24; |
||||
repeated bool repeated_bool = 25; |
||||
repeated double repeated_double = 26; |
||||
repeated float repeated_float = 27; |
||||
repeated string repeated_string = 28; |
||||
repeated bytes repeated_bytes = 29; |
||||
repeated TestEnum repeated_enum = 30; |
||||
repeated TestMessage repeated_msg = 31; |
||||
int32 required_int32 = 41 [features.field_presence = LEGACY_REQUIRED]; |
||||
|
||||
int64 required_int64 = 42 [features.field_presence = LEGACY_REQUIRED]; |
||||
|
||||
uint32 required_uint32 = 43 [features.field_presence = LEGACY_REQUIRED]; |
||||
|
||||
uint64 required_uint64 = 44 [features.field_presence = LEGACY_REQUIRED]; |
||||
|
||||
bool required_bool = 45 [features.field_presence = LEGACY_REQUIRED]; |
||||
|
||||
double required_double = 46 [features.field_presence = LEGACY_REQUIRED]; |
||||
|
||||
float required_float = 47 [features.field_presence = LEGACY_REQUIRED]; |
||||
|
||||
string required_string = 48 [features.field_presence = LEGACY_REQUIRED]; |
||||
|
||||
bytes required_bytes = 49 [features.field_presence = LEGACY_REQUIRED]; |
||||
|
||||
TestEnum required_enum = 50 [features.field_presence = LEGACY_REQUIRED]; |
||||
|
||||
TestMessage required_msg = 51 [features.field_presence = LEGACY_REQUIRED]; |
||||
|
||||
oneof my_oneof { |
||||
int32 oneof_int32 = 61; |
||||
int64 oneof_int64 = 62; |
||||
uint32 oneof_uint32 = 63; |
||||
uint64 oneof_uint64 = 64; |
||||
bool oneof_bool = 65; |
||||
double oneof_double = 66; |
||||
float oneof_float = 67; |
||||
string oneof_string = 68; |
||||
bytes oneof_bytes = 69; |
||||
TestEnum oneof_enum = 70; |
||||
TestMessage oneof_msg = 71; |
||||
} |
||||
|
||||
message NestedMessage { |
||||
int32 foo = 1; |
||||
} |
||||
|
||||
NestedMessage nested_message = 80; |
||||
|
||||
// Reserved for non-existing field test. |
||||
// int32 non_exist = 89; |
||||
} |
||||
|
||||
enum TestEnum { |
||||
option features.enum_type = CLOSED; |
||||
|
||||
Default = 0; |
||||
A = 1; |
||||
B = 2; |
||||
C = 3; |
||||
v0 = 4; |
||||
} |
||||
|
||||
message TestUnknown { |
||||
TestUnknown optional_unknown = 11; |
||||
repeated TestUnknown repeated_unknown = 31; |
||||
|
||||
oneof my_oneof { |
||||
TestUnknown oneof_unknown = 51; |
||||
} |
||||
|
||||
int32 unknown_field = 89; |
||||
} |
Loading…
Reference in new issue