We need the minitable plugin to use the C++ plugin framework because it's soon
going to live in the same binary as the Rust code generator. The other plugins
we might as well move just for consistency, and this allows us to delete the
`upb::Plugin` class as well.
PiperOrigin-RevId: 716234662
Remove the naming warnings that would be considered noisy if they were suddenly enabled with no easy way to disable the warnings. The upcoming Edition 2024 naming style enforcement feature and a planned corresponding change to the linter which respects NOLINT comments will cover the cases that these warnings would.
The parser appears to have been accidentally silently suppressed on the CLI path all along; while they were reachable on other usages of the parser, those cases are secondary compared to what we consider the main entry point and so no longer having the naming warnings on those should not locally be a major loss.
PiperOrigin-RevId: 716223703
rules_python recommends not using "pip_deps" as a hub name unless the module is guaranteed to always be the root module, as the name must be unique between modules.
PiperOrigin-RevId: 715435028
implemented on top of `UntypedMapBase` visitation.
Reduces code duplication in large binaries.
More to come in future changes.
PiperOrigin-RevId: 715380851
The symbol has been removed from Bazel 8, so any reference to it results in an error.
Using bazel_features, a bzl file with a reference is generated, based on Bazel version.
Protobuf 29.x doesn't have this problem because cc_proto_aspect wasn't exposed. But we should still cherry-pick exposing the aspect and this change to 29.x line, to make transition of rules_rust easier.
Closes: https://github.com/protocolbuffers/protobuf/pull/19576
PiperOrigin-RevId: 715064854
This includes (but not limited to) `MessageLite::GetTypeName`, `UnknownField::length_delimited`, and
all the name functions in descriptors like `FieldDescriptor::full_name`.
Part of the changes announced in
https://protobuf.dev/news/2024-10-02/#descriptor-apis
PiperOrigin-RevId: 715013326
Given:
oneof hello_world {}
We now generate:
fn hello_world(&self) -> HelloWorldOneof
fn hello_world_case(&self) -> HelloWorldCase
This change is to help mitigate a realistic risk of collisions in cases like:
message M {
oneof x { ... }
enum X { ... }
}
PiperOrigin-RevId: 714998247
`pbi` where appropriate.
The `proto_ns` variable not fully qualified and risks forgetting the prefix
`::` which could potentially break codegen if user namespace has a matching
subnamespace.
PiperOrigin-RevId: 714982016
Since adding a new feature for a new Edition involves having a value set for Proto2/Proto3 which does not change the semantics of those files, the current test becomes a change detector test against new features being added.
PiperOrigin-RevId: 714851850
This should silence the DEBUG warning
```
DEBUG: Rule 'com_google_protobuf_v25.0' indicated that a canonical reproducible form can be obtained by modifying arguments integrity = "sha256-e+7ZxRHWMs/3wirACU3Xcg5VAVMDnV2n4Fm8zrSIR0o="
```
PiperOrigin-RevId: 714142857
1. The initial `upb_MemBlock` and the `upb_Arena` share the same cache line, and they're both set on init at the same time
2. When using a demand-paged OS, the `upb_Arena`'s init will not eagerly fault the final page in the allocation. This is not a real concern for tiny malloc-ed blocks, but if an initial block is provided, this could save an entire page of overhead for a user who provided a large virtual region as the initial block, intending that only memory used by bumping the pointer would actually get paged in. This also helps avoid TLB misses for such a case.
PiperOrigin-RevId: 714091676
The java generator currently uses the enum-typed getters in mergeFrom for explicit presence fields, even for open enums. This results in buggy behavior where unknown enum values can trigger runtime exceptions during merges. It is reproducible in proto3 by using the `optional` keyword, but is more noticeable in edition 2023 due to the feature defaults.
PiperOrigin-RevId: 713780284
This reduces binary size and improves performance.
Most validation functions are cheaper than the cost of the function call
itself.
PiperOrigin-RevId: 713758496
Right now we generally hit warnings only in cases where someone used non-style-conformant names in their .proto, but warnings on rs codegen aren't the greatest way to surface those and it results in a lot of spam on our tests that intentionally violate the style guide.
PiperOrigin-RevId: 713742680
Nullable annotations were added in the previous change.
We will add annotations to the runtime separately.
Once the absl macros from cd9dd4266c becomes stable, we can switch to those
Not yet active in open source (more of a comment).
PiperOrigin-RevId: 713678926
Previously running `gem install google-protobuf --platform ruby` used the default C compiler specified by `mkmf`, which uses `RbConfig::MAKEFILE_CONFIG["CC"]` and `RbConfig::MAKEFILE_CONFIG["CXX"]`.
This commit supports using `CC`, `CXX`, and `LD` from the environment:
```shell
export CC=my-custom-gcc
export CXX=my-custom-g++
gem install google-protobuf --platform ruby
```
Most native gems, such as grpc and nokogiri, allow for this.
Closes#19863
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/19863 from stanhu:sh-support-custom-gcc 33693f84af
PiperOrigin-RevId: 713675592
Protobuf 6.30.0 will change the return types of Descriptor::name() and other
methods to absl::string_view. This makes the code work both before and after
such a change.
PiperOrigin-RevId: 713643887
The API of upb_alloc_func implies this would already be the case, and this is useful for calling `free_sized` in the future, which can be faster for some allocators as it allows skipping a bucket lookup.
PiperOrigin-RevId: 713536794