-
Notifications
You must be signed in to change notification settings - Fork 16k
feat(bazel): wire up prebuilt protoc toolchain #24115
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
Conversation
46f35dc to
7e9cd2c
Compare
7e9cd2c to
d76fbd6
Compare
|
This looks reasonable to me. But it's still missing the validation layer AFAICT. Is this PR waiting for that? Also the tests are all still broken |
|
Sure, I can pick up something like #23539 - the only comment I got there was "cannot reproduce" but I'd like to know if the guarantee is strong enough. Separately I'd be very happy to land this one first. That could unblock the flag flip in time for Bazel 9 due in a month. |
d76fbd6 to
f45a2a4
Compare
I'd probably like to see version check to prevent use of arbitrarily old versions of prebuilt protoc or newer versions of protoc from being used like w https://protobuf.dev/support/cross-version-runtime-guarantee/. |
| } | ||
| # An arbitrary version of protobuf that includes pre-built binaries. | ||
| # See /examples/example_without_cc_toolchain which uses this for testing. | ||
| _TEST_VERSION = "v33.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably still want this updated to ensure it doesn't end up too ancient. Perhaps this can get updated via GHA too triggered by a new release to update this when there are new minor releases (e.g. v33.0) in at least main and the corresponding release branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that's possible, I can propose some GHA automation after this lands.
| bool_flag( | ||
| name = "prefer_prebuilt_protoc", | ||
| # TODO(alexeagle): this should be True after the feature is vetted with some adoption | ||
| build_setting_default = False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to be set to false for most of our CI tests at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I wouldn't expect the default for end-users to be motivated similarly to how protobuf team will test. In fact, this default could vary between this repo and the Bazel module we publish, using the BCR patches feature.
+1 to Sandy, while we might be ok with landing this PR first, we definitely wouldn't want to flip the flag without the validation we laid out in the design. I'm not sure what guarantee is in that prototype, but it does seem like an appropriate place to add the validation |
1fd7854 to
6dce826
Compare
|
okay @zhangskz I've added the version verification to this PR, PTAL |
ebad988 to
ab033ab
Compare
Users can manually register this in their MODULE.bazel so that registration overrides the default, which is still building protoc from source.
ab033ab to
3d734ea
Compare
Upstreamed from my https://github.com/aspect-build/toolchains_protoc which provided this feature outside the protobuf repo. Adds: - private API: module_extension + tag `protoc.prebuilt_toolchain` to provide and register toolchain for bzlmod users - WORKSPACE users can live with the inconvenience of having to create toolchains themselves - example of proto_library rule with intentionally non-functional cc toolchain, exercising the feature This needs work with @thesayyn to: - constrain users to choosing a protoc version agreeing with design doc https://docs.google.com/document/d/16N-eU-0zHbWmxEuaUAIFTJwQLekIXZ8zIC3K4XDr20E/edit - also register lang toolchains when the flag is enabled Work towards #19558 Closes #24115 COPYBARA_INTEGRATE_REVIEW=#24115 from protocolbuffers:alexeagle/use_prebuilt_toolchain b18667d FUTURE_COPYBARA_INTEGRATE_REVIEW=#24115 from protocolbuffers:alexeagle/use_prebuilt_toolchain b18667d PiperOrigin-RevId: 843732324
Upstreamed from my https://github.com/aspect-build/toolchains_protoc which provided this feature outside the protobuf repo. Adds: - private API: module_extension + tag `protoc.prebuilt_toolchain` to provide and register toolchain for bzlmod users - WORKSPACE users can live with the inconvenience of having to create toolchains themselves - example of proto_library rule with intentionally non-functional cc toolchain, exercising the feature This needs work with @thesayyn to: - constrain users to choosing a protoc version agreeing with design doc https://docs.google.com/document/d/16N-eU-0zHbWmxEuaUAIFTJwQLekIXZ8zIC3K4XDr20E/edit - also register lang toolchains when the flag is enabled Work towards #19558 Closes #24115 COPYBARA_INTEGRATE_REVIEW=#24115 from protocolbuffers:alexeagle/use_prebuilt_toolchain b18667d FUTURE_COPYBARA_INTEGRATE_REVIEW=#24115 from protocolbuffers:alexeagle/use_prebuilt_toolchain b18667d PiperOrigin-RevId: 843732324
Upstreamed from my https://github.com/aspect-build/toolchains_protoc which provided this feature outside the protobuf repo. Adds: - private API: module_extension + tag `protoc.prebuilt_toolchain` to provide and register toolchain for bzlmod users - WORKSPACE users can live with the inconvenience of having to create toolchains themselves - example of proto_library rule with intentionally non-functional cc toolchain, exercising the feature This needs work with @thesayyn to: - constrain users to choosing a protoc version agreeing with design doc https://docs.google.com/document/d/16N-eU-0zHbWmxEuaUAIFTJwQLekIXZ8zIC3K4XDr20E/edit - also register lang toolchains when the flag is enabled Work towards #19558 Closes #24115 COPYBARA_INTEGRATE_REVIEW=#24115 from protocolbuffers:alexeagle/use_prebuilt_toolchain b18667d FUTURE_COPYBARA_INTEGRATE_REVIEW=#24115 from protocolbuffers:alexeagle/use_prebuilt_toolchain b18667d PiperOrigin-RevId: 843732324
Upstreamed from my https://github.com/aspect-build/toolchains_protoc which provided this feature outside the protobuf repo. Adds: - private API: module_extension + tag `protoc.prebuilt_toolchain` to provide and register toolchain for bzlmod users - WORKSPACE users can live with the inconvenience of having to create toolchains themselves - example of proto_library rule with intentionally non-functional cc toolchain, exercising the feature This needs work with @thesayyn to: - constrain users to choosing a protoc version agreeing with design doc https://docs.google.com/document/d/16N-eU-0zHbWmxEuaUAIFTJwQLekIXZ8zIC3K4XDr20E/edit - also register lang toolchains when the flag is enabled Work towards #19558 Closes #24115 COPYBARA_INTEGRATE_REVIEW=#24115 from protocolbuffers:alexeagle/use_prebuilt_toolchain b18667d FUTURE_COPYBARA_INTEGRATE_REVIEW=#24115 from protocolbuffers:alexeagle/use_prebuilt_toolchain b18667d PiperOrigin-RevId: 844815128
Upstreamed from my https://github.com/aspect-build/toolchains_protoc which provided this feature outside the protobuf repo. Adds: - private API: module_extension + tag `protoc.prebuilt_toolchain` to provide and register toolchain for bzlmod users - WORKSPACE users can live with the inconvenience of having to create toolchains themselves - example of proto_library rule with intentionally non-functional cc toolchain, exercising the feature This needs work with @thesayyn to: - constrain users to choosing a protoc version agreeing with design doc https://docs.google.com/document/d/16N-eU-0zHbWmxEuaUAIFTJwQLekIXZ8zIC3K4XDr20E/edit - also register lang toolchains when the flag is enabled Work towards #19558 Closes #24115 COPYBARA_INTEGRATE_REVIEW=#24115 from protocolbuffers:alexeagle/use_prebuilt_toolchain b18667d FUTURE_COPYBARA_INTEGRATE_REVIEW=#24115 from protocolbuffers:alexeagle/use_prebuilt_toolchain b18667d PiperOrigin-RevId: 844815128
Upstreamed from my https://github.com/aspect-build/toolchains_protoc which provided this feature outside the protobuf repo. Adds: - private API: module_extension + tag `protoc.prebuilt_toolchain` to provide and register toolchain for bzlmod users - WORKSPACE users can live with the inconvenience of having to create toolchains themselves - example of proto_library rule with intentionally non-functional cc toolchain, exercising the feature This needs work with @thesayyn to: - constrain users to choosing a protoc version agreeing with design doc https://docs.google.com/document/d/16N-eU-0zHbWmxEuaUAIFTJwQLekIXZ8zIC3K4XDr20E/edit - also register lang toolchains when the flag is enabled Work towards #19558 Closes #24115 COPYBARA_INTEGRATE_REVIEW=#24115 from protocolbuffers:alexeagle/use_prebuilt_toolchain b18667d PiperOrigin-RevId: 844859103
Upstreamed from my https://github.com/aspect-build/toolchains_protoc which provided this feature outside the protobuf repo.
Adds:
protoc.prebuilt_toolchainto provide and register toolchain for bzlmod usersThis needs work with @thesayyn to:
https://docs.google.com/document/d/16N-eU-0zHbWmxEuaUAIFTJwQLekIXZ8zIC3K4XDr20E/edit
Work towards #19558