Joshua Haberman
93fee65c55
Merge pull request #884 from acozzette/test-cmake-generation
...
Make trivial change to CMakeLists.txt to test auto-generation
2 years ago
Eric Salo
d9b6f13cde
remove upb_MtDataEncoder from the public surface
...
PiperOrigin-RevId: 485928803
2 years ago
Eric Salo
0bb466356d
create text/ subdir for all text-format code
...
Currently all we have is an encoder but eventually a decoder will also go here.
PiperOrigin-RevId: 485911424
2 years ago
Protobuf Team Bot
9b8785ebd3
Pin Upb to C++ 17
...
Update rules_fuzzing to v0.3.2
PiperOrigin-RevId: 485902979
2 years ago
Eric Salo
e137175092
create wire/ subdir for all wire-format code
...
PiperOrigin-RevId: 485898080
2 years ago
Eric Salo
f409c9985b
create mem/ subdir for all arena code
...
PiperOrigin-RevId: 485884460
2 years ago
Mike Kruskal
5ba0d84c88
Internal Change
...
PiperOrigin-RevId: 485726227
2 years ago
Adam Cozzette
496276471d
Make trivial change to CMakeLists.txt to test auto-generation
...
If the auto-generation is working correctly, then CMakeLists.txt should
be quickly auto-updated with a change that undoes this one.
2 years ago
Eric Salo
c033eff26f
split apart mini_table.c into a new subdir
...
PiperOrigin-RevId: 484352293
2 years ago
Joshua Haberman
6c4dc6f9e8
Merge pull request #873 from acozzette/update-cmake-files
...
Check in generated CMake files
2 years ago
Eric Salo
5c646803ef
implement mini descriptors for message sets
...
PiperOrigin-RevId: 484058392
2 years ago
Eric Salo
cb5be728d7
fix bug in mini descriptor map decoder
...
PiperOrigin-RevId: 483960513
2 years ago
Mike Kruskal
41017ef8dc
Fixes https://github.com/protocolbuffers/upb/issues/869
...
PiperOrigin-RevId: 483794621
2 years ago
Adam Cozzette
52be7c2960
Check in generated CMake files
...
Once the GitHub action is fixed, these will be auto-updated whenever
necessary. I realized it would be a good idea to add them back first,
though, just to make sure nothing breaks before we enable the
auto-updating.
2 years ago
Eric Salo
20310e2f3a
implement mini descriptors for maps
...
PiperOrigin-RevId: 483474044
2 years ago
Eric Salo
6f68ba1350
upb: fail if a message set contains any sub-fields
...
This was causing fuzzer test failures.
Unrelated: inlined a few calls to upb_MessageDef_FullName() for performance
PiperOrigin-RevId: 483389910
2 years ago
Eric Salo
067c7aa3f1
check for malformed map entries
...
PiperOrigin-RevId: 481258673
2 years ago
Eric Salo
a4f240c18b
backport a fuzzer test patch from an earlier github branch
...
PiperOrigin-RevId: 481251218
2 years ago
Mike Kruskal
9e2d7f02da
Support local builds of upb's python wheel build.
...
PiperOrigin-RevId: 481207184
2 years ago
Eric Salo
36ce2fa7d1
add version/tag chars to the start of all mini descriptors
...
Verified during decoding. The specific values are just placeholders for now.
PiperOrigin-RevId: 481009599
2 years ago
Eric Salo
df34b04658
make upb_ExtensionRegistry_AddArray() and upb_ExtensionRegistry_Lookup() public
...
Previously these were internal _upb functions but it turns out that they are also useful outside of upb.
PiperOrigin-RevId: 480997511
2 years ago
Mike Kruskal
fc73215f86
Internal change
...
PiperOrigin-RevId: 480942674
2 years ago
Mike Kruskal
72f7799d12
Internal change
...
PiperOrigin-RevId: 480925629
2 years ago
Eric Salo
40998462d6
add upb_MtDataEncoder_EncodeExtension()
...
We need to sharpen the distinction between messages and extensions in the mini
descriptor encoder, so split the code paths for each.
PiperOrigin-RevId: 480675339
2 years ago
Mike Kruskal
4e67cea19c
Internal changes
...
PiperOrigin-RevId: 480471896
2 years ago
Mike Kruskal
d861ff5411
Reserve C++20 keywords
...
PiperOrigin-RevId: 480445608
2 years ago
Protobuf Team Bot
be98a91367
Add aspect hints for kotlin native compilation.
...
PiperOrigin-RevId: 480421756
2 years ago
Copybara-Service
1f8f8abaf5
Merge pull request #853 from acozzette:cmake
...
PiperOrigin-RevId: 480375167
2 years ago
Adam Cozzette
4a9a7cacac
Add GitHub workflow for updating checked-in generated files
2 years ago
Eric Salo
85bf4677b2
lock down internal reflection
...
- upb_DefPool_FindExtensionByMiniTable() has been promoted to a public function.
- There are now zero uses of the internal reflection headers outside of upb core (but still a few left in generated code).
PiperOrigin-RevId: 480211522
2 years ago
Eric Salo
41335a03be
normalize upb_Message_New()
...
We had _upb_Message_New(), which created a message from a mini table and was
being used outside of upb even though it is an internal-only function.
We also had upb_Message_New(), which created a message from a message def.
Now there is a single public function, upb_Message_New(), which creates a
message from a mini table and covers all use cases. (The internal version has the same definition and is used for inlining.)
PiperOrigin-RevId: 480169804
2 years ago
Eric Salo
1a3803ce8b
dead code elimination
...
PiperOrigin-RevId: 479966581
2 years ago
Protobuf Team Bot
50d36a62b0
Add asserts for unlinked mini tables.
...
In particular upb doesn't handle unlinked groups yet which requires checks to make sure callers did link group subs.
PiperOrigin-RevId: 479702475
2 years ago
Eric Salo
85f7d2d065
set kUpb_EncodedValue_MaxField to its correct value
...
PiperOrigin-RevId: 479655389
2 years ago
Protobuf Team Bot
c172bfb4bc
Import numpy_test in upb wrapper from protobuf
...
PiperOrigin-RevId: 479637272
2 years ago
Protobuf Team Bot
04363f7bae
Update workspace_deps.bzl protobuf main commit
...
PiperOrigin-RevId: 479635174
2 years ago
Protobuf Team Bot
3faf958b3d
Initialize mini table subs, so that upb_MiniTable_Build creates stable unlinked table.
...
PiperOrigin-RevId: 479630135
2 years ago
Eric Salo
65946dc0e7
kUpb_EncodedType_Enum -> kUpb_EncodedType_OpenEnum
...
Now that we have a kUpb_EncodedType_ClosedEnum, rename for clarity.
PiperOrigin-RevId: 479621719
2 years ago
Protobuf Team Bot
41686adf0f
Initialize mini table subs, so that upb_MiniTable_Build creates stable unlinked table.
...
PiperOrigin-RevId: 479466261
2 years ago
Protobuf Team Bot
bc2022ae86
Initialize mini table subs, so that upb_MiniTable_Build creates stable unlinked table.
...
PiperOrigin-RevId: 479445405
2 years ago
Joshua Haberman
b33fd88ed3
Added function for getting the type of a MiniTable field
...
Prior to this CL, users were relying on `field->descriptortype` to get the field type. This almost works, as `field->descriptortype` is almost, but not quite, the field type of the field. In two special cases we deviate from the true field type, for ease of parsing and serialization:
- For open enums, we use `kUpb_FieldType_Int32` instead of `kUpb_FieldType_Enum`, because from the perspective of the wire format, an open enum field is equivalent to int32.
- For proto2 strings, we use `kUpb_FieldType_Bytes` instead of `kUpb_FieldType_String`, because proto2 strings do not perform UTF-8 validation, which makes them equivalent to bytes.
In this CL we add a public API function:
```
// Returns the true field type for this field.
upb_FieldType upb_MiniTableField_Type(const upb_MiniTable_Field* f);
```
This will provide the actual field type for this field.
Note that this CL changes the MiniDescriptor format. Previously MiniDescriptors did not contain enough information to distinguish between Enum/Int32. To remedy this we added a new encoded field type, `kUpb_EncodedType_ClosedEnum`.
PiperOrigin-RevId: 479387672
2 years ago
Joshua Haberman
30a28f3d3a
Removed kUpb_FieldRep_Pointer as a distinct FieldRep, saving a bit in the MiniTable
...
We can resolve the difference between these two reps at MiniTable build time.
PiperOrigin-RevId: 479320737
2 years ago
Protobuf Team Bot
aabb2b62ae
Add upb_Message_DeleteUnknown API.
...
Add test proto.
PiperOrigin-RevId: 479178356
2 years ago
Protobuf Team Bot
b49f992a04
Remove redefinition of upb_MiniTable_Extension, upb_MiniTable.
...
PiperOrigin-RevId: 479177259
2 years ago
Joshua Haberman
185d4f09d9
Simplified extension table building slightly by avoiding direct mutation
...
PiperOrigin-RevId: 478953396
2 years ago
Eric Salo
44916d7d27
create reflection_internal library
...
internal declarations are now physically removed from the public headers
PiperOrigin-RevId: 478921131
2 years ago
Eric Salo
52c1598554
add upb_EnumDef_IsClosed()
...
PiperOrigin-RevId: 478895160
2 years ago
Joshua Haberman
5d0833f48c
Removed obsolete exemption for closed enums
...
The referenced bug was fixed long ago: https://github.com/protocolbuffers/upb/issues/541
PiperOrigin-RevId: 478870590
2 years ago
Joshua Haberman
32c6e9baab
A few more fixes for PHP and the 32-bit build
...
PiperOrigin-RevId: 478530302
2 years ago
Eric Salo
0f585c69af
stop requiring extension fields to have a synthetic oneof
...
https://github.com/protocolbuffers/upb/issues/812
PiperOrigin-RevId: 478527073
2 years ago