Open maryamb opened 10 months ago
https://github.com/facebook/buck2/blob/6b06646a36b0ac8b33378fd4103e461e2cec20ba/proto_defs.bzl#L13 is probably a reasonable start. Note that we defined a macro that just internally uses genrule
to run the protobuf compiler. I'd figure out what command lines you need to convert proto files into Python files, code it up as a genrule, and then depend on the outputs as the Python.
We should probably have first-class proto rules in Buck2 one day, but no one has got around to that yet.
Are there already rules for building grpc artifacts in Python? I could see some for rust but none for Python. If the related rules already exist, can you add some examples of how to use them (for Python). If not, can you sketch how we can make such rules?