Thomas Van Lenten
d58ed887ff
[ObjC] Wire the generation options through all the Field generators.
...
Nothing uses this yet, just gets things wired through.
PiperOrigin-RevId: 568230626
1 year ago
Adam Cozzette
cde00514e9
Expand lunit visibility to enable moving lua directory ( #14199 )
...
We will soon be moving the upb/lua directory up to the top level, so
this commit updates lunit's visibility to enable that.
1 year ago
Martijn Vels
617e1912b2
Optimize RepeatedPtrField to use copy constructors where possible
...
The most common MergeFrom() scenario is that items are newly appended to an existing repeated field that has never been shrunk. For these cases copy constructing new entries is the cheapest option. This change overloads MergeFrom<> for `std::string`, `StringPiece`, `Message` and `MessageLite`, leaving the remaining templated implementation for all concrete message types supporting arena enabled copy construction, which is implemented as an out of line factory functor implementation.
Going forward we should change `Arena::CreateMaybeMessage()` to return MessageLite* and accept const MessageLite& for copy construction. This will allow us to directly pass Arena::CreateMaybeMessage<T>() into these out of line functions.
PiperOrigin-RevId: 568220325
1 year ago
Thomas Van Lenten
cce7fc4f06
[ObjC] Wire generation options through Enum, Extension, Message, Oneof generators.
...
Swap out where the bool for stripping custom options was passed for
direct access to the generation options.
PiperOrigin-RevId: 568217321
1 year ago
Protobuf Team Bot
e57166b65a
Fix upb_MiniTable_Equals, add test.
...
PiperOrigin-RevId: 567806459
1 year ago
Protobuf Team Bot
cdc5f6484b
Auto-generate files after cl/567705458
1 year ago
Protobuf Team Bot
996268a345
Remove some function overrides from MapEntry and use the ones from Message.
...
This saves on binary size.
Plus, some other minor fixes to make the object more like normal codegen'd types.
PiperOrigin-RevId: 567705458
1 year ago
Sandy Zhang
c50e89217d
Require Python >=3.8 and add 3.11 to test matrix
...
Dropping 3.7 support was already announced in https://protobuf.dev/news/2023-07-06/ and meant to be dropped in
https://github.com/protocolbuffers/protobuf/pull/13219 but tests / setup.py were missed.
PiperOrigin-RevId: 567691335
1 year ago
Adam Cozzette
0f7a0b6c98
Update upb wheel tests to use ubuntu-latest
...
It appears that ubuntu-18 and ubuntu-20 don't exist anymore, and using
ubuntu-latest seems better for consistency anyway.
PiperOrigin-RevId: 567675738
1 year ago
Thomas Van Lenten
7824a4f0cd
[ObjC] Handle transtive public imports in minimal imports mode
...
If using minimal imports, a non direct import might be needed because
it is a public import of an other wise not required header; ensure
the import makes it into the generated code to type definitions can
be found.
PiperOrigin-RevId: 567672195
1 year ago
Protobuf Team Bot
2babd72727
Auto-generate files after PR #13838
1 year ago
Protobuf Team Bot
73b7f06faf
Verify closed enums rather than fallback to eager parsing.
...
PiperOrigin-RevId: 567666569
1 year ago
Adam Cozzette
87fcc79861
Internal change
...
PiperOrigin-RevId: 567664389
1 year ago
James Newton-King
e519c62f82
Improve .NET debugging of Protobuf messages ( #13838 )
...
Generated .NET protobuf messages override `ToString` and return JSON. By default, the .NET debugger displays the result from `ToString` and wraps it in curly braces, e.g. `{{ "Message": "Hello world" }}`. The double curly braces is an ugly result. People expecting JSON here are confused.
This PR adds a [DebuggerDisplayAttribute](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.debuggerdisplayattribute?view=net-7.0 ) to generated messages. The attribute tells the debugger to not quote the ToString value with `nq`.
Before:
![image](https://github.com/protocolbuffers/protobuf/assets/303201/b1cc5f45-4064-4ba0-b266-8894ca0f35c8 )
After:
![image](https://github.com/protocolbuffers/protobuf/assets/303201/70f6ffc0-9421-428d-bc22-ead7aa82c37f )
I haven't touched the protoc compiler in a long time. I'm guessing I need to build it and then run it to regenerate the checked-in code. I don't suppose someone else could do that? It would save me a lot of time 😬
Closes #13838
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/13838 from JamesNK:jamesnk/csharp-message-debuggerdisplay 5222b82cf9
PiperOrigin-RevId: 567659327
1 year ago
Protobuf Team Bot
a30d71d873
Auto-generate files after cl/567400017
1 year ago
Protobuf Team Bot
ddc654e0bd
Fix several ClangTidy warnings in the codegen.
...
PiperOrigin-RevId: 567400017
1 year ago
Protobuf Team Bot
bfbc95d41e
Faster swap.
...
Arena never changes, so no need to swap it.
Also explicitly instantiated memswap template to reduce code size.
```
name old INSTRUCTIONS/op new INSTRUCTIONS/op delta
BM_ProtoSwap<TestAllTypes> 356 ± 0% 300 ± 0% -15.73% (p=0.000 n=100+100)
BM_ProtoSwap<NestedTestAllTypes> 67.0 ± 0% 63.0 ± 0% -5.97% (p=0.000 n=100+100)
BM_ProtoSwap<ForeignMessage> 31.0 ± 0% 31.0 ± 0% ~ (all samples are equal)
BM_ProtoSwap<TestAllExtensions> 52.0 ± 0% 52.0 ± 0% ~ (all samples are equal)
```
PiperOrigin-RevId: 567379442
1 year ago
Adam Cozzette
9b46ed520e
Add CI runs for testing upb Python wheels
...
This restores the Python wheel CI runs from the old upb repo with only minor
changes. I had to update a path in one of the `py_wheel` rules and also make a
slight tweak to ensure that the `descriptor.upb_minitable.{h,c}` files make it
into the source wheels. The change in text_format_test.py is not strictly
necessary but is a small simplification I made while I was trying to debug an
issue with CRLF newlines.
I had to update test_util.py to use `importlib` to access the golden files from
the installed `protobuftests` package. I suspect the previous incarnation of
thse test runs was somehow reading the goldens from the repo checkout, but I
think the intention is to read them from `protobuftests` instead. This was a
bit tricky to get working because Python versions before 3.9 do not support
`importlib.resources.files()`. I set up the code to fall back on
`importlib.resources.open_binary()` in that case, but that function does not
support subdirectories, so this required putting an `__init__.py` file inside
the `testdata` directory to make sure it is treated as a Python package.
PiperOrigin-RevId: 567366695
1 year ago
Protobuf Team Bot
301dfc5aeb
Add missing debugging version info to Protobuf Java gencode when multiple files are generated.
...
PiperOrigin-RevId: 567358666
1 year ago
Protobuf Team Bot
450e065fa5
Auto-generate files after cl/567343651
1 year ago
Eric Salo
70eeedd3b2
upb: clean up the headers in upb/mini_table/
...
PiperOrigin-RevId: 567343651
1 year ago
Eric Salo
fc75bf3fdc
upb: fix most of the ClangTidy warnings in util/required_fields.?
...
PiperOrigin-RevId: 567333328
1 year ago
Hong Shin
a36deef052
clean up spacing near message.cc::new_thunk
...
PiperOrigin-RevId: 567329421
1 year ago
Hong Shin
ec0eabe801
Shorten our license headers into an abbreviated form that references LICENSE instead of including it in full.
...
PiperOrigin-RevId: 567327283
1 year ago
Protobuf Team Bot
e699aa601a
Automated rollback of commit baab809422
.
...
PiperOrigin-RevId: 567322048
1 year ago
Protobuf Team Bot
f7f42e3f0f
Auto-generate files after cl/567293489
1 year ago
Protobuf Team Bot
1de33336cd
InternalSwap does not need two arenas, since they are required to be the same
...
one.
PiperOrigin-RevId: 567293489
1 year ago
Protobuf Team Bot
e71ce645d2
Move some processing off to a secondary noinline function. This significantly
...
reduces the stack usage of the recursive function.
PiperOrigin-RevId: 567286733
1 year ago
Protobuf Team Bot
1180543de9
Internal Code Change
...
PiperOrigin-RevId: 567181574
1 year ago
Protobuf Team Bot
baab809422
Internal
...
PiperOrigin-RevId: 567175482
1 year ago
zhangskz
981aeb1ef8
Update to latest absl LTS patch 20230802.1 ( #14145 )
...
Closes #14145
PiperOrigin-RevId: 567165127
1 year ago
Protobuf Team Bot
ab53bda703
Removed unused variable.
...
PiperOrigin-RevId: 567157437
1 year ago
Adam Cozzette
9df1d76970
Prepare to reorganize upb file structure
...
I am getting ready to move almost everything under the upb/ directory up one
level to integrate upb better into its new location in the protobuf repo. This
change makes a few tweaks to prepare for that:
- Delete upb's LICENSE and CONTRIBUTING.md files since we already have similar
files at the top level.
- Rename `//python:python_version` so that it won't conflict later with
`//upb/python:python_version`.
- Move the contents of python/BUILD.bazel out to a Bazel macro to facilitate
merging that BUILD.bazel file with upb/python/BUILD.
PiperOrigin-RevId: 567119840
1 year ago
Protobuf Team Bot
33b78e67a9
Move Status error construction to helper NOINLINE functions to reduce stack
...
cost in the recursive functions.
Reduce the number of temporaries in the stack frame.
PiperOrigin-RevId: 567087381
1 year ago
Hong Shin
5fc9a3befd
Shorten our license headers into an abbreviated form that references LICENSE instead of including it in full.
...
PiperOrigin-RevId: 567074295
1 year ago
Protobuf Team Bot
5d042f1af5
Auto-generate files after cl/567023292
1 year ago
Hong Shin
aa41f50562
Shorten our license headers into an abbreviated form that references LICENSE instead of including it in full.
...
PiperOrigin-RevId: 567023292
1 year ago
Protobuf Team Bot
3892ab4fbb
Auto-generate files after cl/566724420
1 year ago
Jin Chao
9471a88225
`__NDK_MAJOR` should be `__NDK_MAJOR__` ( #14046 )
...
compilation error occurs when compiling on Android system.
Closes #14046
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/14046 from thejinchao:main 68d79d01b2
PiperOrigin-RevId: 566773496
1 year ago
Mike Kruskal
b577d8d1b9
Internal changes
...
PiperOrigin-RevId: 566724420
1 year ago
Protobuf Team Bot
ccdc27f8e0
Auto-generate files after cl/566724420
1 year ago
Mike Kruskal
104ab88079
Internal changes
...
PiperOrigin-RevId: 566724420
1 year ago
Protobuf Team Bot
0b53821a62
Auto-generate files after cl/566724420
1 year ago
Mike Kruskal
261900ed8f
Internal changes
...
PiperOrigin-RevId: 566724420
1 year ago
Protobuf Team Bot
bd483cbda6
Auto-generate files after cl/566724420
1 year ago
Mike Kruskal
42ce028575
Internal changes
...
PiperOrigin-RevId: 566724420
1 year ago
Protobuf Team Bot
557f7bce2f
Auto-generate files after cl/566724420
1 year ago
Mike Kruskal
4f46a3ffeb
Internal changes
...
PiperOrigin-RevId: 566724420
1 year ago
Protobuf Team Bot
e05f9e34e5
Auto-generate files after cl/566714350
1 year ago
Thomas Van Lenten
51cbe921bb
[ObjC] Move storage type info over to the new helper.
...
PiperOrigin-RevId: 566714350
1 year ago