Skip to content

[proto tooling] add hermetic protoc compilation managed by bazel#201

Merged
behinddwalls merged 1 commit into
mainfrom
wua/use-toolchains-protoc
Jun 5, 2026
Merged

[proto tooling] add hermetic protoc compilation managed by bazel#201
behinddwalls merged 1 commit into
mainfrom
wua/use-toolchains-protoc

Conversation

@albertywu
Copy link
Copy Markdown
Contributor

@albertywu albertywu commented Jun 5, 2026

Summary

Bazel-ify the entire codegen toolchain so a single make proto produces byte-identical output on any host.

Previously, make proto was dependent on host-installed versions of protoc + plugins which led to different output when run on different machine.

Test Plan

make fmt && make proto && make build && make test && make e2e-test
make proto <-- no changes to generated source
✅ Modify .proto -> call make proto -> see expected updates to all protopb/* files

Issues

T3-CODE-204

Copilot AI review requested due to automatic review settings June 5, 2026 00:53
@albertywu albertywu changed the title add hermetic protoc compilation managed by bazel [proto tooling] add hermetic protoc compilation managed by bazel Jun 5, 2026
@albertywu albertywu marked this pull request as ready for review June 5, 2026 00:57
@albertywu albertywu requested review from a team, behinddwalls and sbalabanov as code owners June 5, 2026 00:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Bazel-managed, hermetic protobuf compilation for the repo’s Go/YARPC stubs, and updates developer workflows to use Bazel as the protoc + plugin source of truth.

Changes:

  • Introduces a custom Starlark rule (go_proto_generated_files) that runs protoc from the registered proto toolchain with pinned Go/gRPC/YARPC plugins.
  • Adds Bazel targets under //tool/proto to generate the repo’s gateway/orchestrator protos for both submitqueue and stovepipe.
  • Updates make proto (and docs) to generate via Bazel and copy results back into the checked-in */protopb directories.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tool/proto/proto_codegen.bzl New Starlark rule wrapping hermetic protoc execution for Go/grpc/yarpc outputs.
tool/proto/BUILD.bazel Adds concrete generation targets for the four existing proto entrypoints and a generated filegroup.
submitqueue/orchestrator/proto/BUILD.bazel Exports orchestrator.proto to allow //tool/proto to depend on the source file directly.
submitqueue/gateway/proto/BUILD.bazel Exports gateway.proto to allow //tool/proto to depend on the source file directly.
stovepipe/orchestrator/proto/BUILD.bazel Exports orchestrator.proto to allow //tool/proto to depend on the source file directly.
stovepipe/gateway/proto/BUILD.bazel Exports gateway.proto to allow //tool/proto to depend on the source file directly.
MODULE.bazel Pins a toolchains_protoc protoc version and adds a bzlmod Go module entry to obtain protoc-gen-go-grpc.
Makefile Replaces direct protoc invocations with bazel build //tool/proto:generated + copy-back + goimports formatting.
doc/howto/DEVELOPMENT.md Updates local setup + troubleshooting to reflect Bazel-provided protoc/plugins rather than local installs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@behinddwalls behinddwalls added this pull request to the merge queue Jun 5, 2026
Merged via the queue into main with commit cfd51a8 Jun 5, 2026
26 checks passed
@behinddwalls behinddwalls deleted the wua/use-toolchains-protoc branch June 5, 2026 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants