Commit graph

23 commits

Author SHA1 Message Date
Tobias Werth
412b61745a Automated Code Change
PiperOrigin-RevId: 941551630
2026-07-02 01:48:16 -07:00
Protobuf Team Bot
5ea7e147ea Internal change
PiperOrigin-RevId: 888231953
2026-03-23 12:46:13 -07:00
Protobuf Team Bot
1c2af13202 Add missing upb_XXXDef_FindXXXByNameWithSize functions and index methods by name
PiperOrigin-RevId: 878471014
2026-03-04 07:06:24 -08:00
Joshua Haberman
3a3560bb87 Removed the third_party/upb/upb/bazel directory.
We are absorbing its contents into other directories. This will reduce the 3:1 merge to `upb/bazel` in GitHub to 2:1 (soon to be 1:1).

PiperOrigin-RevId: 860299666
2026-01-23 16:35:18 -08:00
Joshua Haberman
4c5c4b2cd0 Added more validations of syntax and edition when parsing descriptors.
Also removed `syntax` from upb's data structures and API surfaces.

PiperOrigin-RevId: 850499478
2025-12-30 13:39:25 -08:00
Chris Kennelly
d326c1d6da Prepare to make many APIs [[nodiscard]].
PiperOrigin-RevId: 844770264
2025-12-15 07:53:39 -08:00
Protobuf Team Bot
c50fb166d9 Automated rollback of commit d170d28b0d.
PiperOrigin-RevId: 842620254
2025-12-10 02:09:10 -08:00
Chris Kennelly
d170d28b0d Add [[nodiscard]] to many APIs.
This covers two types of failures:
* Methods that are logically const and failure to consume the result indicates a bug
  (an unnecessary call, etc.)
* Methods that return significant errors (failure to parse, etc.) that should not be
  unintentionally ignored.

PiperOrigin-RevId: 842042770
2025-12-08 21:06:53 -08:00
Keith Smiley
68220a862a bazel: add missing rules_cc loads (#23584)
This is required for use with bazel after this commit 71ca0ed111

Many files have these already

Closes #23584

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/23584 from keith:ks/bazel-add-missing-rules_cc-loads 733a0ccf6f
PiperOrigin-RevId: 817836399
2025-10-10 17:00:33 -07:00
Joshua Haberman
3095014890 Removed unused aliases
PiperOrigin-RevId: 773742919
2025-06-20 09:59:24 -07:00
Adam Cozzette
a91af50ee2 Remove Lua dependency from WORKSPACE.bzlmod and get it from BCR instead
A side effect of this was that we upgraded our Lua version from 5.2.4 up to
5.4.6. Version 5.3
[introduced](https://www.lua.org/manual/5.3/readme.html#changes)
support for integers as their own type, which broke some of our unit tests. We
have a shim of `lua_isinteger()` that always returns false for Lua versions
prior to 5.3, but starting from 5.3 we have the real version of that function
starting to return true for integers. In this scenario we were not validating
that the integer was in the expected range, so I had to fix this to keep the
tests green.

PiperOrigin-RevId: 741575531
2025-03-28 10:49:18 -07:00
Adam Cozzette
038aaa98fa Remove our vendored copy of lunit
The [upstream](https://github.com/mrothNET/lunit) project is apparently
unmaintained and unavailable in BCR. Since our Lua protobuf implementation is
experimental and not being very actively developed, I think we might as well
drop our lunit dependency and use simple `assert` statements instead.

While I was at it I noticed we had some cases of multiple test functions with
the same name, causing the later definitions to shadow earlier ones. We had two
functions called `test_utf8()` that tested roughly the same thing, so I deleted
one of them. We also had two functions named `test_string_double_map()`, but
one of them was actually testing packed repeated fields, so I just renamed it.

PiperOrigin-RevId: 741324780
2025-03-27 16:47:58 -07:00
Protobuf Team Bot
28de0ebcdd Run buildifier
Adds missing loads for Java rules.
Remove unused loads.
Some other minor fixes.

PiperOrigin-RevId: 728701378
2025-02-19 09:27:02 -08:00
Sandy Zhang
ba6b54d6bc Upgrade abseil-cpp to 20250127 and use @com_google_absl -> @abseil-cpp and com_google_googletest -> @googletest canonical BCR names.
Users still using the old `WORKSPACE` system may need to do the same or use `repo_mapping` on repositories that still use the old names. See Abseil's release notes for details: https://github.com/abseil/abseil-cpp/releases/tag/20250127.

#test-continuous

PiperOrigin-RevId: 725247849
2025-02-10 09:43:53 -08:00
WenTao Ou
a673d33949 Fix compiling problems with lua 5.4 (#15113)
Fixes #15112
Fixes #13750

Closes #15113

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/15113 from owent:fixes_15112 dd3a847a06
PiperOrigin-RevId: 684928784
2024-10-11 13:00:08 -07:00
Joshua Haberman
8422e9795f Migrated upb to use Copybara-standard stripping.
This CL is mostly a no-op, except that now google3-only code is actually stripped from OSS, instead of being preserved in `# begin:google_only` blocks.

This follows the conventions of the greater Copybara ecosystem.

PiperOrigin-RevId: 669513564
2024-08-30 18:34:23 -07:00
Protobuf Team Bot
e2c4d0f27e Automated Code Change
PiperOrigin-RevId: 650549584
2024-07-09 02:38:01 -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
Tiago Quelhas
774627235e Automated Code Change
PiperOrigin-RevId: 617586334
2024-03-20 12:09:39 -07:00
Adam Cozzette
a7b0421c78 Breaking change: make protobuf comply with the C++ layering check
This check enforces that each C++ build target has the correct dependencies for
all headers that it includes. We have many targets that were not correct with
respect to this check, so I fixed them up.

I also cleaned up the C++ targets related to the well-known types. I created a
cc_proto_library() target for each one and removed the :wkt_cc_protos target,
since this was necessary to satisfy the layering check. I deleted the
//src/google/protobuf:protobuf_nowkt target and deprecated :protobuf_nowkt,
because the distinction between the :protobuf and :protobuf_nowkt targets was
not really correct. Neither one exposed the headers for the well-known types in
a way that was valid with respect to the layering check, and the idea of
bundling all the well-known types together is not idiomatic in Bazel anyway.
This is a breaking change, because the //:protobuf target no longer bundles the
well-known types. From now on they should be accessed through the new
//:*_cc_proto aliases in our top-level package.

I renamed the :port_def target to :port, which simplifies things a bit by
matching our internal name.

The original motivation for this change was that to move utf8_range onto our CI
infrastructure, we needed to make its dependency rules_fuzzing compatible with
Bazel 6. The rules_fuzzing project builds with the layering check, and I found
that the process of upgrading it to Bazel 6 made it take a dependency on
protobuf, which caused it to break due to layering violations. I was able to
work around this, but it would still be nice to comply with the layering check
so that we don't have to worry about this kind of thing in the future.

PiperOrigin-RevId: 595516736
2024-01-03 15:20:05 -08:00
Hong Shin
26dcf400fa Use shortened license in upb::lua
PiperOrigin-RevId: 582854248
2023-11-15 17:17:03 -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