grpc / grpc/grpc-java

Provide Prebuilt binaries for the java grpc protc plugin

Open
#10,509 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
12.1k
Forks
4k
Avg merge
2d 17h
Merged PRs (30d)
37

Description

### Is your feature request related to a problem?

When using `bazel` to build proto files into `java`, this library currently requires building the plugin from the source. This usually works well but some systems, mostly OSX don't have a good way to ensure you have a hermetic cpp compiler. I've seen issues where given the setup or version of the OS and the local compiler can cause problems. This can get exacerbated by having other dependencies in a project that depend on other versions of CPP. Some things need `c++14` and other `c++17`.

### Describe the solution you'd like

If this repo could publish a pre-built binary for each OS and architecture on release then the consumers could pull that down instead of having to ensure their tool chain is configured correctly to build from source. e.g

```
# Use a pre-built if we have it other wise fall back to compiling from source.
alias(
name = "grpc_java_plugin",
visibility = ["//visibility:public"],
actual = select({
"@bazel_tools//src/conditions:darwin_x86_64": "@grpc_java_plugin_darwin_amd64//:java_plugin",
"@bazel_tools//src/conditions:linux_x86_64": "@grpc_java_plugin_linux_amd64//:java_plugin",
"//conditions:default": ":grpc_java_plugin_bin"
}),
)
```

Fall back to building from source if there isn't an applicable version published on release so you could only target the major versions if storage on Github is a concern.

This is how `rules_proto` is currently providing `protoc` and this system works very well.

In addition, it's very easy to cause the cache to break when building from a source which causes a lot of unneeded rebuilds.

### Additional context

One way to roll this out is to put this behind a config and only use prebuilts when that flag is on. So consumer would have to opt in until it seems stable and then can be put on by default.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.