rules_proto icon indicating copy to clipboard operation
rules_proto copied to clipboard

fix: allow generated files to be in a subfolder

Open alexeagle opened this issue 2 years ago • 2 comments

The logic for taking the basename assumes that outputs are in the same folder with the package.

This fix allows a protoc invocation like

proto_compile(
    name = "view_display_proto_compile",
    output_mappings = ["payload/view_display_pb2.py=internal/payload/view_display_pb2.py"],
    outputs = ["payload/view_display_pb2.py"],
    plugins = ["@build_stack_rules_proto//plugin/builtin:python"],
    proto = "view_display_proto",
)

Note: I only tested this with manually generated rules, I imagine changes to the gazelle plugin would also be needed.

alexeagle avatar Feb 01 '22 06:02 alexeagle

Thanks @alexeagle I'll take a look at this. Outputs in subfolders would indeed be a new usage.

pcj avatar Feb 02 '22 02:02 pcj

ping! :)

alexeagle avatar Feb 25 '22 16:02 alexeagle

Sadly this is quite old. Will close due to age, but we can pick this up again if still needed.

pcj avatar Feb 17 '24 22:02 pcj