Support the protobuf worker protocol in order to support RBE - #1887
Support the protobuf worker protocol in order to support RBE#1887mauriciogg 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.
|
does this mean your remote exec provider doesn't support this even with bazelbuild/bazel#30641 ? (or |
keith
left a comment
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", |
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?
There was a problem hiding this comment.
does this still matter now that prebuilt_protoc is the default in bazel 9+ and protobuf 34.0+?
There was a problem hiding this comment.
Iirc it is opt in even in 9.
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