Skip to content

Commit d89007c

Browse files
committed
bump protoc version
1 parent 54bed51 commit d89007c

File tree

13 files changed

+95
-46
lines changed

13 files changed

+95
-46
lines changed

include/google/protobuf/any.proto

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ syntax = "proto3";
3232

3333
package google.protobuf;
3434

35-
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
3635
option go_package = "google.golang.org/protobuf/types/known/anypb";
3736
option java_package = "com.google.protobuf";
3837
option java_outer_classname = "AnyProto";
3938
option java_multiple_files = true;
4039
option objc_class_prefix = "GPB";
40+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
4141

4242
// `Any` contains an arbitrary serialized protocol buffer message along with a
4343
// URL that describes the type of the serialized message.
@@ -63,6 +63,10 @@ option objc_class_prefix = "GPB";
6363
// if (any.is(Foo.class)) {
6464
// foo = any.unpack(Foo.class);
6565
// }
66+
// // or ...
67+
// if (any.isSameTypeAs(Foo.getDefaultInstance())) {
68+
// foo = any.unpack(Foo.getDefaultInstance());
69+
// }
6670
//
6771
// Example 3: Pack and unpack a message in Python.
6872
//
@@ -93,7 +97,6 @@ option objc_class_prefix = "GPB";
9397
// in the type URL, for example "foo.bar.com/x/y.z" will yield type
9498
// name "y.z".
9599
//
96-
//
97100
// JSON
98101
//
99102
// The JSON representation of an `Any` value uses the regular

include/google/protobuf/api.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ package google.protobuf;
3535
import "google/protobuf/source_context.proto";
3636
import "google/protobuf/type.proto";
3737

38-
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
3938
option java_package = "com.google.protobuf";
4039
option java_outer_classname = "ApiProto";
4140
option java_multiple_files = true;
4241
option objc_class_prefix = "GPB";
42+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
4343
option go_package = "google.golang.org/protobuf/types/known/apipb";
4444

4545
// Api is a light-weight descriptor for an API Interface.
@@ -82,7 +82,6 @@ message Api {
8282
// be omitted. Zero major versions must only be used for
8383
// experimental, non-GA interfaces.
8484
//
85-
//
8685
string version = 4;
8786

8887
// Source context for the protocol buffer service represented by this

include/google/protobuf/compiler/plugin.proto

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@
3030

3131
// Author: [email protected] (Kenton Varda)
3232
//
33-
// WARNING: The plugin interface is currently EXPERIMENTAL and is subject to
34-
// change.
35-
//
3633
// protoc (aka the Protocol Compiler) can be extended via plugins. A plugin is
3734
// just a program that reads a CodeGeneratorRequest from stdin and writes a
3835
// CodeGeneratorResponse to stdout.
@@ -50,6 +47,7 @@ package google.protobuf.compiler;
5047
option java_package = "com.google.protobuf.compiler";
5148
option java_outer_classname = "PluginProtos";
5249

50+
option csharp_namespace = "Google.Protobuf.Compiler";
5351
option go_package = "google.golang.org/protobuf/types/pluginpb";
5452

5553
import "google/protobuf/descriptor.proto";
@@ -92,7 +90,6 @@ message CodeGeneratorRequest {
9290

9391
// The version number of protocol compiler.
9492
optional Version compiler_version = 3;
95-
9693
}
9794

9895
// The plugin writes an encoded CodeGeneratorResponse to stdout.

include/google/protobuf/descriptor.proto

Lines changed: 77 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
// A valid .proto file can be translated directly to a FileDescriptorProto
3737
// without any other information (e.g. without reading its imports).
3838

39-
4039
syntax = "proto2";
4140

4241
package google.protobuf;
@@ -86,8 +85,13 @@ message FileDescriptorProto {
8685
optional SourceCodeInfo source_code_info = 9;
8786

8887
// The syntax of the proto file.
89-
// The supported values are "proto2" and "proto3".
88+
// The supported values are "proto2", "proto3", and "editions".
89+
//
90+
// If `edition` is present, this value must be "editions".
9091
optional string syntax = 12;
92+
93+
// The edition of the proto file, which is an opaque string.
94+
optional string edition = 13;
9195
}
9296

9397
// Describes a message type.
@@ -129,7 +133,6 @@ message ExtensionRangeOptions {
129133
// The parser stores options it doesn't recognize here. See above.
130134
repeated UninterpretedOption uninterpreted_option = 999;
131135

132-
133136
// Clients can define custom options in extensions of this message. See above.
134137
extensions 1000 to max;
135138
}
@@ -305,7 +308,6 @@ message MethodDescriptorProto {
305308
optional bool server_streaming = 6 [default = false];
306309
}
307310

308-
309311
// ===================================================================
310312
// Options
311313

@@ -346,7 +348,6 @@ message FileOptions {
346348
// domain names.
347349
optional string java_package = 1;
348350

349-
350351
// Controls the name of the wrapper Java class generated for the .proto file.
351352
// That class will always contain the .proto file's getDescriptor() method as
352353
// well as any top-level extensions defined in the .proto file.
@@ -373,7 +374,6 @@ message FileOptions {
373374
// This option has no effect on when used with the lite runtime.
374375
optional bool java_string_check_utf8 = 27 [default = false];
375376

376-
377377
// Generated classes can be optimized for speed or code size.
378378
enum OptimizeMode {
379379
SPEED = 1; // Generate complete code for parsing, serialization,
@@ -390,9 +390,6 @@ message FileOptions {
390390
// - Otherwise, the basename of the .proto file, without extension.
391391
optional string go_package = 11;
392392

393-
394-
395-
396393
// Should generic services be generated in each language? "Generic" services
397394
// are not specific to any particular RPC system. They are generated by the
398395
// main code generators in each language (without additional plugins).
@@ -418,7 +415,6 @@ message FileOptions {
418415
// only to generated classes for C++.
419416
optional bool cc_enable_arenas = 31 [default = true];
420417

421-
422418
// Sets the objective c class prefix which is prepended to all objective c
423419
// generated classes from this .proto. There is no default.
424420
optional string objc_class_prefix = 36;
@@ -451,7 +447,6 @@ message FileOptions {
451447
// determining the ruby package.
452448
optional string ruby_package = 45;
453449

454-
455450
// The parser stores options it doesn't recognize here.
456451
// See the documentation for the "Options" section above.
457452
repeated UninterpretedOption uninterpreted_option = 999;
@@ -497,6 +492,10 @@ message MessageOptions {
497492

498493
reserved 4, 5, 6;
499494

495+
// NOTE: Do not set the option in .proto files. Always use the maps syntax
496+
// instead. The option should only be implicitly set by the proto compiler
497+
// parser.
498+
//
500499
// Whether the message is an automatically generated map entry type for the
501500
// maps field.
502501
//
@@ -514,15 +513,22 @@ message MessageOptions {
514513
// use a native map in the target language to hold the keys and values.
515514
// The reflection APIs in such implementations still need to work as
516515
// if the field is a repeated message field.
517-
//
518-
// NOTE: Do not set the option in .proto files. Always use the maps syntax
519-
// instead. The option should only be implicitly set by the proto compiler
520-
// parser.
521516
optional bool map_entry = 7;
522517

523518
reserved 8; // javalite_serializable
524519
reserved 9; // javanano_as_lite
525520

521+
// Enable the legacy handling of JSON field name conflicts. This lowercases
522+
// and strips underscored from the fields before comparison in proto3 only.
523+
// The new behavior takes `json_name` into account and applies to proto2 as
524+
// well.
525+
//
526+
// This should only be used as a temporary measure against broken builds due
527+
// to the change in behavior for JSON field name conflicts.
528+
//
529+
// TODO(b/261750190) This is legacy behavior we plan to remove once downstream
530+
// teams have had time to migrate.
531+
optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];
526532

527533
// The parser stores options it doesn't recognize here. See above.
528534
repeated UninterpretedOption uninterpreted_option = 999;
@@ -592,7 +598,6 @@ message FieldOptions {
592598
// call from multiple threads concurrently, while non-const methods continue
593599
// to require exclusive access.
594600
//
595-
//
596601
// Note that implementations may choose not to check required fields within
597602
// a lazy sub-message. That is, calling IsInitialized() on the outer message
598603
// may return true even if the inner message has missing required fields.
@@ -604,11 +609,8 @@ message FieldOptions {
604609
// check its required fields, regardless of whether or not the message has
605610
// been parsed.
606611
//
607-
// As of 2021, lazy does no correctness checks on the byte stream during
608-
// parsing. This may lead to crashes if and when an invalid byte stream is
609-
// finally parsed upon access.
610-
//
611-
// TODO(b/211906113): Enable validation on lazy fields.
612+
// As of May 2022, lazy verifies the contents of the byte stream during
613+
// parsing. An invalid byte stream will cause the overall parsing to fail.
612614
optional bool lazy = 5 [default = false];
613615

614616
// unverified_lazy does no correctness checks on the byte stream. This should
@@ -625,6 +627,39 @@ message FieldOptions {
625627
// For Google-internal migration only. Do not use.
626628
optional bool weak = 10 [default = false];
627629

630+
// Indicate that the field value should not be printed out when using debug
631+
// formats, e.g. when the field contains sensitive credentials.
632+
optional bool debug_redact = 16 [default = false];
633+
634+
// If set to RETENTION_SOURCE, the option will be omitted from the binary.
635+
// Note: as of January 2023, support for this is in progress and does not yet
636+
// have an effect (b/264593489).
637+
enum OptionRetention {
638+
RETENTION_UNKNOWN = 0;
639+
RETENTION_RUNTIME = 1;
640+
RETENTION_SOURCE = 2;
641+
}
642+
643+
optional OptionRetention retention = 17;
644+
645+
// This indicates the types of entities that the field may apply to when used
646+
// as an option. If it is unset, then the field may be freely used as an
647+
// option on any kind of entity. Note: as of January 2023, support for this is
648+
// in progress and does not yet have an effect (b/264593489).
649+
enum OptionTargetType {
650+
TARGET_TYPE_UNKNOWN = 0;
651+
TARGET_TYPE_FILE = 1;
652+
TARGET_TYPE_EXTENSION_RANGE = 2;
653+
TARGET_TYPE_MESSAGE = 3;
654+
TARGET_TYPE_FIELD = 4;
655+
TARGET_TYPE_ONEOF = 5;
656+
TARGET_TYPE_ENUM = 6;
657+
TARGET_TYPE_ENUM_ENTRY = 7;
658+
TARGET_TYPE_SERVICE = 8;
659+
TARGET_TYPE_METHOD = 9;
660+
}
661+
662+
optional OptionTargetType target = 18;
628663

629664
// The parser stores options it doesn't recognize here. See above.
630665
repeated UninterpretedOption uninterpreted_option = 999;
@@ -657,6 +692,14 @@ message EnumOptions {
657692

658693
reserved 5; // javanano_as_lite
659694

695+
// Enable the legacy handling of JSON field name conflicts. This lowercases
696+
// and strips underscored from the fields before comparison in proto3 only.
697+
// The new behavior takes `json_name` into account and applies to proto2 as
698+
// well.
699+
// TODO(b/261750190) Remove this legacy behavior once downstream teams have
700+
// had time to migrate.
701+
optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];
702+
660703
// The parser stores options it doesn't recognize here. See above.
661704
repeated UninterpretedOption uninterpreted_option = 999;
662705

@@ -729,7 +772,6 @@ message MethodOptions {
729772
extensions 1000 to max;
730773
}
731774

732-
733775
// A message representing a option the parser does not recognize. This only
734776
// appears in options protos created by the compiler::Parser class.
735777
// DescriptorPool resolves these when building Descriptor objects. Therefore,
@@ -914,8 +956,20 @@ message GeneratedCodeInfo {
914956
optional int32 begin = 3;
915957

916958
// Identifies the ending offset in bytes in the generated code that
917-
// relates to the identified offset. The end offset should be one past
959+
// relates to the identified object. The end offset should be one past
918960
// the last relevant byte (so the length of the text = end - begin).
919961
optional int32 end = 4;
962+
963+
// Represents the identified object's effect on the element in the original
964+
// .proto file.
965+
enum Semantic {
966+
// There is no effect or the effect is indescribable.
967+
NONE = 0;
968+
// The element is set or otherwise mutated.
969+
SET = 1;
970+
// An alias to the element is returned.
971+
ALIAS = 2;
972+
}
973+
optional Semantic semantic = 5;
920974
}
921975
}

include/google/protobuf/duration.proto

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ syntax = "proto3";
3232

3333
package google.protobuf;
3434

35-
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
3635
option cc_enable_arenas = true;
3736
option go_package = "google.golang.org/protobuf/types/known/durationpb";
3837
option java_package = "com.google.protobuf";
3938
option java_outer_classname = "DurationProto";
4039
option java_multiple_files = true;
4140
option objc_class_prefix = "GPB";
41+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
4242

4343
// A Duration represents a signed, fixed-length span of time represented
4444
// as a count of seconds and fractions of seconds at nanosecond
@@ -99,7 +99,6 @@ option objc_class_prefix = "GPB";
9999
// be expressed in JSON format as "3.000000001s", and 3 seconds and 1
100100
// microsecond should be expressed in JSON format as "3.000001s".
101101
//
102-
//
103102
message Duration {
104103
// Signed seconds of the span of time. Must be from -315,576,000,000
105104
// to +315,576,000,000 inclusive. Note: these bounds are computed from:

include/google/protobuf/empty.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ syntax = "proto3";
3232

3333
package google.protobuf;
3434

35-
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
3635
option go_package = "google.golang.org/protobuf/types/known/emptypb";
3736
option java_package = "com.google.protobuf";
3837
option java_outer_classname = "EmptyProto";
3938
option java_multiple_files = true;
4039
option objc_class_prefix = "GPB";
40+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
4141
option cc_enable_arenas = true;
4242

4343
// A generic empty message that you can re-use to avoid defining duplicated

include/google/protobuf/field_mask.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ syntax = "proto3";
3232

3333
package google.protobuf;
3434

35-
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
3635
option java_package = "com.google.protobuf";
3736
option java_outer_classname = "FieldMaskProto";
3837
option java_multiple_files = true;
3938
option objc_class_prefix = "GPB";
39+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
4040
option go_package = "google.golang.org/protobuf/types/known/fieldmaskpb";
4141
option cc_enable_arenas = true;
4242

include/google/protobuf/source_context.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ syntax = "proto3";
3232

3333
package google.protobuf;
3434

35-
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
3635
option java_package = "com.google.protobuf";
3736
option java_outer_classname = "SourceContextProto";
3837
option java_multiple_files = true;
3938
option objc_class_prefix = "GPB";
39+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
4040
option go_package = "google.golang.org/protobuf/types/known/sourcecontextpb";
4141

4242
// `SourceContext` represents information about the source of a

include/google/protobuf/struct.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ syntax = "proto3";
3232

3333
package google.protobuf;
3434

35-
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
3635
option cc_enable_arenas = true;
3736
option go_package = "google.golang.org/protobuf/types/known/structpb";
3837
option java_package = "com.google.protobuf";
3938
option java_outer_classname = "StructProto";
4039
option java_multiple_files = true;
4140
option objc_class_prefix = "GPB";
41+
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
4242

4343
// `Struct` represents a structured data value, consisting of fields
4444
// which map to dynamically typed values. In some languages, `Struct`

0 commit comments

Comments
 (0)