-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[6.5.0] Proto toolchainisation cherrypicks #20925
[6.5.0] Proto toolchainisation cherrypicks #20925
Commits on Jan 17, 2024
-
Implement incompatible_enable_proto_toolchain_resolution
The flag also make proto toolchain related flags a no-op when enabled. PiperOrigin-RevId: 566186339 Change-Id: If4ddafa4e8ba4cdf9e7b3d564c5fc72ab764c7ac
Configuration menu - View commit details
-
Copy full SHA for b47d436 - Browse repository at this point
Copy the full SHA b47d436View commit details -
Use MockProtoSupport.setup where protos are used
Update MockProtoSupport.setup to always create rules_proto (setupWorskpace call) PiperOrigin-RevId: 566643341 Change-Id: I755044233652597296ddcfd0c8a9ceae2e079efc
Configuration menu - View commit details
-
Copy full SHA for 2053317 - Browse repository at this point
Copy the full SHA 2053317View commit details -
Remove protoc from proto_lang_toolchain rule
The protoc should be provided with a new proto_toolchain rule. Issue: bazelbuild/rules_proto#179 RELNOTES[INC]: proto_compiler attribute removed from proto_lang_toolchain (it was recently introduced, and there is no evidence of use) PiperOrigin-RevId: 566937038 Change-Id: I7133be4d5cbcc816764c0ba35607329ea50d2406
Configuration menu - View commit details
-
Copy full SHA for e95f116 - Browse repository at this point
Copy the full SHA e95f116View commit details -
Use proto_toolchain in proto_library
Change --incompatible_enable_proto_toolchain_resolution flag to a loading time flag. This is partial revert of bazelbuild@11cf1b7. We need a load time flag, because toolchain type might not exist at current versions of rules repos users use. When the flag is set, proto_library defines the toolchain and doesn't use an implicit dependency at the same time. In Bazel the flag may only be flipped after all the rules_* repo are upgraded to define toolchain type and protobuf repository registers the toolchains. Issue: bazelbuild/rules_proto#179 PiperOrigin-RevId: 567296665 Change-Id: Ib3fc27751dd14589fa403f45d2cbbad22537b9a3
Configuration menu - View commit details
-
Copy full SHA for d114f24 - Browse repository at this point
Copy the full SHA d114f24View commit details -
Use proto compiler from proto_toolchain rule
Issue: bazelbuild/rules_proto#179 PiperOrigin-RevId: 567570286 Change-Id: Ia7e1ff08a0123a325f1df00f56b81212c01e2588
Configuration menu - View commit details
-
Copy full SHA for 36394f9 - Browse repository at this point
Copy the full SHA 36394f9View commit details -
Refactor proto toolchainsation support utilities
Implement reusable utils as part of proto_common and move out of semantics. Define toolchains that will be needed for lang_proto_libraries. Because there are so many toolchains this will make the future code more readable. Issue: bazelbuild/rules_proto#179 PiperOrigin-RevId: 570019432 Change-Id: Ie1675f1d847872bab3a250270eaa451ef4816ed8
Configuration menu - View commit details
-
Copy full SHA for 0895719 - Browse repository at this point
Copy the full SHA 0895719View commit details -
Decouple java_lite_proto_library from java_proto_library
Remove call to java_proto_library_impl from java_proto_library. Remove hasattr from java_proto_library_impl, which handled java_lite_proto_library. Code reuse in this case made little sense, and it incurrent more maintenance cost than benefit. Issue: bazelbuild/rules_proto#179 PiperOrigin-RevId: 570053518 Change-Id: Ie43cadfd1fc324b6aaad08acaca8eea7df1a3669
Configuration menu - View commit details
-
Copy full SHA for 8ea74cd - Browse repository at this point
Copy the full SHA 8ea74cdView commit details -
Use proto toolchains in java_proto_library
Retrieve proto_lang_toolchain using toolchains in java_proto_library when proto toolchain resolution is enabled. Add mocks for proto_lang_toolchain from rules_proto. Return ToolchainInfo from proto_lang_toolchain rule. That's needed in the resolution. Also returning ProtoLangToolchainInfo directly, to support legacy mechanism. Issue: bazelbuild/rules_proto#179 PiperOrigin-RevId: 570055332 Change-Id: Ieb0510d48778900b8576a71ddb20abfdcda220be
Configuration menu - View commit details
-
Copy full SHA for 514b3e4 - Browse repository at this point
Copy the full SHA 514b3e4View commit details -
Use proto toolchains in java_lite_proto_library
Retrieve proto_lang_toolchain using toolchains in java_lite_proto_library when proto toolchain resolution is enabled. Issue: bazelbuild/rules_proto#179 PiperOrigin-RevId: 570056144 Change-Id: Ia952003017d18baca71d4e0ba75fc3134b972817
Configuration menu - View commit details
-
Copy full SHA for 9524dac - Browse repository at this point
Copy the full SHA 9524dacView commit details -
Use proto toolchains in cc_proto_library
Retrieve proto_lang_toolchain using toolchains in cc_proto_library when proto toolchain resolution is enabled. Issue: bazelbuild/rules_proto#179 PiperOrigin-RevId: 570334276 Change-Id: If7b7e25254bf3036fdcad67d36474b8fe64a8ffd
Configuration menu - View commit details
-
Copy full SHA for f30e59a - Browse repository at this point
Copy the full SHA f30e59aView commit details -
Support automatic exec groups in proto_common.compile
Pass toolchain_type through ProtoLangToolchainInfo into proto_common.compile and use it on ctx.actions.run. Automatic exec groups require that toolchain type is set on the `ctx.actions.run`. This information is used to select correct execution platform. Expose INCOMPATIBLE_ENABLE_PROTO_TOOLCHAIN_RESOLUTION in proto_common. This will be needed to support lang_proto_libraries that are not part of Bazel. For example py_proto_library. Other methods in `toolchains` struct in proto_common.bzl, are both temporary and can be written in Starlark, so don't expose them. It's possible to access the value in backward compatible manner (that is with `getattr(proto_common, ...)`). Expose INCOMPATIBLE_PASS_TOOLCHAIN_TYPE in proto_common. Second "flag" is here to mark, that builtin `proto_lang_toolchain` rule has a `toolchain_type` attribute. This way `proto_lang_toolchain` macro can pass the value in a compatible fashion with older Bazel. This should make toolchainisation work with older versions of Bazel that don't know about automatic exec groups and don't need to pass in the value. Issue: bazelbuild/rules_proto#179 PiperOrigin-RevId: 571876657 Change-Id: I543ab862b318c9062d40430160e33ad197973094
Configuration menu - View commit details
-
Copy full SHA for 29b1f95 - Browse repository at this point
Copy the full SHA 29b1f95View commit details