From 77f62de93e2e84d6aab0364629919779970fb9f1 Mon Sep 17 00:00:00 2001 From: Mike Kruskal Date: Wed, 10 Apr 2024 20:24:06 -0700 Subject: [PATCH] Define lifetimes of edition 2023 features PiperOrigin-RevId: 623690798 --- .../google/protobuf/java_features.proto | 19 +++ .../compiler/cpp/generator_unittest.cc | 9 +- .../compiler/java/java_features.pb.cc | 30 ++-- src/google/protobuf/cpp_features.pb.cc | 25 ++-- src/google/protobuf/cpp_features.proto | 13 ++ src/google/protobuf/descriptor.pb.cc | 133 +++++++++--------- src/google/protobuf/descriptor.proto | 24 ++++ 7 files changed, 164 insertions(+), 89 deletions(-) diff --git a/java/core/src/main/resources/google/protobuf/java_features.proto b/java/core/src/main/resources/google/protobuf/java_features.proto index d02d067a397c..075f67a113bf 100644 --- a/java/core/src/main/resources/google/protobuf/java_features.proto +++ b/java/core/src/main/resources/google/protobuf/java_features.proto @@ -27,6 +27,15 @@ message JavaFeatures { retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, + // TODO Enable this in google3 once protoc rolls out. + feature_support = { + edition_introduced: EDITION_2023, + edition_deprecated: EDITION_2023, + deprecation_warning: "The legacy closed enum treatment in Java is " + "deprecated and is scheduled to be removed in " + "edition 2025. Mark enum type on the enum " + "definitions themselves rather than on fields.", + }, edition_defaults = { edition: EDITION_PROTO2, value: "true" }, edition_defaults = { edition: EDITION_PROTO3, value: "false" } ]; @@ -47,6 +56,16 @@ message JavaFeatures { retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, + // TODO Enable this in google3 once protoc rolls out. + feature_support = { + edition_introduced: EDITION_2023, + edition_deprecated: EDITION_2023, + deprecation_warning: "The Java-specific utf8 validation feature is " + "deprecated and is scheduled to be removed in " + "edition 2025. Utf8 validation behavior should " + "use the global cross-language utf8_validation " + "feature.", + }, edition_defaults = { edition: EDITION_PROTO2, value: "DEFAULT" } ]; } diff --git a/src/google/protobuf/compiler/cpp/generator_unittest.cc b/src/google/protobuf/compiler/cpp/generator_unittest.cc index 201805a81c53..24dad7da793c 100644 --- a/src/google/protobuf/compiler/cpp/generator_unittest.cc +++ b/src/google/protobuf/compiler/cpp/generator_unittest.cc @@ -97,8 +97,9 @@ TEST_F(CppGeneratorTest, LegacyClosedEnum) { RunProtoc( "protocol_compiler --proto_path=$tmpdir --cpp_out=$tmpdir foo.proto"); - - ExpectNoErrors(); + ExpectWarningSubstring( + "foo.proto:9:16: warning: Feature pb.CppFeatures.legacy_closed_enum has " + "been deprecated in edition 2023"); } TEST_F(CppGeneratorTest, LegacyClosedEnumInherited) { @@ -119,7 +120,9 @@ TEST_F(CppGeneratorTest, LegacyClosedEnumInherited) { RunProtoc( "protocol_compiler --proto_path=$tmpdir --cpp_out=$tmpdir foo.proto"); - ExpectNoErrors(); + ExpectWarningSubstring( + "foo.proto: warning: Feature pb.CppFeatures.legacy_closed_enum has " + "been deprecated in edition 2023"); } TEST_F(CppGeneratorTest, LegacyClosedEnumImplicit) { diff --git a/src/google/protobuf/compiler/java/java_features.pb.cc b/src/google/protobuf/compiler/java/java_features.pb.cc index 0659158da1f4..856f31723c2a 100644 --- a/src/google/protobuf/compiler/java/java_features.pb.cc +++ b/src/google/protobuf/compiler/java/java_features.pb.cc @@ -76,15 +76,25 @@ const char descriptor_table_protodef_google_2fprotobuf_2fcompiler_2fjava_2fjava_ protodesc_cold) = { "\n1google/protobuf/compiler/java/java_fea" "tures.proto\022\002pb\032 google/protobuf/descrip" - "tor.proto\"\352\001\n\014JavaFeatures\022>\n\022legacy_clo" - "sed_enum\030\001 \001(\010B\"\210\001\001\230\001\004\230\001\001\242\001\t\022\004true\030\346\007\242\001\n" - "\022\005false\030\347\007\022R\n\017utf8_validation\030\002 \001(\0162\037.pb" - ".JavaFeatures.Utf8ValidationB\030\210\001\001\230\001\004\230\001\001\242" - "\001\014\022\007DEFAULT\030\346\007\"F\n\016Utf8Validation\022\033\n\027UTF8" - "_VALIDATION_UNKNOWN\020\000\022\013\n\007DEFAULT\020\001\022\n\n\006VE" - "RIFY\020\002:<\n\004java\022\033.google.protobuf.Feature" - "Set\030\351\007 \001(\0132\020.pb.JavaFeaturesB(\n\023com.goog" - "le.protobufB\021JavaFeaturesProto" + "tor.proto\"\367\004\n\014JavaFeatures\022\374\001\n\022legacy_cl" + "osed_enum\030\001 \001(\010B\337\001\210\001\001\230\001\004\230\001\001\242\001\t\022\004true\030\346\007\242" + "\001\n\022\005false\030\347\007\262\001\271\001\010\350\007\020\350\007\032\260\001The legacy clos" + "ed enum treatment in Java is deprecated " + "and is scheduled to be removed in editio" + "n 2025. Mark enum type on the enum defi" + "nitions themselves rather than on fields" + ".\022\237\002\n\017utf8_validation\030\002 \001(\0162\037.pb.JavaFea" + "tures.Utf8ValidationB\344\001\210\001\001\230\001\004\230\001\001\242\001\014\022\007DEF" + "AULT\030\346\007\262\001\310\001\010\350\007\020\350\007\032\277\001The Java-specific ut" + "f8 validation feature is deprecated and " + "is scheduled to be removed in edition 20" + "25. Utf8 validation behavior should use" + " the global cross-language utf8_validati" + "on feature.\"F\n\016Utf8Validation\022\033\n\027UTF8_VA" + "LIDATION_UNKNOWN\020\000\022\013\n\007DEFAULT\020\001\022\n\n\006VERIF" + "Y\020\002:<\n\004java\022\033.google.protobuf.FeatureSet" + "\030\351\007 \001(\0132\020.pb.JavaFeaturesB(\n\023com.google." + "protobufB\021JavaFeaturesProto" }; static const ::_pbi::DescriptorTable* const descriptor_table_google_2fprotobuf_2fcompiler_2fjava_2fjava_5ffeatures_2eproto_deps[1] = { @@ -94,7 +104,7 @@ static ::absl::once_flag descriptor_table_google_2fprotobuf_2fcompiler_2fjava_2f PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fcompiler_2fjava_2fjava_5ffeatures_2eproto = { false, false, - 430, + 827, descriptor_table_protodef_google_2fprotobuf_2fcompiler_2fjava_2fjava_5ffeatures_2eproto, "google/protobuf/compiler/java/java_features.proto", &descriptor_table_google_2fprotobuf_2fcompiler_2fjava_2fjava_5ffeatures_2eproto_once, diff --git a/src/google/protobuf/cpp_features.pb.cc b/src/google/protobuf/cpp_features.pb.cc index 50bf3ed6aee1..abfd9e4079b5 100644 --- a/src/google/protobuf/cpp_features.pb.cc +++ b/src/google/protobuf/cpp_features.pb.cc @@ -75,15 +75,20 @@ static const ::_pb::Message* const file_default_instances[] = { const char descriptor_table_protodef_google_2fprotobuf_2fcpp_5ffeatures_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE( protodesc_cold) = { "\n\"google/protobuf/cpp_features.proto\022\002pb" - "\032 google/protobuf/descriptor.proto\"\352\001\n\013C" - "ppFeatures\022>\n\022legacy_closed_enum\030\001 \001(\010B\"" - "\210\001\001\230\001\004\230\001\001\242\001\t\022\004true\030\346\007\242\001\n\022\005false\030\347\007\022T\n\013st" - "ring_type\030\002 \001(\0162\032.pb.CppFeatures.StringT" - "ypeB#\210\001\001\230\001\004\230\001\001\242\001\013\022\006STRING\030\346\007\242\001\t\022\004VIEW\030\351\007" - "\"E\n\nStringType\022\027\n\023STRING_TYPE_UNKNOWN\020\000\022" - "\010\n\004VIEW\020\001\022\010\n\004CORD\020\002\022\n\n\006STRING\020\003::\n\003cpp\022\033" - ".google.protobuf.FeatureSet\030\350\007 \001(\0132\017.pb." - "CppFeatures" + "\032 google/protobuf/descriptor.proto\"\256\003\n\013C" + "ppFeatures\022\373\001\n\022legacy_closed_enum\030\001 \001(\010B" + "\336\001\210\001\001\230\001\004\230\001\001\242\001\t\022\004true\030\346\007\242\001\n\022\005false\030\347\007\262\001\270\001" + "\010\350\007\020\350\007\032\257\001The legacy closed enum treatmen" + "t in C++ is deprecated and is scheduled " + "to be removed in edition 2025. Mark enu" + "m type on the enum definitions themselve" + "s rather than on fields.\022Z\n\013string_type\030" + "\002 \001(\0162\032.pb.CppFeatures.StringTypeB)\210\001\001\230\001" + "\004\230\001\001\242\001\013\022\006STRING\030\346\007\242\001\t\022\004VIEW\030\351\007\262\001\003\010\350\007\"E\n\n" + "StringType\022\027\n\023STRING_TYPE_UNKNOWN\020\000\022\010\n\004V" + "IEW\020\001\022\010\n\004CORD\020\002\022\n\n\006STRING\020\003::\n\003cpp\022\033.goo" + "gle.protobuf.FeatureSet\030\350\007 \001(\0132\017.pb.CppF" + "eatures" }; static const ::_pbi::DescriptorTable* const descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2eproto_deps[1] = { @@ -93,7 +98,7 @@ static ::absl::once_flag descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2ep PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2eproto = { false, false, - 371, + 567, descriptor_table_protodef_google_2fprotobuf_2fcpp_5ffeatures_2eproto, "google/protobuf/cpp_features.proto", &descriptor_table_google_2fprotobuf_2fcpp_5ffeatures_2eproto_once, diff --git a/src/google/protobuf/cpp_features.proto b/src/google/protobuf/cpp_features.proto index 64157eeb3e56..605f67b4ba44 100644 --- a/src/google/protobuf/cpp_features.proto +++ b/src/google/protobuf/cpp_features.proto @@ -24,6 +24,15 @@ message CppFeatures { retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, + // TODO Enable this in google3 once protoc rolls out. + feature_support = { + edition_introduced: EDITION_2023, + edition_deprecated: EDITION_2023, + deprecation_warning: "The legacy closed enum treatment in C++ is " + "deprecated and is scheduled to be removed in " + "edition 2025. Mark enum type on the enum " + "definitions themselves rather than on fields.", + }, edition_defaults = { edition: EDITION_PROTO2, value: "true" }, edition_defaults = { edition: EDITION_PROTO3, value: "false" } ]; @@ -39,6 +48,10 @@ message CppFeatures { retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, + // TODO Enable this in google3 once protoc rolls out. + feature_support = { + edition_introduced: EDITION_2023, + }, edition_defaults = { edition: EDITION_PROTO2, value: "STRING" }, edition_defaults = { edition: EDITION_2024, value: "VIEW" } ]; diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc index 20bd1bd9837c..105850f40798 100644 --- a/src/google/protobuf/descriptor.pb.cc +++ b/src/google/protobuf/descriptor.pb.cc @@ -1900,77 +1900,78 @@ const char descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto[] AB "ive_int_value\030\005 \001(\003\022\024\n\014double_value\030\006 \001(" "\001\022\024\n\014string_value\030\007 \001(\014\022\027\n\017aggregate_val" "ue\030\010 \001(\t\0323\n\010NamePart\022\021\n\tname_part\030\001 \002(\t\022" - "\024\n\014is_extension\030\002 \002(\010\"\265\t\n\nFeatureSet\022|\n\016" - "field_presence\030\001 \001(\0162).google.protobuf.F" - "eatureSet.FieldPresenceB9\210\001\001\230\001\004\230\001\001\242\001\r\022\010E" - "XPLICIT\030\346\007\242\001\r\022\010IMPLICIT\030\347\007\242\001\r\022\010EXPLICIT\030" - "\350\007\022\\\n\tenum_type\030\002 \001(\0162$.google.protobuf." - "FeatureSet.EnumTypeB#\210\001\001\230\001\006\230\001\001\242\001\013\022\006CLOSE" - "D\030\346\007\242\001\t\022\004OPEN\030\347\007\022{\n\027repeated_field_encod" - "ing\030\003 \001(\01621.google.protobuf.FeatureSet.R" - "epeatedFieldEncodingB\'\210\001\001\230\001\004\230\001\001\242\001\r\022\010EXPA" - "NDED\030\346\007\242\001\013\022\006PACKED\030\347\007\022h\n\017utf8_validation" - "\030\004 \001(\0162*.google.protobuf.FeatureSet.Utf8" - "ValidationB#\210\001\001\230\001\004\230\001\001\242\001\t\022\004NONE\030\346\007\242\001\013\022\006VE" - "RIFY\030\347\007\022g\n\020message_encoding\030\005 \001(\0162+.goog" - "le.protobuf.FeatureSet.MessageEncodingB " - "\210\001\001\230\001\004\230\001\001\242\001\024\022\017LENGTH_PREFIXED\030\346\007\022p\n\013json" - "_format\030\006 \001(\0162&.google.protobuf.FeatureS" - "et.JsonFormatB3\210\001\001\230\001\003\230\001\006\230\001\001\242\001\027\022\022LEGACY_B" - "EST_EFFORT\030\346\007\242\001\n\022\005ALLOW\030\347\007\"\\\n\rFieldPrese" - "nce\022\032\n\026FIELD_PRESENCE_UNKNOWN\020\000\022\014\n\010EXPLI" - "CIT\020\001\022\014\n\010IMPLICIT\020\002\022\023\n\017LEGACY_REQUIRED\020\003" - "\"7\n\010EnumType\022\025\n\021ENUM_TYPE_UNKNOWN\020\000\022\010\n\004O" - "PEN\020\001\022\n\n\006CLOSED\020\002\"V\n\025RepeatedFieldEncodi" - "ng\022#\n\037REPEATED_FIELD_ENCODING_UNKNOWN\020\000\022" - "\n\n\006PACKED\020\001\022\014\n\010EXPANDED\020\002\"C\n\016Utf8Validat" - "ion\022\033\n\027UTF8_VALIDATION_UNKNOWN\020\000\022\n\n\006VERI" - "FY\020\002\022\010\n\004NONE\020\003\"S\n\017MessageEncoding\022\034\n\030MES" - "SAGE_ENCODING_UNKNOWN\020\000\022\023\n\017LENGTH_PREFIX" - "ED\020\001\022\r\n\tDELIMITED\020\002\"H\n\nJsonFormat\022\027\n\023JSO" - "N_FORMAT_UNKNOWN\020\000\022\t\n\005ALLOW\020\001\022\026\n\022LEGACY_" - "BEST_EFFORT\020\002*\006\010\350\007\020\351\007*\006\010\351\007\020\352\007*\006\010\352\007\020\353\007*\006\010" - "\206N\020\207N*\006\010\213N\020\220N*\006\010\220N\020\221NJ\006\010\347\007\020\350\007\"\261\003\n\022Featur" - "eSetDefaults\022N\n\010defaults\030\001 \003(\0132<.google." - "protobuf.FeatureSetDefaults.FeatureSetEd" - "itionDefault\0221\n\017minimum_edition\030\004 \001(\0162\030." - "google.protobuf.Edition\0221\n\017maximum_editi" - "on\030\005 \001(\0162\030.google.protobuf.Edition\032\344\001\n\030F" - "eatureSetEditionDefault\022)\n\007edition\030\003 \001(\016" - "2\030.google.protobuf.Edition\0229\n\024overridabl" - "e_features\030\004 \001(\0132\033.google.protobuf.Featu" - "reSet\0223\n\016fixed_features\030\005 \001(\0132\033.google.p" - "rotobuf.FeatureSet\022-\n\010features\030\002 \001(\0132\033.g" - "oogle.protobuf.FeatureSet\"\325\001\n\016SourceCode" - "Info\022:\n\010location\030\001 \003(\0132(.google.protobuf" - ".SourceCodeInfo.Location\032\206\001\n\010Location\022\020\n" - "\004path\030\001 \003(\005B\002\020\001\022\020\n\004span\030\002 \003(\005B\002\020\001\022\030\n\020lea" - "ding_comments\030\003 \001(\t\022\031\n\021trailing_comments" - "\030\004 \001(\t\022!\n\031leading_detached_comments\030\006 \003(" - "\t\"\234\002\n\021GeneratedCodeInfo\022A\n\nannotation\030\001 " - "\003(\0132-.google.protobuf.GeneratedCodeInfo." - "Annotation\032\303\001\n\nAnnotation\022\020\n\004path\030\001 \003(\005B" - "\002\020\001\022\023\n\013source_file\030\002 \001(\t\022\r\n\005begin\030\003 \001(\005\022" - "\013\n\003end\030\004 \001(\005\022H\n\010semantic\030\005 \001(\01626.google." - "protobuf.GeneratedCodeInfo.Annotation.Se" - "mantic\"(\n\010Semantic\022\010\n\004NONE\020\000\022\007\n\003SET\020\001\022\t\n" - "\005ALIAS\020\002*\247\002\n\007Edition\022\023\n\017EDITION_UNKNOWN\020" - "\000\022\023\n\016EDITION_LEGACY\020\204\007\022\023\n\016EDITION_PROTO2" - "\020\346\007\022\023\n\016EDITION_PROTO3\020\347\007\022\021\n\014EDITION_2023" - "\020\350\007\022\021\n\014EDITION_2024\020\351\007\022\027\n\023EDITION_1_TEST" - "_ONLY\020\001\022\027\n\023EDITION_2_TEST_ONLY\020\002\022\035\n\027EDIT" - "ION_99997_TEST_ONLY\020\235\215\006\022\035\n\027EDITION_99998" - "_TEST_ONLY\020\236\215\006\022\035\n\027EDITION_99999_TEST_ONL" - "Y\020\237\215\006\022\023\n\013EDITION_MAX\020\377\377\377\377\007B~\n\023com.google" - ".protobufB\020DescriptorProtosH\001Z-google.go" - "lang.org/protobuf/types/descriptorpb\370\001\001\242" - "\002\003GPB\252\002\032Google.Protobuf.Reflection" + "\024\n\014is_extension\030\002 \002(\010\"\333\t\n\nFeatureSet\022\202\001\n" + "\016field_presence\030\001 \001(\0162).google.protobuf." + "FeatureSet.FieldPresenceB\?\210\001\001\230\001\004\230\001\001\242\001\r\022\010" + "EXPLICIT\030\346\007\242\001\r\022\010IMPLICIT\030\347\007\242\001\r\022\010EXPLICIT" + "\030\350\007\262\001\003\010\350\007\022b\n\tenum_type\030\002 \001(\0162$.google.pr" + "otobuf.FeatureSet.EnumTypeB)\210\001\001\230\001\006\230\001\001\242\001\013" + "\022\006CLOSED\030\346\007\242\001\t\022\004OPEN\030\347\007\262\001\003\010\350\007\022\201\001\n\027repeat" + "ed_field_encoding\030\003 \001(\01621.google.protobu" + "f.FeatureSet.RepeatedFieldEncodingB-\210\001\001\230" + "\001\004\230\001\001\242\001\r\022\010EXPANDED\030\346\007\242\001\013\022\006PACKED\030\347\007\262\001\003\010\350" + "\007\022n\n\017utf8_validation\030\004 \001(\0162*.google.prot" + "obuf.FeatureSet.Utf8ValidationB)\210\001\001\230\001\004\230\001" + "\001\242\001\t\022\004NONE\030\346\007\242\001\013\022\006VERIFY\030\347\007\262\001\003\010\350\007\022m\n\020mes" + "sage_encoding\030\005 \001(\0162+.google.protobuf.Fe" + "atureSet.MessageEncodingB&\210\001\001\230\001\004\230\001\001\242\001\024\022\017" + "LENGTH_PREFIXED\030\346\007\262\001\003\010\350\007\022v\n\013json_format\030" + "\006 \001(\0162&.google.protobuf.FeatureSet.JsonF" + "ormatB9\210\001\001\230\001\003\230\001\006\230\001\001\242\001\027\022\022LEGACY_BEST_EFFO" + "RT\030\346\007\242\001\n\022\005ALLOW\030\347\007\262\001\003\010\350\007\"\\\n\rFieldPresenc" + "e\022\032\n\026FIELD_PRESENCE_UNKNOWN\020\000\022\014\n\010EXPLICI" + "T\020\001\022\014\n\010IMPLICIT\020\002\022\023\n\017LEGACY_REQUIRED\020\003\"7" + "\n\010EnumType\022\025\n\021ENUM_TYPE_UNKNOWN\020\000\022\010\n\004OPE" + "N\020\001\022\n\n\006CLOSED\020\002\"V\n\025RepeatedFieldEncoding" + "\022#\n\037REPEATED_FIELD_ENCODING_UNKNOWN\020\000\022\n\n" + "\006PACKED\020\001\022\014\n\010EXPANDED\020\002\"C\n\016Utf8Validatio" + "n\022\033\n\027UTF8_VALIDATION_UNKNOWN\020\000\022\n\n\006VERIFY" + "\020\002\022\010\n\004NONE\020\003\"S\n\017MessageEncoding\022\034\n\030MESSA" + "GE_ENCODING_UNKNOWN\020\000\022\023\n\017LENGTH_PREFIXED" + "\020\001\022\r\n\tDELIMITED\020\002\"H\n\nJsonFormat\022\027\n\023JSON_" + "FORMAT_UNKNOWN\020\000\022\t\n\005ALLOW\020\001\022\026\n\022LEGACY_BE" + "ST_EFFORT\020\002*\006\010\350\007\020\351\007*\006\010\351\007\020\352\007*\006\010\352\007\020\353\007*\006\010\206N" + "\020\207N*\006\010\213N\020\220N*\006\010\220N\020\221NJ\006\010\347\007\020\350\007\"\261\003\n\022FeatureS" + "etDefaults\022N\n\010defaults\030\001 \003(\0132<.google.pr" + "otobuf.FeatureSetDefaults.FeatureSetEdit" + "ionDefault\0221\n\017minimum_edition\030\004 \001(\0162\030.go" + "ogle.protobuf.Edition\0221\n\017maximum_edition" + "\030\005 \001(\0162\030.google.protobuf.Edition\032\344\001\n\030Fea" + "tureSetEditionDefault\022)\n\007edition\030\003 \001(\0162\030" + ".google.protobuf.Edition\0229\n\024overridable_" + "features\030\004 \001(\0132\033.google.protobuf.Feature" + "Set\0223\n\016fixed_features\030\005 \001(\0132\033.google.pro" + "tobuf.FeatureSet\022-\n\010features\030\002 \001(\0132\033.goo" + "gle.protobuf.FeatureSet\"\325\001\n\016SourceCodeIn" + "fo\022:\n\010location\030\001 \003(\0132(.google.protobuf.S" + "ourceCodeInfo.Location\032\206\001\n\010Location\022\020\n\004p" + "ath\030\001 \003(\005B\002\020\001\022\020\n\004span\030\002 \003(\005B\002\020\001\022\030\n\020leadi" + "ng_comments\030\003 \001(\t\022\031\n\021trailing_comments\030\004" + " \001(\t\022!\n\031leading_detached_comments\030\006 \003(\t\"" + "\234\002\n\021GeneratedCodeInfo\022A\n\nannotation\030\001 \003(" + "\0132-.google.protobuf.GeneratedCodeInfo.An" + "notation\032\303\001\n\nAnnotation\022\020\n\004path\030\001 \003(\005B\002\020" + "\001\022\023\n\013source_file\030\002 \001(\t\022\r\n\005begin\030\003 \001(\005\022\013\n" + "\003end\030\004 \001(\005\022H\n\010semantic\030\005 \001(\01626.google.pr" + "otobuf.GeneratedCodeInfo.Annotation.Sema" + "ntic\"(\n\010Semantic\022\010\n\004NONE\020\000\022\007\n\003SET\020\001\022\t\n\005A" + "LIAS\020\002*\247\002\n\007Edition\022\023\n\017EDITION_UNKNOWN\020\000\022" + "\023\n\016EDITION_LEGACY\020\204\007\022\023\n\016EDITION_PROTO2\020\346" + "\007\022\023\n\016EDITION_PROTO3\020\347\007\022\021\n\014EDITION_2023\020\350" + "\007\022\021\n\014EDITION_2024\020\351\007\022\027\n\023EDITION_1_TEST_O" + "NLY\020\001\022\027\n\023EDITION_2_TEST_ONLY\020\002\022\035\n\027EDITIO" + "N_99997_TEST_ONLY\020\235\215\006\022\035\n\027EDITION_99998_T" + "EST_ONLY\020\236\215\006\022\035\n\027EDITION_99999_TEST_ONLY\020" + "\237\215\006\022\023\n\013EDITION_MAX\020\377\377\377\377\007B~\n\023com.google.p" + "rotobufB\020DescriptorProtosH\001Z-google.gola" + "ng.org/protobuf/types/descriptorpb\370\001\001\242\002\003" + "GPB\252\002\032Google.Protobuf.Reflection" }; static ::absl::once_flag descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once; PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_google_2fprotobuf_2fdescriptor_2eproto = { false, false, - 9994, + 10032, descriptor_table_protodef_google_2fprotobuf_2fdescriptor_2eproto, "google/protobuf/descriptor.proto", &descriptor_table_google_2fprotobuf_2fdescriptor_2eproto_once, diff --git a/src/google/protobuf/descriptor.proto b/src/google/protobuf/descriptor.proto index f54495f89f86..ec194b4da058 100644 --- a/src/google/protobuf/descriptor.proto +++ b/src/google/protobuf/descriptor.proto @@ -970,6 +970,10 @@ message FeatureSet { retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, + // TODO Enable this in google3 once protoc rolls out. + feature_support = { + edition_introduced: EDITION_2023, + }, edition_defaults = { edition: EDITION_PROTO2, value: "EXPLICIT" }, edition_defaults = { edition: EDITION_PROTO3, value: "IMPLICIT" }, edition_defaults = { edition: EDITION_2023, value: "EXPLICIT" } @@ -984,6 +988,10 @@ message FeatureSet { retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, + // TODO Enable this in google3 once protoc rolls out. + feature_support = { + edition_introduced: EDITION_2023, + }, edition_defaults = { edition: EDITION_PROTO2, value: "CLOSED" }, edition_defaults = { edition: EDITION_PROTO3, value: "OPEN" } ]; @@ -997,6 +1005,10 @@ message FeatureSet { retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, + // TODO Enable this in google3 once protoc rolls out. + feature_support = { + edition_introduced: EDITION_2023, + }, edition_defaults = { edition: EDITION_PROTO2, value: "EXPANDED" }, edition_defaults = { edition: EDITION_PROTO3, value: "PACKED" } ]; @@ -1010,6 +1022,10 @@ message FeatureSet { retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, + // TODO Enable this in google3 once protoc rolls out. + feature_support = { + edition_introduced: EDITION_2023, + }, edition_defaults = { edition: EDITION_PROTO2, value: "NONE" }, edition_defaults = { edition: EDITION_PROTO3, value: "VERIFY" } ]; @@ -1023,6 +1039,10 @@ message FeatureSet { retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, + // TODO Enable this in google3 once protoc rolls out. + feature_support = { + edition_introduced: EDITION_2023, + }, edition_defaults = { edition: EDITION_PROTO2, value: "LENGTH_PREFIXED" } ]; @@ -1036,6 +1056,10 @@ message FeatureSet { targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, + // TODO Enable this in google3 once protoc rolls out. + feature_support = { + edition_introduced: EDITION_2023, + }, edition_defaults = { edition: EDITION_PROTO2, value: "LEGACY_BEST_EFFORT" }, edition_defaults = { edition: EDITION_PROTO3, value: "ALLOW" } ];