Support the protobuf worker protocol in order to support RBE - #1887
Open
mauriciogg wants to merge 3 commits into
Open
Support the protobuf worker protocol in order to support RBE#1887mauriciogg wants to merge 3 commits into
mauriciogg wants to merge 3 commits into
Conversation
The persistent worker only spoke newline-delimited JSON, and the compile
actions declared requires-worker-protocol=json accordingly. That
execution requirement is client-side only: remote persistent worker
runners (e.g. EngFlow) always speak Bazel's original length-delimited
protobuf encoding. Worse, when an action declares the JSON protocol,
Bazel silently omits the persistentWorkerKey platform property from
remote execution requests, so Swift actions can never use remote
persistent workers at all.
Teach the worker the protobuf wire format, auto-detected from the first
byte of the first request: JSON requests begin with '{', protobuf frames
begin with a varint message length. The proto messages are parsed with
generated code checked in alongside a verbatim copy of Bazel's
worker_protocol.proto (regeneration instructions in tools/worker/BUILD),
so building the worker does not require a protoc toolchain. With the
worker bilingual, worker-enabled actions now declare
requires-worker-protocol=proto - Bazel's local workers fully support the
proto protocol for singleplex workers, and remote runners can now route
Swift compiles to persistent workers.
mauriciogg
requested review from
aaronsky,
adincebic,
brentleyjones,
keith and
luispadron
as code owners
August 11, 2026 21:41
Member
|
does this mean your remote exec provider doesn't support this even with bazelbuild/bazel#30641 ? (or |
keith
reviewed
Aug 11, 2026
keith
left a comment
Member
There was a problem hiding this comment.
IIRC moving to json was primarily to remove the protobuf compile, i think we should gate this behind a starlark bool_flag so there's no penalty to users who aren't using this
| }), | ||
| deps = [ | ||
| "@nlohmann_json//:json", | ||
| "@protobuf//:protobuf", |
Member
There was a problem hiding this comment.
I always assumed that if we were building this building protoc was kinda fine, how much do we save by doing it this checked in way?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support the protobuf worker protocol in order to support RBE
Our RBE environment only supports protobuf as worker protocol so we need this in orde to enable RBE for our iOS builds.
requires-worker-protocolis stilljsonso this is a noop unless explcitly overriden in command line