Hello, pantsbuild friends! We are wanting to comp...
# general
w
Hello, pantsbuild friends! We are wanting to compare implicit vs explicit field presence in some of our protobuf definitions. In order to do so we need to pass the parameter
Copy code
--experimental_allow_proto3_optional
to protoc when pants build the *_pb2 files. Looking at the porotbuf_spource and protobuf_sources targets does not reveal any properties for specifying additional protoc parameters. Is this accurate or did I miss it?
So it looks like
Copy code
--experimental_allow_proto3_optional
is not needed in modern version of protoc. So looks like we do not need to pass any special parameters to protoc to use optional keyword in protoc v3. Taking a look at the various protoc flags and options available, it may still be consider enabling a pass-through property for protoc flags in BUILD files via the protobuf_source(s) targets.
h
I believe that is correct, there is no way to pass custom proto flags in today
but that could be useful
I would love to find a way to do this sort of thing generically, rather than on a tool-by-tool basis. I.e., have some shared way of constructing cmd lines for underlying tools
w
Hi Benjy, Thanks for the reply. I really like the idea of a generic method for sending command line options to any module. That makes a lot of sense.
h
I wouldn’t wait for that though. Sounds like you don’t need it right now, but if you do, probably adding it piecemeal is the way to go…
👍 1