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
For LITE messages we append the type name to the data, avoiding an
indirection and a relocation.
For descriptor messages we mark them as such and have a secondary vtable. This
way we avoid having to put those pointers on each message ClassData. We save in
data size and relocations. If in the future we determine that the extra jump is
costly we can inline the relevant descriptor method pointers into `ClassData`.
PiperOrigin-RevId: 565775188
We do not want to repeatedly check `using_sso` when iterating over an array. Hence instead of using `Get(i) / Mutable(i)` from base class, we request a pointer to the underlying array (thus, reducing number of checks from N to 1).
Additionally, there is a loop with a `Delete` call - updated it to use `CommonHandler`, so that it reduces code bloat.
PiperOrigin-RevId: 565665669
Cloud C++ has a CI test that runs against protobuf head and this broke with one
of my recent changes. This change fixes the problem by restoring the previous
visibility entry that was changed.
I'm a little bit surprised that this works, since `@upb` doesn't even exist in
our workspace anymore. It appears that Bazel is happy to ignore that in our
workspace where it doesn't exist, and still respect it in other workspaces
where it does exist.
PiperOrigin-RevId: 565093972
A couple weeks ago we moved upb into the protobuf Git repo, and this change
continues the merger of the two repos by making them into a single Bazel repo.
This was mostly a matter of deleting upb's WORKSPACE file and fixing up a bunch
of references to reflect the new structure.
Most of the changes are pretty mechanical, but one thing that needed more
invasive changes was the Python script for generating CMakeLists.txt,
make_cmakelists.py. The WORKSPACE file it relied on no longer exists with this
change, so I updated it to hardcode the information it needed from that file.
PiperOrigin-RevId: 564810016
$Msg$View is incorrect, we need to actually invoke the getter_thunks. We'll use void* to get us off to the races.
Sprinkled in TODOs as appropriate; and we'll tackle imports in another CL. For now, its important to return the actual raw message, and that's what this CL does for our base uses.
PiperOrigin-RevId: 564785201
This allows the compiler to statically detect use-after-free bugs.
This change touches a subset of field types. More changes to follow.
PiperOrigin-RevId: 564777204
virtual functions to reduce binary size and code duplication.
In this same change we replace `OnDemandRegisterArenaDtor` with an entry on the
table to keep the number of virtual functions in `MessageLite` the same to
avoid growth in space constrained systems. We will migrate other functions in
future changes.
PiperOrigin-RevId: 564706001
ThreadSafeArena::ThreadCache does not need to be aligned.
If anything, the alignment increases TLS and working set size.
Unalign it.
PiperOrigin-RevId: 564615625