Protobuf Team Bot
648c38bd96
Internal change
...
PiperOrigin-RevId: 621265581
8 months ago
Protobuf Team Bot
7dddca8503
Automated rollback of commit 6a2bf46971
.
...
PiperOrigin-RevId: 621254457
8 months ago
Jie Luo
de8e550e90
Nextgen Proto Pythonic API: Add 'in' operator
...
The “in” operator will be consistent with HasField but a little different with Proto Plus.
The detail behavior of “in” operator in Nextgen for Struct (to be consist with old Struct behavior):
-Raise TypeError if not pass a string
-Check if the key is in the struct.fields
The detail behavior of “in” operator in Nextgen(for other message):
-Raise ValueError if not pass a string
-Raise ValueError if the string is not a field
-For Oneof: Check any field under the oneof is set
-For has-presence field: check if set
-For non-has-presence field (include repeated fields): raise ValueError
PiperOrigin-RevId: 621240977
8 months ago
Protobuf Team Bot
3a2cd26c13
Auto-generate files after cl/621236613
8 months ago
Mike Kruskal
4295b95605
Internal change
...
PiperOrigin-RevId: 621236613
8 months ago
Protobuf Team Bot
063c198f59
add empty case to extend repeated and map tests, fix map methods that consumed self
...
PiperOrigin-RevId: 621158946
8 months ago
Protobuf Team Bot
d8251ebc43
Allow string_type for Edition 2023.
...
PiperOrigin-RevId: 621050370
8 months ago
Protobuf Team Bot
132168069d
Auto-generate files after cl/621041035
8 months ago
Mike Kruskal
b09b3e46fe
Add edition lifetime options for feature specs.
...
These will specify the full lifecycle of all features, enforced by protoc and runtimes that support dynamic builds.
PiperOrigin-RevId: 621041035
8 months ago
Mike Kruskal
a916d447c0
Update dependency on setup-php
...
PiperOrigin-RevId: 621030474
8 months ago
Protobuf Team Bot
acdc89a375
Minor cleanup: IWYU, clang-tidy, etc.
...
PiperOrigin-RevId: 621020233
8 months ago
Mike Kruskal
b497787aef
Enable visionos tests after GH runner update
...
PiperOrigin-RevId: 620965206
8 months ago
Protobuf Team Bot
6a2bf46971
Move all TDP parsing to use direct-to-table.
...
DynamicMessage now eagerly creates the tc_table doing proper crosslinking of TDP tables.
Remove all kTvDefault cases from TcParser.
PiperOrigin-RevId: 620943275
8 months ago
Protobuf Team Bot
ab092fc810
Auto-generate files after cl/620857434
8 months ago
Protobuf Team Bot
43fb62e846
Change LazyField to use a flat char array when the unparsed payload is small. This array can easily be allocated in the arena avoiding separate heap usage of the Cord.
...
Also, we remove the ArenaDtor and register the Cord for destruction on demand.
This avoids registering the ArenaDtor on every message with a lazy field.
PiperOrigin-RevId: 620857434
8 months ago
Mike Kruskal
f0f7be2090
Fix failure lists for JRuby and C#, which don't pass all of the new conformance tests.
...
PiperOrigin-RevId: 620366114
8 months ago
Protobuf Team Bot
4b6de0f00b
Auto-generate files after cl/620303837
8 months ago
Eric Salo
d51df2d2d7
upb: make upb_Array_Reserve() a public function
...
PiperOrigin-RevId: 620303837
8 months ago
Eric Salo
74ddc48fa9
upb: fix the Dart conformance test
...
PiperOrigin-RevId: 620299077
8 months ago
Protobuf Team Bot
7f6a0ba347
Implement Extend for Repeated
...
PiperOrigin-RevId: 620277895
8 months ago
Chris Kennelly
11ef0ffb87
Breaking Change: Ensure we allocate overaligned types with aligned operator new.
...
* The alignment may be incorrect.
* Using delete[] otherwise mismatches, since it was not allocated with
overaligned operator new.
Additionally, we add a test to ensure we do not value initialize in this case.
PiperOrigin-RevId: 620241337
8 months ago
Adam Cozzette
b8eeefe663
Internal change
...
PiperOrigin-RevId: 620116943
8 months ago
Protobuf Team Bot
539cf497c6
Update comment referencing removed CreateMaybeMessage API
...
PiperOrigin-RevId: 620089913
8 months ago
Joshua Haberman
1f6580dd0c
Added conformance test for unknown field ordering.
...
Implementations should not rearrange unknown fields for the same field number, because some field types accept multiple wire types (eg. packed and unpacked).
All languages currently pass this test except Java "full" and Obj-C.
PiperOrigin-RevId: 619953711
8 months ago
Alex Eagle
71e4061ace
feat: test bzlmod usage on CI ( #16319 )
...
Closes #16319
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/16319 from protocolbuffers:bcr d66845cfcb
PiperOrigin-RevId: 619939078
8 months ago
Protobuf Team Bot
62620979c2
Add a test for repeated field orderings demonstrating that MessageDifferencer::Equals and MessageDifferencer::Equivalent treat these cases in the same way.
...
PiperOrigin-RevId: 619712729
8 months ago
Chris Kennelly
9b2b61cfb4
Statically assert pointer alignment.
...
We use the lower bits for tagging.
PiperOrigin-RevId: 619606723
8 months ago
Protobuf Team Bot
2693af92b3
Add a field to TestOneof2.NestedMessage.
...
PiperOrigin-RevId: 619532085
8 months ago
Protobuf Team Bot
83ec410d30
Internal change
...
PiperOrigin-RevId: 619377672
8 months ago
Protobuf Team Bot
704d0454dd
Auto-generate files after cl/619359463
8 months ago
Mike Kruskal
7662fdd8ed
Fix toproto behavior for groups and required under editions
...
PiperOrigin-RevId: 619359463
8 months ago
Sandy Zhang
6c45efd297
Fix validateFeatures to be called after resolved features are actually set to this.features
...
PiperOrigin-RevId: 619296935
8 months ago
Anton Grbin
86abf35ef5
Python JSON parser: Ignore invalid enum string values if ignore_unknown_fields is set ( #15887 )
...
# Motivation
This PR fixes failing conformance tests for python with name `IgnoreUnknownEnumStringValue`.
The JSON parsing spec was discussed in https://github.com/protocolbuffers/protobuf/issues/7392 .
Recent equivalent changes for other languages:
* Swift: https://github.com/apple/swift-protobuf/pull/1345
* C#: https://github.com/protocolbuffers/protobuf/pull/15758
# Changes
- 1st commit is a noop refactoring to make relevant _ConvertScalarFieldValue invocations localized
- 2nd commit introduces the child exception of `ParseError` named `EnumStringValueParseError` which is suppressed if `ignore_unknown_fields` is set
- 3rd commit updates the conformance test failure lists
Closes #15887
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/15887 from noom:anton/7392/fix-python-test fbcc93a232
PiperOrigin-RevId: 619288323
8 months ago
Jie Luo
7e033c0be1
internal chnge
...
PiperOrigin-RevId: 619287040
8 months ago
Protobuf Team Bot
1f1e64f804
Auto-generate files after cl/619266468
8 months ago
Mike Kruskal
19c4a7d647
Close conformance test gaps for delimited encoding.
...
This documents existing behavior before we attempt to fix the issues in editions.
PiperOrigin-RevId: 619266468
8 months ago
Protobuf Team Bot
f5c53ac460
Fix build for older compilers.
...
If it doesn't properly do constant initialization on globals we should
not try to call virtual functions on these objects during dynamic
initialization.
Turn off the optimization in these cases.
PiperOrigin-RevId: 619251810
8 months ago
Protobuf Team Bot
b5e69ae141
Auto-generate files after cl/619244115
8 months ago
Mike Kruskal
11e767a899
Fix latent bug in upb editions implementation caught by python conformance tests.
...
PiperOrigin-RevId: 619244115
8 months ago
Protobuf Team Bot
e2d0a9e2a4
Auto-generate files after cl/619196103
8 months ago
Eric Salo
2d9c00ccec
upb: clean up open vs closed enums in the Dart gencode
...
PiperOrigin-RevId: 619196103
8 months ago
Protobuf Team Bot
d4525cb9ed
Automated Code Change
...
PiperOrigin-RevId: 619115088
8 months ago
Jie Luo
a2cc9f7b62
internal change
...
PiperOrigin-RevId: 619038132
8 months ago
Protobuf Team Bot
0f2ad6db5a
Auto-generate files after cl/619015714
8 months ago
Sandy Zhang
274bc7f26f
Move java_features.proto to java/core/srce/main/resources
...
This also fixes maven to package this correctly as google/protobuf/java_features.proto (same dir as WKT/descriptor.proto) instead of com/google/protobuf/java_features.proto.
Fixes https://github.com/protocolbuffers/protobuf/issues/16155
PiperOrigin-RevId: 619015714
8 months ago
Protobuf Team Bot
e879f6bb5f
Auto-generate files after cl/619004014
8 months ago
Joshua Haberman
8612d5e771
Print non-extension fields by field number order instead of .proto file order.
...
This will affect both JSON and TextFormat. The serialization order for these two formats is not specified, so switching from `.proto` file order to field number order should not be breaking.
This does not affect the order of extensions, which are always printed last (even if their field numbers interleave with regular fields.
This change appears to speed up JSON encoding by about 15%:
```
name old speed new speed delta
BM_LoadAdsDescriptor_Upb<NoLayout> 132MB/s ± 2% 129MB/s ±11% ~ (p=0.841 n=5+5)
BM_LoadAdsDescriptor_Upb<WithLayout> 118MB/s ± 1% 118MB/s ± 2% ~ (p=0.841 n=5+5)
BM_LoadAdsDescriptor_Proto2<NoLayout> 62.3MB/s ± 2% 62.4MB/s ± 2% ~ (p=0.841 n=5+5)
BM_LoadAdsDescriptor_Proto2<WithLayout> 61.0MB/s ± 2% 60.1MB/s ± 8% ~ (p=0.421 n=5+5)
BM_Parse_Upb_FileDesc<UseArena, Copy> 566MB/s ± 1% 572MB/s ± 2% ~ (p=0.222 n=5+5)
BM_Parse_Upb_FileDesc<UseArena, Alias> 626MB/s ± 1% 620MB/s ± 3% ~ (p=0.421 n=5+5)
BM_Parse_Upb_FileDesc<InitBlock, Copy> 572MB/s ± 1% 578MB/s ± 2% ~ (p=0.421 n=5+5)
BM_Parse_Upb_FileDesc<InitBlock, Alias> 636MB/s ± 1% 635MB/s ± 2% ~ (p=0.841 n=5+5)
BM_Parse_Proto2<FileDesc, NoArena, Copy> 360MB/s ±12% 345MB/s ±14% ~ (p=0.841 n=5+5)
BM_Parse_Proto2<FileDesc, UseArena, Copy> 692MB/s ± 2% 691MB/s ± 4% ~ (p=0.548 n=5+5)
BM_Parse_Proto2<FileDesc, InitBlock, Copy> 709MB/s ± 1% 705MB/s ± 2% ~ (p=0.841 n=5+5)
BM_Parse_Proto2<FileDescSV, InitBlock, Alias> 642MB/s ± 1% 646MB/s ± 1% ~ (p=0.690 n=5+5)
BM_SerializeDescriptor_Proto2 1.19GB/s ± 8% 1.22GB/s ± 8% ~ (p=0.095 n=5+5)
BM_SerializeDescriptor_Upb 725MB/s ± 1% 732MB/s ± 1% ~ (p=0.056 n=5+5)
BM_JsonParse_Upb 187MB/s ± 1% 188MB/s ± 2% ~ (p=1.000 n=5+4)
BM_JsonParse_Proto2 18.7MB/s ± 1% 18.6MB/s ± 2% ~ (p=0.841 n=5+5)
BM_JsonSerialize_Upb 106MB/s ± 1% 122MB/s ± 1% +14.65% (p=0.008 n=5+5)
BM_JsonSerialize_Proto2 54.0MB/s ± 2% 53.9MB/s ± 3% ~ (p=1.000 n=5+5)
```
PiperOrigin-RevId: 619004014
8 months ago
Protobuf Team Bot
121143551c
Rename PerConstSerialArenaInChunk() to VisitSerialArena() and include first_arena_.
...
PiperOrigin-RevId: 618962988
8 months ago
Sandy Zhang
6483c4755d
Update protoc release to include editions language features protos for Java and C++
...
Fixes https://github.com/protocolbuffers/protobuf/issues/16211
PiperOrigin-RevId: 618954029
8 months ago
Protobuf Team Bot
8a4ab72968
Auto-generate files after cl/618930720
8 months ago