Our automation clobbered a few more files, so let's move them
temporarily so that we can put them back in place in a way that "git
blame" continues to work.
This is the second attempt to fix our Git history. This should allow
"git blame" to work correctly in the upb/ directory even though our
automation unexpectedly blew away that directory.
upb is going to have its own Bazel repository for now, so this change will
ensure that things like `bazel query //...` won't try to descend into upb and
get confused. I would think that Bazel should see the `WORKSPACE` file and
know not to descend into the upb/ directory, but that does not seem to be
happening (possibly a Bazel bug).
PiperOrigin-RevId: 560072475
We still retain RawMessage and RawArena, but drop the macro for readability.
In lieu of invoking define_opaque_nonnulls, we spell out RawMessage and RawArena by hand.
PiperOrigin-RevId: 559906043
On the read side avoid writing to memory via volatile. The volatile access will generate its own tsan checks because it is touching memory.
On the write side also avoid the volatile access by unconditionally writing to the memory. The address used for the tsan validation is dedicated for it so it doesn't matter if we write arbitrary values to it.
PiperOrigin-RevId: 559841351
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: 559832961
- `generate_minimal_imports` is now `yes`, this reduces the imports generated
into the generated source.
- `headers_use_forward_declarations` is now `no`; this causes the generated
.pbobj.h files to directly import all the headers needed to define types used by
this types defined in the file. This provides better compatibility for Swift
interop especially when the ObjC protos are used in multiple libraries as
forward declarations can cause issues for importing into Swift.
If you need to override either options, please open an issue on github to report
the reason. A future release of the library will remove these options locking in
the new behaviors.
PiperOrigin-RevId: 559737716
This places all of the tricky reflection logic of feature resolution into a single location that outputs a portable protobuf message. With this message, feature resolution becomes drastically simpler and easy to reimplement in other languages.
Follow-up changes will provide:
- An API to specify generator features from the CodeGenerator class for C++ plugins
- A CLI for building these default mappings
- Bazel/CMake rules to help embed these mappings in target languages (i.e. for runtimes and non-C++ plugins)
PiperOrigin-RevId: 559615720
This test validates that upb Python targets can be built successfully even if
Python is not installed locally.
I also updated our pinned upb version to pull in some recent fixes needed for
this test run.
PiperOrigin-RevId: 559504790
Disable the alignment check in 32-bit msvc.
This toolchain has a difference between "natural" and "required" alignment of
types and it can have the alignment of members of type `T` to be smaller than
`alignof(T)`.
Also, disable AnyTest.TestPackFromSerializationExceedsSizeLimit there because it can't allocate that much memory.
PiperOrigin-RevId: 559495544
This makes a few changes:
- It changes generated messages to reference message innards as a type in `__runtime` instead of branching on what fields should be there. That results in much less bifurcation in gencode and lets runtime-agnostic code reference raw message innards.
- It adds a generic mechanism for creating vtable-based mutators. These vtables point to thunks generated for interacting with C++ or upb fields. Right now, the design results in 2-word (msg+vtable) mutators for C++ and 3-word mutators (msg+arena+vtable) for UPB. See upb.rs for an explanation of the design options. I chose the `RawMessage+&Arena` design for mutator data as opposed to a `&MessageInner` design because it did not result in extra-indirection layout changes for message mutators. We could revisit this in the future with performance data, since this results in all field mutators being 3 words large instead of the register-friendly 2 words.
- And lastly, as a nearby change that touches on many of the same topics, it adds some extra SAFETY comments for Send/Sync in message gencode.
PiperOrigin-RevId: 559483437
This fixes Python/C++ and upb, and pushes the buggy behavior to pure python. There, it's very difficult to handle options on the bootstrapped proto with the current architecture. Future changes will attempt to address this more isolated issue.
PiperOrigin-RevId: 559450900
This will allow us to run all the upb tests from the protobuf repo, which
already uses this flag. I just had to remove a couple glob patterns that did
not match any files.
PiperOrigin-RevId: 559434154