-
Notifications
You must be signed in to change notification settings - Fork 15.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bazel: Remove hardcoded dependency on //:protoc
from language runtimes
#19679
base: main
Are you sure you want to change the base?
Conversation
Without this change, language runtimes still result in a build of `//:protoc` even with a prebuilt `proto_toolchain` registered or `--proto_compiler` set to a precompiled protoc.
@shaod2 Would you be available to review this? |
d92eae2
to
3bd939d
Compare
Hey Fabian, So IIUC, this PR is trying to make the protoc binary used by proto_library customizable. While that might be a possible long-term solution, it opens the door to a lot of potential misuse. Notably, mixing alternate implementations or different versions of protoc is typically unsupported and can have unexpected results. We have poison pills to avoid some of these situations outside of Bazel, but they haven't been added to all our languages yet. A more conservative change would be to just have some kind of flag that toggles between build-from-source and the prebuilt releases we publish to github, without allowing arbitrary binaries to be injected. Additionally, this PR is touching protobuf.bzl, which just contains our legacy internal macros/rules (which we want to delete). These have been replaced by the rules in //bazel, which were recently moved from other Bazel repos. |
These macros are still used to bootstrap the Java well-known protos for the default Java
Isn't the |
Without this change, language runtimes still result in a build of
//:protoc
even with a prebuiltproto_toolchain
registered or--proto_compiler
set to a precompiled protoc. Removing this hardcoded dependency allows a (fast) build ofjava_proto_library
targets without a C++ toolchain assuming a prebuilt protoc.Work towards #19558