Commit Graph

30 Commits (main)

Author SHA1 Message Date
Protobuf Team Bot 396d661767 Add support for setting extensions with Ptr<Extension> in Upb C++ protos.
PiperOrigin-RevId: 633646216
2024-05-14 11:14:58 -07:00
Eric Salo 9118be944d upb: extension/basefield setters are now public functions
PiperOrigin-RevId: 623355801
2024-04-09 20:18:28 -07:00
Protobuf Team Bot d7f032ad15 Move private definitions out of //bazel
This is needed to make protobuf/bazel package minimal for other proto rules.

Keep 4 public bzl files in upb/bazel. They end up under protobuf/bazel, and they are legitimately used by other repositories.

Move upb_proto_library_internal/* under bazel/private. Those are utilities used in the rules. Moving them one level deeper makes protobuf/bazel package clean for other rules.

Move build_defs.bzl and amalgamation under /upb/bazel. Those are utilities used in the build.

Move lua.BUILD and python* uner /python/dist. Those are used in the WORKSPACE dependency setup.

PiperOrigin-RevId: 621442236
2024-04-03 01:37:51 -07:00
Protobuf Team Bot 83ec410d30 Internal change
PiperOrigin-RevId: 619377672
2024-03-27 05:50:55 -07:00
Tiago Quelhas 774627235e Automated Code Change
PiperOrigin-RevId: 617586334
2024-03-20 12:09:39 -07:00
Protobuf Team Bot d9727cd657 Internal change
PiperOrigin-RevId: 617220518
2024-03-19 10:39:48 -07:00
Protobuf Team Bot 2dd2dfaca3 Rename use_cpp_toolchain in protos/bazel/cc_proto_library.bzl, for consistency.
This now matches the upb_use_cpp_toolchain function name in the equivalent function in third_party/upb/bazel/upb_proto_library_internal/cc_library_func.bzl.

PiperOrigin-RevId: 606257428
2024-02-12 08:21:11 -08:00
Eric Salo f9994e1c8d upb: remove the last remaining direct upb-internal deps from upb/protos/
PiperOrigin-RevId: 600933411
2024-01-23 16:07:27 -08:00
Eric Salo f9af78e7ee upb: upb_MiniTable_GetOrPromoteExtension() no longer returns a (upb_Extension*)
PiperOrigin-RevId: 600662130
2024-01-22 21:20:52 -08:00
Eric Salo 07f784a2f3 upb: tag _upb_Message_GetOrCreateExtension() as UPB_PRIVATE()
PiperOrigin-RevId: 600653849
2024-01-22 20:31:05 -08:00
Eric Salo 373ffa6622 upb: tag _upb_Message_Getext() as UPB_PRIVATE()
PiperOrigin-RevId: 600639423
2024-01-22 19:27:49 -08:00
Joshua Haberman 03ff7af37e Refactored a few protos:: methods to no longer access `upb_Extension` directly.
PiperOrigin-RevId: 600588767
2024-01-22 15:34:38 -08:00
Marcel Hlopko 36d344b63f Automated rollback of commit 0ce457f6e7.
PiperOrigin-RevId: 597327159
2024-01-10 12:42:23 -08:00
Protobuf Team Bot 0ce457f6e7 Adds mutable extension accessors to the codegen for upb C and adds a `::protos::MutableExtension` method to upb C++ for getting a mutable extension.
PiperOrigin-RevId: 597088960
2024-01-09 17:23:42 -08:00
Eric Salo c02f943f1a upb: distinguish between fields and extensions in the public clear() accessors
PiperOrigin-RevId: 596588385
2024-01-08 07:36:16 -08:00
Protobuf Team Bot 670e0c2a0d Fix begin iterator for empty arrays.
If the underlying array for a repeated field is a nullptr (which is possible for const array access on a message field that hasn't been set) the begin iterator will currently contain garbage data, which can lead to an illegal access. This CL adds a nullptr check to `begin()`, similar to what already exists for `size()`.

PiperOrigin-RevId: 595217999
2024-01-02 15:03:10 -08:00
Eric Salo 9debd6b10a upb: merge upb:message_accessors into upb:message
PiperOrigin-RevId: 595137531
2024-01-02 09:32:23 -08:00
Eric Salo f0cf0b653c upb: clean up and consolidate the upb/message/ build targets
PiperOrigin-RevId: 594514934
2023-12-29 17:31:55 -08:00
Adam Cozzette 4ec9170bcd Fix layering check for usage of gtest
To satisfy the layering check, we need to depend on :gtest for the headers, in
addition to :gtest_main which provides the main() function.

There are a bunch of formatting changes as a side effect of this, but they
should be harmless.

PiperOrigin-RevId: 594318263
2023-12-28 14:41:48 -08:00
Eric Salo 090c3adbf2 upb: start consolidating the upb/message/ build targets
PiperOrigin-RevId: 594074354
2023-12-27 11:58:03 -08:00
Eric Salo 2fb0b93d9d upb: tighten up and lock down upb/wire/
PiperOrigin-RevId: 593821827
2023-12-26 10:58:17 -08:00
Eric Salo b997cb6d8d upb: add a non-void typedef for upb_Message
PiperOrigin-RevId: 592863926
2023-12-21 08:12:16 -08:00
John Cater 8033709662 Remove uses of `incompatible_use_toolchain_transition`.
Now that Bazel 7.0 has been released, it's time to remove this tech debt.

This has been a no-op since Bazel 5.0, I've been waiting to remove the code for
two years, it's time.

Part of https://github.com/bazelbuild/bazel/issues/14127.

PiperOrigin-RevId: 592219242
2023-12-19 06:37:23 -08:00
Eric Salo 5b7bafc60e upb: upb_Message_Extension -> upb_Extension
PiperOrigin-RevId: 592075816
2023-12-18 19:23:31 -08:00
Eric Salo a8c3eb7fa5 upb: upb_MiniTable_FindUnknown() -> upb_Message_FindUnknown()
PiperOrigin-RevId: 588120426
2023-12-05 10:41:34 -08:00
Eric Salo 21133d554f upb: lock down upb_MiniTableExtension
PiperOrigin-RevId: 585817227
2023-11-27 18:46:40 -08:00
Eric Salo 7c5e18b838 upb: remove port_def references from upb/protos/
PiperOrigin-RevId: 585705761
2023-11-27 11:15:55 -08:00
Protobuf Team Bot 0fab773c1d Update remainder of upb to new short license style.
PiperOrigin-RevId: 584116886
2023-11-20 13:43:32 -08:00
Eric Salo 07fba1da07 upb: merge ":collections" into ":message"
PiperOrigin-RevId: 569594353
2023-09-29 14:53:28 -07:00
Adam Cozzette 501ececd39 Reorganize upb file structure
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
2023-09-26 14:38:35 -07:00