`upb_Array_Append` and `upb_Array_Insert` will resize the array and then immediately overwrite the new values. These methods currently use `upb_Array_Resize` to do the array resizing, however this does extra unnecessary work by initializing those new values. This changes these insertion methods to use `_upb_Array_ResizeUninitialized` instead, which will perform the resize without the extra unnecessary initialization.
PiperOrigin-RevId: 581980280
This also fixes a few minor bugs in the editions implementation that were caught in python/conformance tests, and adds a new SetFeatureSetDefaults API to the def pool for consistency with C++ and other python implementations.
PiperOrigin-RevId: 581384108
This makes third_party/utf8_range no longer a Git subtree, but instead the
permanent location and source of truth for utf8_range. It is also now
incorporated into the @com_google_protobuf Bazel repo. Utf8_range still has its
own separate CMake build for now, though.
PiperOrigin-RevId: 580682733
This is a breaking change since the JSON parser will now correctly reject certain bad inputs that it previously silently accepted (for example: json="{}x" was accepted).
PiperOrigin-RevId: 580493003
This required enabling the feature in the code generator and fixing a few edge cases around label and type.
Also added tests to verify the special cases, and to verify that required fields work as expected.
PiperOrigin-RevId: 580263087
Unlike the wire fuzz test this only fuzzes json against a fixed message; in a subsequent improvement it can additionally fuzz over the message def itself.
PiperOrigin-RevId: 580158012
gRPC auto-generates CMake and other build configs from the Bazel build graph,
but the logic for doing this does not know how to handle filegroups. This
change works around that problem by making the `:port` target refer directly to
the `.inc` files instead of going through a filegroup. This solution is not
ideal but I think it's probably the best way to unblock progress for now.
PiperOrigin-RevId: 578333954
gRPC auto-generates CMake and other build configs from the Bazel build graph,
but the logic for doing this does not know how to handle filegroups. This
change works around that problem by making the `:port` target refer directly to
the `.inc` files instead of going through a filegroup. This solution is not
ideal but I think it's probably the best way to unblock progress for now.
PiperOrigin-RevId: 578333954
This simplifies the logic when the type of a field is only known at a later time (when the field is resolved).
This brings upb in line with the C++ behavior.
PiperOrigin-RevId: 573338934
These exist so that new features can specify their proto2/proto3 defaults. This will allow for easier migration to editions, and also allow us to migrate more proto2/proto3 code paths to common editions code. The latter will provide give us early coverage over a lot more of editions.
PiperOrigin-RevId: 570576252
This makes the file layout a bit more consistent with the `protos ->
protos_generator` pattern. I also replaced the `upbc` namespace with
`upb::generator`.
PiperOrigin-RevId: 569264372
I also deleted some of upb's dotfiles that are either obsolete (like
`.bazelci/presubmit.yml`) or seem to be superseded by protobuf's dotfiles.
PiperOrigin-RevId: 568873088
This change moves almost everything in the `upb/` directory up one level, so
that for example `upb/upb/generated_code_support.h` becomes just
`upb/generated_code_support.h`. The only exceptions I made to this were that I
left `upb/cmake` and `upb/BUILD` where they are, mostly because that avoids
conflict with other files and the current locations seem reasonable for now.
The `python/` directory is a little bit of a challenge because we had to merge
the existing directory there with `upb/python/`. I made `upb/python/BUILD` into
the BUILD file for the merged directory, and it effectively loads the contents
of the other BUILD file via `python/build_targets.bzl`, but I plan to clean
this up soon.
PiperOrigin-RevId: 568651768