bazelbuild / rules_go

Go rules for Bazel
Apache License 2.0
1.37k stars 650 forks source link

go_proto_compiler: integration with proto_lang_toolchain #2684

Open franciscocpg opened 3 years ago

franciscocpg commented 3 years ago

What version of rules_go are you using?

v0.20.1

What version of gazelle are you using?

0.18.2

What version of Bazel are you using?

3.6.0

Does this issue reproduce with the latest releases of all the above?

Not applicable

What operating system and processor architecture are you using?

Linux x86)64

Any other potentially useful information about your toolchain?

Not applicable

What did you do?

This is more a question related to #2489.

I was able to fix the issue reported there, but I want to use pre-built binaries just like this instead of compiling protobuf. Is there a way to do that?

What did you expect to see?

Not applicable

What did you see instead?

Not applicable

jayconrod commented 3 years ago

There's no way to do that at the moment.

It looks like proto_lang_toolchain provides a way to define the command that language rules like go_proto_library should use. go_proto_library doesn't actually integrate with that, so it wouldn't work today. So that might be a way to implement this.

franciscocpg commented 3 years ago

Hi @jayconrod

Thank you for answering.

I'd like to help with this, but I have no idea where to begin.

Where should I start looking to add support for proto_lang_toolchain in the go_proto_library rule?

jayconrod commented 3 years ago

Sorry, this needs more experimentation and design before there's an implementation plan, and I don't have bandwidth to do that right now.

ar3s3ru commented 3 years ago

Hey @jayconrod, how can we move forward this issue?

I'd like to see this solved, and can definitely give a hand here.

jayconrod commented 3 years ago

Sorry, I have zero bandwidth to work on this or review changes here.

ar3s3ru commented 3 years ago

@jayconrod understandable. Can you pull in someone else that can help out here?

jayconrod commented 3 years ago

cc @bazelbuild/go-maintainers if anyone's interested in looking at this.

linzhp commented 3 years ago

Ideally, this should work with Bazel's --proto_compiler, but Bazel doesn't pass that option to Starlark, so there is no way for go_proto_library to get that (#2018). That said, there is a workaround though: https://github.com/bazelbuild/bazel/issues/8485#issuecomment-590561684