Provide Prebuilt binaries for the java grpc protc plugin
- Vorherrschende Sprache
- Java
- Sterne
- 12.1k
- Forks
- 4k
- Ø Merge
- 2 T. 17 Std.
- Gemergte PRs (30 T.)
- 37
Beschreibung
### 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.
Beitragsleitfaden
Rechercherichtung
Beginne mit der Prüfung der aktuellen Bazel-Konfiguration, die das Java-gRPC-protoc-Plugin erstellt, sowie des Release-Prozesses, der Artefakte veröffentlichen würde. Vergleiche das vorgeschlagene Fallback- und Opt-in-Verhalten mit dem im Issue beschriebenen rules_proto-Ansatz. Als erledigt gilt die Aufgabe, wenn Binärdateien für unterstützte Betriebssysteme und Architekturen veröffentlicht werden und Verbraucher sie auswählen können, während ein Fallback zum Erstellen aus dem Quellcode erhalten bleibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- build-system, release
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 30/100