Commit graph

2 commits

Author SHA1 Message Date
Sahin Yort
8c857c3a1c fix: cc_toolchain should prefer protoc when prebuilt flag is flipped. (#25168)
cc_toolchain now respects the prefer_prebuilt_protoc flag. When the flag is set to true, the toolchain uses the full protoc binary instead of protoc_minimal, enabling prebuilt protoc support.

Follow up to this is to have minimal protoc released as an artifact and use that.

Closes #25168

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/25168 from thesayyn:cc_toolchain_prebuilt 30451beb53
PiperOrigin-RevId: 853463775
2026-01-07 16:52:04 -08:00
Alex Eagle
cc23698b48 feat(bazel): wire up prebuilt protoc toolchain (#24115)
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=https://github.com/protocolbuffers/protobuf/pull/24115 from protocolbuffers:alexeagle/use_prebuilt_toolchain b18667d82c
PiperOrigin-RevId: 844859103
2025-12-15 11:43:45 -08:00