Skip to content

(fix)build: disable proto rule generation, rely on checked-in .pb.go for go-code compatibility#293

Open
roychying wants to merge 3 commits into
uber:mainfrom
roychying:chenghan.ying/disable-proto-gazelle
Open

(fix)build: disable proto rule generation, rely on checked-in .pb.go for go-code compatibility#293
roychying wants to merge 3 commits into
uber:mainfrom
roychying:chenghan.ying/disable-proto-gazelle

Conversation

@roychying

@roychying roychying commented Jul 1, 2026

Copy link
Copy Markdown

Why?

We want the smoothest DX for consuming the OSS submitqueue repo in go-code. Today go-code's go_repository uses build_file_generation = "on", so its Gazelle regenerates BUILD files for the vendored repo. This causes conflicts and mismatches, and every version bump risks new patching. The end goal is build_file_generation = "off" so go-code uses the OSS BUILD files directly - but that requires OSS to be buildable out-of-the-box under go-code's toolchain, which it isn't today.

The root issue is that OSS carries proto types twice: as checked-in .pb.go in protopb/, and as Bazel-generated code via go_proto_library in proto/. Removing the Bazel proto rules in favor of the checked-in .pb.go fixes several things at once:

  • Unblocks go-code's build. The proto_library rules trigger a transitive load of @protobuf//, which calls native.java_proto_library - removed in go-code's Bazel 8.5.1. Removing them removes the breakage.
  • Eliminates duplicate proto definitions. The two generation paths share the same importpath, which caused the duplicate-importpath ambiguity and forced the gazelle:resolve workarounds. Collapsing to a single source removes that whole class of conflict.
  • Serves non-Bazel consumers. The Bazel-generated code only exists inside a Bazel build graph. Anyone consuming submitqueue via plain go build/go get (including OSS users) can only use the checked-in .pb.go, so that path must work regardless. The Bazel proto rules are a redundant second path that serves no one the checked-in files don't already serve.

What?

Disable Gazelle proto rule generation and remove all proto compilation rules, relying solely on checked-in .pb.go files.

  • Add # gazelle:proto disable_global to prevent Gazelle from regenerating proto rules on future make gazelle runs
  • Remove the gazelle:resolve directives that are no longer needed
  • Remove proto_library, go_proto_library, and alias go_library rules
  • Keep exports_files for make proto codegen (tool/proto/BUILD.bazel)

Test Plan

  • make build - pass
  • make test - 65/65 unit tests pass (integration/e2e tests fail due to Docker dependency, pre-existing)
  • bazel build //tool/proto:generated - proto codegen still works
  • make gazelle - zero warnings, no duplicate-importpath ambiguity
  • Validated in go-code with --override_repository pointing at this branch: all 71 targets build, all 20 tests pass across stovepipe, submitqueue/gateway, and submitqueue/orchestrator

Issue

@roychying roychying requested review from a team, behinddwalls and sbalabanov as code owners July 1, 2026 19:12
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


chenghan.ying seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@roychying roychying changed the title Chenghan.ying/disable proto gazelle (fix)build: disable proto rule generation, rely on checked-in .pb.go for go-code compatibility Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants