Re: [protobuf] Is Resulting Binary from Changing Proto Definition Source (From Nested to Non-Nested) for Fields initialization Backward-Compatible?

2023-04-19 Thread Marc Gravell
As long as you aren't using `Any`: then at the binary payload data it won't be visible. Any existing code that uses the generated types will need to be updated, obviously. On Thu, 20 Apr 2023, 07:00 'Felik' via Protocol Buffers, < protobuf@googlegroups.com> wrote: > Hello, > > I came to understan

[protobuf] Is Resulting Binary from Changing Proto Definition Source (From Nested to Non-Nested) for Fields initialization Backward-Compatible?

2023-04-19 Thread 'Felik' via Protocol Buffers
Hello, I came to understand that the binary serialization only concern of field identifiying number (hence renaming field and message is backward compatible). I would like to confirm my understanding if following case is also backward compatible (I could not find any resource that discuss abou

[protobuf] Re: Generating code via protoc plugin without resolving indirect imports

2023-04-19 Thread 'habe...@google.com' via Protocol Buffers
It is strongly recommended that proto rules use aspects going forward, because it avoids the need to specify the dependency graph N times (one per language). proto_library() can specify the dependency graph once, and then any number of languages can have lang_proto_library() rules that reuse the

Re: [protobuf] Re: Generating code via protoc plugin without resolving indirect imports

2023-04-19 Thread Brandon Duffany
Thanks Adam, do you have a sense of whether it should be possible fundamentally? i.e. is there any data in a FileDescriptor that can't be populated unless you have both direct and indirect deps available? If not, I might take a poke at adding a protoc flag to set that option, and see if I can c

[protobuf] Re: Generating code via protoc plugin without resolving indirect imports

2023-04-19 Thread Brandon Duffany
Thanks Josh! I will have a look at proto_common and see what I can glean from it. More generally, is there any guidance around how/whether proto codegen rules should use aspects? My current rule implementation does not use aspects at all if I'm understanding correctly - I'm just forming `--pro

Re: [protobuf] Re: Generating code via protoc plugin without resolving indirect imports

2023-04-19 Thread 'Adam Cozzette' via Protocol Buffers
Getting protoc to work with only direct dependencies is an interesting idea because it has the potential to meaningfully speed up builds, but as Josh said, protoc is not currently set up to be able to do that. I think the way to do this would be to start by calling AllowUnknownDependencies

[protobuf] Re: Generating code via protoc plugin without resolving indirect imports

2023-04-19 Thread 'habe...@google.com' via Protocol Buffers
Hi Brandon, The proto compiler doesn't generally allow what you are asking for. It always wants to see the full closure of .proto files. But if you are writing for Bazel, you shouldn't have to worry about any of that. As long as you are on Bazel >=5.3, you can use proto_common to handle most o