From 25c0da7ca39b4b19bf3df135b10b992bbd7278f8 Mon Sep 17 00:00:00 2001 From: Mauricio Galindo Date: Tue, 11 Aug 2026 14:20:50 -0700 Subject: [PATCH 1/3] Support the protobuf worker protocol, enabling remote persistent workers 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. --- swift/internal/actions.bzl | 2 +- tools/worker/BUILD | 20 +- tools/worker/worker_protocol.cc | 129 ++- tools/worker/worker_protocol.pb.cc | 1454 ++++++++++++++++++++++++++++ tools/worker/worker_protocol.pb.h | 1401 +++++++++++++++++++++++++++ tools/worker/worker_protocol.proto | 100 ++ 6 files changed, 3097 insertions(+), 9 deletions(-) create mode 100644 tools/worker/worker_protocol.pb.cc create mode 100644 tools/worker/worker_protocol.pb.h create mode 100644 tools/worker/worker_protocol.proto diff --git a/swift/internal/actions.bzl b/swift/internal/actions.bzl index e5e0d60b6..f261e825c 100644 --- a/swift/internal/actions.bzl +++ b/swift/internal/actions.bzl @@ -202,7 +202,7 @@ def run_toolchain_action( tool_config.use_param_file ): execution_requirements["supports-workers"] = "1" - execution_requirements["requires-worker-protocol"] = "json" + execution_requirements["requires-worker-protocol"] = "proto" executable = swift_toolchain.swift_worker tool_executable_args.add(tool_config.executable) diff --git a/tools/worker/BUILD b/tools/worker/BUILD index 029c7ae25..2a5b1de85 100644 --- a/tools/worker/BUILD +++ b/tools/worker/BUILD @@ -139,8 +139,23 @@ cc_library( cc_library( name = "worker_protocol", - srcs = ["worker_protocol.cc"], - hdrs = ["worker_protocol.h"], + # worker_protocol.pb.{h,cc} are checked-in generated code so that + # building the worker does not require a protoc toolchain. To + # regenerate (required when the `protobuf` dep in MODULE.bazel moves to + # an incompatible version): + # protoc --cpp_out=tools/worker --proto_path=tools/worker \ + # tools/worker/worker_protocol.proto + # using a protoc release that matches the MODULE.bazel protobuf version. + # worker_protocol.proto is a verbatim copy of Bazel's + # src/main/protobuf/worker_protocol.proto. + srcs = [ + "worker_protocol.cc", + "worker_protocol.pb.cc", + ], + hdrs = [ + "worker_protocol.h", + "worker_protocol.pb.h", + ], copts = select({ "//tools:clang-cl": [ "-Xclang=-fno-split-cold-code", @@ -155,6 +170,7 @@ cc_library( }), deps = [ "@nlohmann_json//:json", + "@protobuf//:protobuf", ], ) diff --git a/tools/worker/worker_protocol.cc b/tools/worker/worker_protocol.cc index 7420b1ad7..5162bdd09 100644 --- a/tools/worker/worker_protocol.cc +++ b/tools/worker/worker_protocol.cc @@ -14,10 +14,95 @@ #include "tools/worker/worker_protocol.h" +#include +#include +#include +#include +#include +#include +#include + #include +#include "tools/worker/worker_protocol.pb.h" + namespace bazel_rules_swift::worker_protocol { +namespace { + +// Which wire format the peer speaks. Bazel selects JSON via the +// requires-worker-protocol execution requirement, but that requirement is +// client-side only: remote persistent worker runners (e.g. EngFlow) always +// speak the original length-delimited protobuf encoding. Detect the encoding +// from the first byte of the first request: JSON requests are +// newline-delimited objects that begin with '{' (0x7b), while protobuf +// frames begin with a varint message length (a 123-byte request would be +// ambiguous, but real swiftc requests are always far larger). +enum class WireFormat { kUnknown, kJson, kProto }; +WireFormat wire_format = WireFormat::kUnknown; + +// --- Minimal protobuf wire-format helpers for worker_protocol.proto --- + +// Reads the base-128 varint length prefix of a protobuf worker message. +bool ReadVarintFromStream(std::istream& stream, uint64_t& value) { + value = 0; + int shift = 0; + while (shift < 64) { + int c = stream.get(); + if (c == std::char_traits::eof()) { + return false; + } + value |= static_cast(c & 0x7f) << shift; + if ((c & 0x80) == 0) { + return true; + } + shift += 7; + } + return false; +} + +// Writes a base-128 varint, the length prefix of a protobuf worker message. +void AppendVarint(std::string& buf, uint64_t value) { + while (value >= 0x80) { + buf.push_back(static_cast((value & 0x7f) | 0x80)); + value >>= 7; + } + buf.push_back(static_cast(value)); +} + +// Converts a parsed proto request into the internal representation. +std::optional ParseWorkRequest(const std::string& buf) { + blaze::worker::WorkRequest proto_request; + if (!proto_request.ParseFromString(buf)) { + return std::nullopt; + } + + WorkRequest request; + request.arguments.assign(proto_request.arguments().begin(), + proto_request.arguments().end()); + request.inputs.reserve(proto_request.inputs_size()); + for (const blaze::worker::Input& proto_input : proto_request.inputs()) { + request.inputs.push_back(Input{proto_input.path(), proto_input.digest()}); + } + request.request_id = proto_request.request_id(); + request.cancel = proto_request.cancel(); + request.verbosity = proto_request.verbosity(); + request.sandbox_dir = proto_request.sandbox_dir(); + return request; +} + +// Serializes the internal response representation as a proto message. +std::string SerializeWorkResponse(const WorkResponse& response) { + blaze::worker::WorkResponse proto_response; + proto_response.set_exit_code(response.exit_code); + proto_response.set_output(response.output); + proto_response.set_request_id(response.request_id); + proto_response.set_was_cancelled(response.was_cancelled); + return proto_response.SerializeAsString(); +} + +} // namespace + // Populates an `Input` parsed from JSON. This function satisfies an API // requirement of the JSON library, allowing it to automatically parse `Input` // values from nested JSON objects. @@ -53,17 +138,49 @@ void to_json(::nlohmann::json& j, const WorkResponse& work_response) { } std::optional ReadWorkRequest(std::istream& stream) { - std::string line; - if (!std::getline(stream, line)) { - return std::nullopt; + if (wire_format == WireFormat::kUnknown) { + int first = stream.peek(); + if (first == std::char_traits::eof()) { + return std::nullopt; + } + wire_format = (first == '{') ? WireFormat::kJson : WireFormat::kProto; } - WorkRequest request; - from_json(::nlohmann::json::parse(line), request); - return request; + if (wire_format == WireFormat::kJson) { + std::string line; + if (!std::getline(stream, line)) { + return std::nullopt; + } + + WorkRequest request; + from_json(::nlohmann::json::parse(line), request); + return request; + } + + uint64_t length; + if (!ReadVarintFromStream(stream, length)) { + return std::nullopt; + } + std::string payload(length, '\0'); + if (!stream.read(&payload[0], static_cast(length))) { + return std::nullopt; + } + return ParseWorkRequest(payload); } void WriteWorkResponse(const WorkResponse& response, std::ostream& stream) { + if (wire_format == WireFormat::kProto) { + std::string payload = SerializeWorkResponse(response); + std::string frame; + AppendVarint(frame, payload.size()); + frame.append(payload); + // Flush after writing to ensure the runner doesn't hang waiting for the + // response due to buffering. + stream.write(frame.data(), static_cast(frame.size())); + stream.flush(); + return; + } + ::nlohmann::json response_json; to_json(response_json, response); diff --git a/tools/worker/worker_protocol.pb.cc b/tools/worker/worker_protocol.pb.cc new file mode 100644 index 000000000..5ba2f8829 --- /dev/null +++ b/tools/worker/worker_protocol.pb.cc @@ -0,0 +1,1454 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: worker_protocol.proto +// Protobuf C++ Version: 7.34.0 + +#include "worker_protocol.pb.h" + +#include +#include +#include "google/protobuf/io/coded_stream.h" +#include "google/protobuf/generated_message_tctable_impl.h" +#include "google/protobuf/internal_visibility.h" +#include "google/protobuf/extension_set.h" +#include "google/protobuf/generated_message_util.h" +#include "google/protobuf/wire_format_lite.h" +#include "google/protobuf/descriptor.h" +#include "google/protobuf/generated_message_reflection.h" +#include "google/protobuf/reflection_ops.h" +#include "google/protobuf/wire_format.h" +// @@protoc_insertion_point(includes) + +// Must be included last. +#include "google/protobuf/port_def.inc" +PROTOBUF_PRAGMA_INIT_SEG +namespace _pb = ::google::protobuf; +namespace _pbi = ::google::protobuf::internal; +namespace _fl = ::google::protobuf::internal::field_layout; +namespace blaze { +namespace worker { + +inline constexpr WorkResponse::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + output_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + exit_code_{0}, + request_id_{0}, + was_cancelled_{false} {} + +template +constexpr WorkResponse::WorkResponse(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(WorkResponse_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +struct WorkResponseDefaultTypeInternal { + constexpr WorkResponseDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~WorkResponseDefaultTypeInternal() {} + union { + WorkResponse _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 WorkResponseDefaultTypeInternal _WorkResponse_default_instance_; + +inline constexpr Input::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + path_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + digest_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()) {} + +template +constexpr Input::Input(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(Input_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +struct InputDefaultTypeInternal { + constexpr InputDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~InputDefaultTypeInternal() {} + union { + Input _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 InputDefaultTypeInternal _Input_default_instance_; + +inline constexpr WorkRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + ::_pbi::ConstantInitialized) noexcept + : _cached_size_{0}, + #ifdef PROTOBUF_INTERNAL_REMOVE_ARENA_PTRS_REPEATED_PTR_FIELD + arguments_{visibility, ::_pbi::InternalMetadataOffset::Build< + ::blaze::worker::WorkRequest, + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkRequest, _impl_.arguments_)>() + } + #else // !PROTOBUF_INTERNAL_REMOVE_ARENA_PTRS_REPEATED_PTR_FIELD + arguments_ {} + #endif + , + #ifdef PROTOBUF_INTERNAL_REMOVE_ARENA_PTRS_REPEATED_PTR_FIELD + inputs_{visibility, ::_pbi::InternalMetadataOffset::Build< + ::blaze::worker::WorkRequest, + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkRequest, _impl_.inputs_)>() + } + #else // !PROTOBUF_INTERNAL_REMOVE_ARENA_PTRS_REPEATED_PTR_FIELD + inputs_ {} + #endif + , + sandbox_dir_( + &::google::protobuf::internal::fixed_address_empty_string, + ::_pbi::ConstantInitialized()), + request_id_{0}, + cancel_{false}, + verbosity_{0} {} + +template +constexpr WorkRequest::WorkRequest(::_pbi::ConstantInitialized) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(WorkRequest_class_data_.base()), +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(), +#endif // PROTOBUF_CUSTOM_VTABLE + _impl_(internal_visibility(), ::_pbi::ConstantInitialized()) { +} +struct WorkRequestDefaultTypeInternal { + constexpr WorkRequestDefaultTypeInternal() : _instance(::_pbi::ConstantInitialized{}) {} + ~WorkRequestDefaultTypeInternal() {} + union { + WorkRequest _instance; + }; +}; + +PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT + PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 WorkRequestDefaultTypeInternal _WorkRequest_default_instance_; +} // namespace worker +} // namespace blaze +static constexpr const ::_pb::EnumDescriptor* PROTOBUF_NONNULL* PROTOBUF_NULLABLE + file_level_enum_descriptors_worker_5fprotocol_2eproto = nullptr; +static constexpr const ::_pb::ServiceDescriptor* PROTOBUF_NONNULL* PROTOBUF_NULLABLE + file_level_service_descriptors_worker_5fprotocol_2eproto = nullptr; +const ::uint32_t + TableStruct_worker_5fprotocol_2eproto::offsets[] ABSL_ATTRIBUTE_SECTION_VARIABLE( + protodesc_cold) = { + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::blaze::worker::Input, _impl_._has_bits_), + 5, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::blaze::worker::Input, _impl_.path_), + PROTOBUF_FIELD_OFFSET(::blaze::worker::Input, _impl_.digest_), + 0, + 1, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkRequest, _impl_._has_bits_), + 9, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkRequest, _impl_.arguments_), + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkRequest, _impl_.inputs_), + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkRequest, _impl_.request_id_), + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkRequest, _impl_.cancel_), + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkRequest, _impl_.verbosity_), + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkRequest, _impl_.sandbox_dir_), + 0, + 1, + 3, + 4, + 5, + 2, + 0x081, // bitmap + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkResponse, _impl_._has_bits_), + 7, // hasbit index offset + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkResponse, _impl_.exit_code_), + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkResponse, _impl_.output_), + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkResponse, _impl_.request_id_), + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkResponse, _impl_.was_cancelled_), + 1, + 0, + 2, + 3, +}; + +static const ::_pbi::MigrationSchema + schemas[] ABSL_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = { + {0, sizeof(::blaze::worker::Input)}, + {7, sizeof(::blaze::worker::WorkRequest)}, + {22, sizeof(::blaze::worker::WorkResponse)}, +}; +static const ::_pb::Message* PROTOBUF_NONNULL const file_default_instances[] = { + &::blaze::worker::_Input_default_instance_._instance, + &::blaze::worker::_WorkRequest_default_instance_._instance, + &::blaze::worker::_WorkResponse_default_instance_._instance, +}; +const char descriptor_table_protodef_worker_5fprotocol_2eproto[] ABSL_ATTRIBUTE_SECTION_VARIABLE( + protodesc_cold) = { + "\n\025worker_protocol.proto\022\014blaze.worker\"%\n" + "\005Input\022\014\n\004path\030\001 \001(\t\022\016\n\006digest\030\002 \001(\014\"\221\001\n" + "\013WorkRequest\022\021\n\targuments\030\001 \003(\t\022#\n\006input" + "s\030\002 \003(\0132\023.blaze.worker.Input\022\022\n\nrequest_" + "id\030\003 \001(\005\022\016\n\006cancel\030\004 \001(\010\022\021\n\tverbosity\030\005 " + "\001(\005\022\023\n\013sandbox_dir\030\006 \001(\t\"\\\n\014WorkResponse" + "\022\021\n\texit_code\030\001 \001(\005\022\016\n\006output\030\002 \001(\t\022\022\n\nr" + "equest_id\030\003 \001(\005\022\025\n\rwas_cancelled\030\004 \001(\010B&" + "\n$com.google.devtools.build.lib.workerb\006" + "proto3" +}; +static ::absl::once_flag descriptor_table_worker_5fprotocol_2eproto_once; +PROTOBUF_CONSTINIT const ::_pbi::DescriptorTable descriptor_table_worker_5fprotocol_2eproto = { + false, + false, + 366, + descriptor_table_protodef_worker_5fprotocol_2eproto, + "worker_protocol.proto", + &descriptor_table_worker_5fprotocol_2eproto_once, + nullptr, + 0, + 3, + schemas, + file_default_instances, + TableStruct_worker_5fprotocol_2eproto::offsets, + file_level_enum_descriptors_worker_5fprotocol_2eproto, + file_level_service_descriptors_worker_5fprotocol_2eproto, +}; +namespace blaze { +namespace worker { +// =================================================================== + +class Input::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(Input, _impl_._has_bits_); +}; + +Input::Input(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Input_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:blaze.worker.Input) +} +PROTOBUF_NDEBUG_INLINE Input::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::blaze::worker::Input& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + path_(arena, from.path_), + digest_(arena, from.digest_) {} + +Input::Input( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const Input& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, Input_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + Input* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + + // @@protoc_insertion_point(copy_constructor:blaze.worker.Input) +} +PROTOBUF_NDEBUG_INLINE Input::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + path_(arena), + digest_(arena) {} + +inline void Input::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); +} +Input::~Input() { + // @@protoc_insertion_point(destructor:blaze.worker.Input) + SharedDtor(*this); +} +inline void Input::SharedDtor(MessageLite& self) { + Input& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.path_.Destroy(); + this_._impl_.digest_.Destroy(); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL Input::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) Input(arena); +} +constexpr auto Input::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(Input), + alignof(Input)); +} +constexpr auto Input::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_Input_default_instance_._instance, + &_table_.header, + nullptr, // IsInitialized + &Input::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &Input::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &Input::ByteSizeLong, + &Input::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(Input, _impl_._cached_size_), + false, + }, + &Input::kDescriptorMethods, + &descriptor_table_worker_5fprotocol_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull Input_class_data_ = + Input::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +Input::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&Input_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(Input_class_data_.tc_table); + return Input_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<1, 2, 0, 31, 2> +Input::_table_ = { + { + PROTOBUF_FIELD_OFFSET(Input, _impl_._has_bits_), + 0, // no _extensions_ + 2, 8, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967292, // skipmap + offsetof(decltype(_table_), field_entries), + 2, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + Input_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::blaze::worker::Input>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // bytes digest = 2; + {::_pbi::TcParser::FastBS1, + {18, 1, 0, + PROTOBUF_FIELD_OFFSET(Input, _impl_.digest_)}}, + // string path = 1; + {::_pbi::TcParser::FastUS1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(Input, _impl_.path_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // string path = 1; + {PROTOBUF_FIELD_OFFSET(Input, _impl_.path_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // bytes digest = 2; + {PROTOBUF_FIELD_OFFSET(Input, _impl_.digest_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kBytes | ::_fl::kRepAString)}, + }}, + // no aux_entries + {{ + "\22\4\0\0\0\0\0\0" + "blaze.worker.Input" + "path" + }}, +}; +PROTOBUF_NOINLINE void Input::Clear() { +// @@protoc_insertion_point(message_clear_start:blaze.worker.Input) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.path_.ClearNonDefaultToEmpty(); + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + _impl_.digest_.ClearNonDefaultToEmpty(); + } + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL Input::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const Input& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL Input::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const Input& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:blaze.worker.Input) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // string path = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_path().empty()) { + const ::std::string& _s = this_._internal_path(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "blaze.worker.Input.path"); + target = stream->WriteStringMaybeAliased(1, _s, target); + } + } + + // bytes digest = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_digest().empty()) { + const ::std::string& _s = this_._internal_digest(); + target = stream->WriteBytesMaybeAliased(2, _s, target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:blaze.worker.Input) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t Input::ByteSizeLong(const MessageLite& base) { + const Input& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t Input::ByteSizeLong() const { + const Input& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:blaze.worker.Input) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + // string path = 1; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_path().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_path()); + } + } + // bytes digest = 2; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!this_._internal_digest().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::BytesSize( + this_._internal_digest()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void Input::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:blaze.worker.Input) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000003U)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_path().empty()) { + _this->_internal_set_path(from._internal_path()); + } else { + if (_this->_impl_.path_.IsDefault()) { + _this->_internal_set_path(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (!from._internal_digest().empty()) { + _this->_internal_set_digest(from._internal_digest()); + } else { + if (_this->_impl_.digest_.IsDefault()) { + _this->_internal_set_digest(""); + } + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void Input::CopyFrom(const Input& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:blaze.worker.Input) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void Input::InternalSwap(Input* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.path_, &other->_impl_.path_, arena); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.digest_, &other->_impl_.digest_, arena); +} + +::google::protobuf::Metadata Input::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class WorkRequest::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_._has_bits_); +}; + +WorkRequest::WorkRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, WorkRequest_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:blaze.worker.WorkRequest) +} +PROTOBUF_NDEBUG_INLINE WorkRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::blaze::worker::WorkRequest& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + #ifdef PROTOBUF_INTERNAL_REMOVE_ARENA_PTRS_REPEATED_PTR_FIELD + arguments_{visibility, ::_pbi::InternalMetadataOffset::Build< + ::blaze::worker::WorkRequest, + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkRequest, _impl_.arguments_)>() + , from.arguments_} + #else + arguments_ { visibility, arena, from.arguments_ } + #endif + , + #ifdef PROTOBUF_INTERNAL_REMOVE_ARENA_PTRS_REPEATED_PTR_FIELD + inputs_{visibility, ::_pbi::InternalMetadataOffset::Build< + ::blaze::worker::WorkRequest, + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkRequest, _impl_.inputs_)>() + , from.inputs_} + #else + inputs_ { visibility, arena, from.inputs_ } + #endif + , + sandbox_dir_(arena, from.sandbox_dir_) {} + +WorkRequest::WorkRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const WorkRequest& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, WorkRequest_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + WorkRequest* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::memcpy(reinterpret_cast(&_impl_) + + offsetof(Impl_, request_id_), + reinterpret_cast(&from._impl_) + + offsetof(Impl_, request_id_), + offsetof(Impl_, verbosity_) - + offsetof(Impl_, request_id_) + + sizeof(Impl_::verbosity_)); + + // @@protoc_insertion_point(copy_constructor:blaze.worker.WorkRequest) +} +PROTOBUF_NDEBUG_INLINE WorkRequest::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + #ifdef PROTOBUF_INTERNAL_REMOVE_ARENA_PTRS_REPEATED_PTR_FIELD + arguments_{visibility, ::_pbi::InternalMetadataOffset::Build< + ::blaze::worker::WorkRequest, + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkRequest, _impl_.arguments_)>() + } + #else + arguments_ { visibility, arena } + #endif + , + #ifdef PROTOBUF_INTERNAL_REMOVE_ARENA_PTRS_REPEATED_PTR_FIELD + inputs_{visibility, ::_pbi::InternalMetadataOffset::Build< + ::blaze::worker::WorkRequest, + PROTOBUF_FIELD_OFFSET(::blaze::worker::WorkRequest, _impl_.inputs_)>() + } + #else + inputs_ { visibility, arena } + #endif + , + sandbox_dir_(arena) {} + +inline void WorkRequest::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, request_id_), + 0, + offsetof(Impl_, verbosity_) - + offsetof(Impl_, request_id_) + + sizeof(Impl_::verbosity_)); +} +WorkRequest::~WorkRequest() { + // @@protoc_insertion_point(destructor:blaze.worker.WorkRequest) + SharedDtor(*this); +} +inline void WorkRequest::SharedDtor(MessageLite& self) { + WorkRequest& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.sandbox_dir_.Destroy(); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL WorkRequest::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) WorkRequest(arena); +} +#ifdef PROTOBUF_INTERNAL_REMOVE_ARENA_PTRS_REPEATED_PTR_FIELD +constexpr auto WorkRequest::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(WorkRequest), + alignof(WorkRequest)); +} +#else // !PROTOBUF_INTERNAL_REMOVE_ARENA_PTRS_REPEATED_PTR_FIELD +constexpr auto WorkRequest::InternalNewImpl_() { + constexpr auto arena_bits = ::google::protobuf::internal::EncodePlacementArenaOffsets({ + PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_.arguments_) + + decltype(WorkRequest::_impl_.arguments_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), + PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_.inputs_) + + decltype(WorkRequest::_impl_.inputs_):: + InternalGetArenaOffset( + ::google::protobuf::Message::internal_visibility()), + }); + if (arena_bits.has_value()) { + return ::google::protobuf::internal::MessageCreator::CopyInit( + sizeof(WorkRequest), alignof(WorkRequest), *arena_bits); + } else { + return ::google::protobuf::internal::MessageCreator(&WorkRequest::PlacementNew_, + sizeof(WorkRequest), + alignof(WorkRequest)); + } +} +#endif +constexpr auto WorkRequest::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_WorkRequest_default_instance_._instance, + &_table_.header, + nullptr, // IsInitialized + &WorkRequest::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &WorkRequest::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &WorkRequest::ByteSizeLong, + &WorkRequest::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_._cached_size_), + false, + }, + &WorkRequest::kDescriptorMethods, + &descriptor_table_worker_5fprotocol_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull WorkRequest_class_data_ = + WorkRequest::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +WorkRequest::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&WorkRequest_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(WorkRequest_class_data_.tc_table); + return WorkRequest_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<3, 6, 1, 53, 2> +WorkRequest::_table_ = { + { + PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_._has_bits_), + 0, // no _extensions_ + 6, 56, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967232, // skipmap + offsetof(decltype(_table_), field_entries), + 6, // num_field_entries + 1, // num_aux_entries + offsetof(decltype(_table_), aux_entries), + WorkRequest_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::blaze::worker::WorkRequest>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + {::_pbi::TcParser::MiniParse, {}}, + // repeated string arguments = 1; + {::_pbi::TcParser::FastUR1, + {10, 0, 0, + PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_.arguments_)}}, + // repeated .blaze.worker.Input inputs = 2; + {::_pbi::TcParser::FastMtR1, + {18, 1, 0, + PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_.inputs_)}}, + // int32 request_id = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(WorkRequest, _impl_.request_id_), 3>(), + {24, 3, 0, + PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_.request_id_)}}, + // bool cancel = 4; + {::_pbi::TcParser::SingularVarintNoZag1(), + {32, 4, 0, + PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_.cancel_)}}, + // int32 verbosity = 5; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(WorkRequest, _impl_.verbosity_), 5>(), + {40, 5, 0, + PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_.verbosity_)}}, + // string sandbox_dir = 6; + {::_pbi::TcParser::FastUS1, + {50, 2, 0, + PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_.sandbox_dir_)}}, + {::_pbi::TcParser::MiniParse, {}}, + }}, {{ + 65535, 65535 + }}, {{ + // repeated string arguments = 1; + {PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_.arguments_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcRepeated | ::_fl::kUtf8String | ::_fl::kRepSString)}, + // repeated .blaze.worker.Input inputs = 2; + {PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_.inputs_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcRepeated | ::_fl::kMessage | ::_fl::kTvTable)}, + // int32 request_id = 3; + {PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_.request_id_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, + // bool cancel = 4; + {PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_.cancel_), _Internal::kHasBitsOffset + 4, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + // int32 verbosity = 5; + {PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_.verbosity_), _Internal::kHasBitsOffset + 5, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, + // string sandbox_dir = 6; + {PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_.sandbox_dir_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + }}, + {{ + {::_pbi::TcParser::GetTable<::blaze::worker::Input>()}, + }}, + {{ + "\30\11\0\0\0\0\13\0" + "blaze.worker.WorkRequest" + "arguments" + "sandbox_dir" + }}, +}; +PROTOBUF_NOINLINE void WorkRequest::Clear() { +// @@protoc_insertion_point(message_clear_start:blaze.worker.WorkRequest) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x00000007U)) { + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + _impl_.arguments_.Clear(); + } + if (CheckHasBitForRepeated(cached_has_bits, 0x00000002U)) { + _impl_.inputs_.Clear(); + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + _impl_.sandbox_dir_.ClearNonDefaultToEmpty(); + } + } + if (BatchCheckHasBit(cached_has_bits, 0x00000038U)) { + ::memset(&_impl_.request_id_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.verbosity_) - + reinterpret_cast(&_impl_.request_id_)) + sizeof(_impl_.verbosity_)); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL WorkRequest::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const WorkRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL WorkRequest::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const WorkRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:blaze.worker.WorkRequest) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // repeated string arguments = 1; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + for (int i = 0, n = this_._internal_arguments_size(); i < n; ++i) { + const auto& s = this_._internal_arguments().Get(i); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + s.data(), static_cast(s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "blaze.worker.WorkRequest.arguments"); + target = stream->WriteString(1, s, target); + } + } + + // repeated .blaze.worker.Input inputs = 2; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000002U)) { + for (unsigned i = 0, n = static_cast( + this_._internal_inputs_size()); + i < n; i++) { + const auto& repfield = this_._internal_inputs().Get(i); + target = + ::google::protobuf::internal::WireFormatLite::InternalWriteMessage( + 2, repfield, repfield.GetCachedSize(), + target, stream); + } + } + + // int32 request_id = 3; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_request_id() != 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteInt32ToArrayWithField<3>( + stream, this_._internal_request_id(), target); + } + } + + // bool cancel = 4; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (this_._internal_cancel() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 4, this_._internal_cancel(), target); + } + } + + // int32 verbosity = 5; + if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (this_._internal_verbosity() != 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteInt32ToArrayWithField<5>( + stream, this_._internal_verbosity(), target); + } + } + + // string sandbox_dir = 6; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_sandbox_dir().empty()) { + const ::std::string& _s = this_._internal_sandbox_dir(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "blaze.worker.WorkRequest.sandbox_dir"); + target = stream->WriteStringMaybeAliased(6, _s, target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:blaze.worker.WorkRequest) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t WorkRequest::ByteSizeLong(const MessageLite& base) { + const WorkRequest& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t WorkRequest::ByteSizeLong() const { + const WorkRequest& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:blaze.worker.WorkRequest) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000003fU)) { + // repeated string arguments = 1; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + total_size += + 1 * ::google::protobuf::internal::FromIntSize(this_._internal_arguments().size()); + for (int i = 0, n = this_._internal_arguments().size(); i < n; ++i) { + total_size += ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_arguments().Get(i)); + } + } + // repeated .blaze.worker.Input inputs = 2; + if (CheckHasBitForRepeated(cached_has_bits, 0x00000002U)) { + total_size += 1UL * this_._internal_inputs_size(); + for (const auto& msg : this_._internal_inputs()) { + total_size += ::google::protobuf::internal::WireFormatLite::MessageSize(msg); + } + } + // string sandbox_dir = 6; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!this_._internal_sandbox_dir().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_sandbox_dir()); + } + } + // int32 request_id = 3; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_request_id() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this_._internal_request_id()); + } + } + // bool cancel = 4; + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (this_._internal_cancel() != 0) { + total_size += 2; + } + } + // int32 verbosity = 5; + if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (this_._internal_verbosity() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this_._internal_verbosity()); + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void WorkRequest::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + ::google::protobuf::Arena* arena = _this->GetArena(); + // @@protoc_insertion_point(class_specific_merge_from_start:blaze.worker.WorkRequest) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000003fU)) { + if (CheckHasBitForRepeated(cached_has_bits, 0x00000001U)) { + _this->_internal_mutable_arguments()->InternalMergeFromWithArena( + ::google::protobuf::MessageLite::internal_visibility(), arena, + from._internal_arguments()); + } + if (CheckHasBitForRepeated(cached_has_bits, 0x00000002U)) { + _this->_internal_mutable_inputs()->InternalMergeFromWithArena( + ::google::protobuf::MessageLite::internal_visibility(), arena, + from._internal_inputs()); + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (!from._internal_sandbox_dir().empty()) { + _this->_internal_set_sandbox_dir(from._internal_sandbox_dir()); + } else { + if (_this->_impl_.sandbox_dir_.IsDefault()) { + _this->_internal_set_sandbox_dir(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (from._internal_request_id() != 0) { + _this->_impl_.request_id_ = from._impl_.request_id_; + } + } + if (CheckHasBit(cached_has_bits, 0x00000010U)) { + if (from._internal_cancel() != 0) { + _this->_impl_.cancel_ = from._impl_.cancel_; + } + } + if (CheckHasBit(cached_has_bits, 0x00000020U)) { + if (from._internal_verbosity() != 0) { + _this->_impl_.verbosity_ = from._impl_.verbosity_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void WorkRequest::CopyFrom(const WorkRequest& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:blaze.worker.WorkRequest) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void WorkRequest::InternalSwap(WorkRequest* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + _impl_.arguments_.InternalSwap(&other->_impl_.arguments_); + _impl_.inputs_.InternalSwap(&other->_impl_.inputs_); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.sandbox_dir_, &other->_impl_.sandbox_dir_, arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_.verbosity_) + + sizeof(WorkRequest::_impl_.verbosity_) + - PROTOBUF_FIELD_OFFSET(WorkRequest, _impl_.request_id_)>( + reinterpret_cast(&_impl_.request_id_), + reinterpret_cast(&other->_impl_.request_id_)); +} + +::google::protobuf::Metadata WorkRequest::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// =================================================================== + +class WorkResponse::_Internal { + public: + using HasBits = + decltype(::std::declval()._impl_._has_bits_); + static constexpr ::int32_t kHasBitsOffset = + 8 * PROTOBUF_FIELD_OFFSET(WorkResponse, _impl_._has_bits_); +}; + +WorkResponse::WorkResponse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, WorkResponse_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + SharedCtor(arena); + // @@protoc_insertion_point(arena_constructor:blaze.worker.WorkResponse) +} +PROTOBUF_NDEBUG_INLINE WorkResponse::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + [[maybe_unused]] const ::blaze::worker::WorkResponse& from_msg) + : _has_bits_{from._has_bits_}, + _cached_size_{0}, + output_(arena, from.output_) {} + +WorkResponse::WorkResponse( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, + const WorkResponse& from) +#if defined(PROTOBUF_CUSTOM_VTABLE) + : ::google::protobuf::Message(arena, WorkResponse_class_data_.base()) { +#else // PROTOBUF_CUSTOM_VTABLE + : ::google::protobuf::Message(arena) { +#endif // PROTOBUF_CUSTOM_VTABLE + WorkResponse* const _this = this; + (void)_this; + _internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); + new (&_impl_) Impl_(internal_visibility(), arena, from._impl_, from); + ::memcpy(reinterpret_cast(&_impl_) + + offsetof(Impl_, exit_code_), + reinterpret_cast(&from._impl_) + + offsetof(Impl_, exit_code_), + offsetof(Impl_, was_cancelled_) - + offsetof(Impl_, exit_code_) + + sizeof(Impl_::was_cancelled_)); + + // @@protoc_insertion_point(copy_constructor:blaze.worker.WorkResponse) +} +PROTOBUF_NDEBUG_INLINE WorkResponse::Impl_::Impl_( + [[maybe_unused]] ::google::protobuf::internal::InternalVisibility visibility, + [[maybe_unused]] ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) + : _cached_size_{0}, + output_(arena) {} + +inline void WorkResponse::SharedCtor(::_pb::Arena* PROTOBUF_NULLABLE arena) { + new (&_impl_) Impl_(internal_visibility(), arena); + ::memset(reinterpret_cast(&_impl_) + + offsetof(Impl_, exit_code_), + 0, + offsetof(Impl_, was_cancelled_) - + offsetof(Impl_, exit_code_) + + sizeof(Impl_::was_cancelled_)); +} +WorkResponse::~WorkResponse() { + // @@protoc_insertion_point(destructor:blaze.worker.WorkResponse) + SharedDtor(*this); +} +inline void WorkResponse::SharedDtor(MessageLite& self) { + WorkResponse& this_ = static_cast(self); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + this_._internal_metadata_.Delete<::google::protobuf::UnknownFieldSet>(); + ABSL_DCHECK(this_.GetArena() == nullptr); + this_._impl_.output_.Destroy(); + this_._impl_.~Impl_(); +} + +inline void* PROTOBUF_NONNULL WorkResponse::PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena) { + return ::new (mem) WorkResponse(arena); +} +constexpr auto WorkResponse::InternalNewImpl_() { + return ::google::protobuf::internal::MessageCreator::CopyInit(sizeof(WorkResponse), + alignof(WorkResponse)); +} +constexpr auto WorkResponse::InternalGenerateClassData_() { + return ::google::protobuf::internal::ClassDataFull{ + ::google::protobuf::internal::ClassData{ + &_WorkResponse_default_instance_._instance, + &_table_.header, + nullptr, // IsInitialized + &WorkResponse::MergeImpl, + ::google::protobuf::Message::GetNewImpl(), +#if defined(PROTOBUF_CUSTOM_VTABLE) + &WorkResponse::SharedDtor, + ::google::protobuf::Message::GetClearImpl(), &WorkResponse::ByteSizeLong, + &WorkResponse::_InternalSerialize, +#endif // PROTOBUF_CUSTOM_VTABLE + PROTOBUF_FIELD_OFFSET(WorkResponse, _impl_._cached_size_), + false, + }, + &WorkResponse::kDescriptorMethods, + &descriptor_table_worker_5fprotocol_2eproto, + nullptr, // tracker + }; +} + +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 const + ::google::protobuf::internal::ClassDataFull WorkResponse_class_data_ = + WorkResponse::InternalGenerateClassData_(); + +PROTOBUF_ATTRIBUTE_WEAK const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL +WorkResponse::GetClassData() const { + ::google::protobuf::internal::PrefetchToLocalCache(&WorkResponse_class_data_); + ::google::protobuf::internal::PrefetchToLocalCache(WorkResponse_class_data_.tc_table); + return WorkResponse_class_data_.base(); +} +PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 +const ::_pbi::TcParseTable<2, 4, 0, 40, 2> +WorkResponse::_table_ = { + { + PROTOBUF_FIELD_OFFSET(WorkResponse, _impl_._has_bits_), + 0, // no _extensions_ + 4, 24, // max_field_number, fast_idx_mask + offsetof(decltype(_table_), field_lookup_table), + 4294967280, // skipmap + offsetof(decltype(_table_), field_entries), + 4, // num_field_entries + 0, // num_aux_entries + offsetof(decltype(_table_), field_names), // no aux_entries + WorkResponse_class_data_.base(), + nullptr, // post_loop_handler + ::_pbi::TcParser::GenericFallback, // fallback + #ifdef PROTOBUF_PREFETCH_PARSE_TABLE + ::_pbi::TcParser::GetTable<::blaze::worker::WorkResponse>(), // to_prefetch + #endif // PROTOBUF_PREFETCH_PARSE_TABLE + }, {{ + // bool was_cancelled = 4; + {::_pbi::TcParser::SingularVarintNoZag1(), + {32, 3, 0, + PROTOBUF_FIELD_OFFSET(WorkResponse, _impl_.was_cancelled_)}}, + // int32 exit_code = 1; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(WorkResponse, _impl_.exit_code_), 1>(), + {8, 1, 0, + PROTOBUF_FIELD_OFFSET(WorkResponse, _impl_.exit_code_)}}, + // string output = 2; + {::_pbi::TcParser::FastUS1, + {18, 0, 0, + PROTOBUF_FIELD_OFFSET(WorkResponse, _impl_.output_)}}, + // int32 request_id = 3; + {::_pbi::TcParser::SingularVarintNoZag1<::uint32_t, offsetof(WorkResponse, _impl_.request_id_), 2>(), + {24, 2, 0, + PROTOBUF_FIELD_OFFSET(WorkResponse, _impl_.request_id_)}}, + }}, {{ + 65535, 65535 + }}, {{ + // int32 exit_code = 1; + {PROTOBUF_FIELD_OFFSET(WorkResponse, _impl_.exit_code_), _Internal::kHasBitsOffset + 1, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, + // string output = 2; + {PROTOBUF_FIELD_OFFSET(WorkResponse, _impl_.output_), _Internal::kHasBitsOffset + 0, 0, (0 | ::_fl::kFcOptional | ::_fl::kUtf8String | ::_fl::kRepAString)}, + // int32 request_id = 3; + {PROTOBUF_FIELD_OFFSET(WorkResponse, _impl_.request_id_), _Internal::kHasBitsOffset + 2, 0, (0 | ::_fl::kFcOptional | ::_fl::kInt32)}, + // bool was_cancelled = 4; + {PROTOBUF_FIELD_OFFSET(WorkResponse, _impl_.was_cancelled_), _Internal::kHasBitsOffset + 3, 0, (0 | ::_fl::kFcOptional | ::_fl::kBool)}, + }}, + // no aux_entries + {{ + "\31\0\6\0\0\0\0\0" + "blaze.worker.WorkResponse" + "output" + }}, +}; +PROTOBUF_NOINLINE void WorkResponse::Clear() { +// @@protoc_insertion_point(message_clear_start:blaze.worker.WorkResponse) + ::google::protobuf::internal::TSanWrite(&_impl_); + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void) cached_has_bits; + + cached_has_bits = _impl_._has_bits_[0]; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + _impl_.output_.ClearNonDefaultToEmpty(); + } + if (BatchCheckHasBit(cached_has_bits, 0x0000000eU)) { + ::memset(&_impl_.exit_code_, 0, static_cast<::size_t>( + reinterpret_cast(&_impl_.was_cancelled_) - + reinterpret_cast(&_impl_.exit_code_)) + sizeof(_impl_.was_cancelled_)); + } + _impl_._has_bits_.Clear(); + _internal_metadata_.Clear<::google::protobuf::UnknownFieldSet>(); +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::uint8_t* PROTOBUF_NONNULL WorkResponse::_InternalSerialize( + const ::google::protobuf::MessageLite& base, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) { + const WorkResponse& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::uint8_t* PROTOBUF_NONNULL WorkResponse::_InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + const WorkResponse& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + this_.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(serialize_to_array_start:blaze.worker.WorkResponse) + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = this_._impl_._has_bits_[0]; + // int32 exit_code = 1; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_exit_code() != 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteInt32ToArrayWithField<1>( + stream, this_._internal_exit_code(), target); + } + } + + // string output = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_output().empty()) { + const ::std::string& _s = this_._internal_output(); + ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( + _s.data(), static_cast(_s.length()), ::google::protobuf::internal::WireFormatLite::SERIALIZE, "blaze.worker.WorkResponse.output"); + target = stream->WriteStringMaybeAliased(2, _s, target); + } + } + + // int32 request_id = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_request_id() != 0) { + target = + ::google::protobuf::internal::WireFormatLite::WriteInt32ToArrayWithField<3>( + stream, this_._internal_request_id(), target); + } + } + + // bool was_cancelled = 4; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_was_cancelled() != 0) { + target = stream->EnsureSpace(target); + target = ::_pbi::WireFormatLite::WriteBoolToArray( + 4, this_._internal_was_cancelled(), target); + } + } + + if (ABSL_PREDICT_FALSE(this_._internal_metadata_.have_unknown_fields())) { + target = + ::_pbi::WireFormat::InternalSerializeUnknownFieldsToArray( + this_._internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance), target, stream); + } + // @@protoc_insertion_point(serialize_to_array_end:blaze.worker.WorkResponse) + return target; +} + +#if defined(PROTOBUF_CUSTOM_VTABLE) +::size_t WorkResponse::ByteSizeLong(const MessageLite& base) { + const WorkResponse& this_ = static_cast(base); +#else // PROTOBUF_CUSTOM_VTABLE +::size_t WorkResponse::ByteSizeLong() const { + const WorkResponse& this_ = *this; +#endif // PROTOBUF_CUSTOM_VTABLE + // @@protoc_insertion_point(message_byte_size_start:blaze.worker.WorkResponse) + ::size_t total_size = 0; + + ::uint32_t cached_has_bits = 0; + // Prevent compiler warnings about cached_has_bits being unused + (void)cached_has_bits; + + ::_pbi::Prefetch5LinesFrom7Lines(&this_); + cached_has_bits = this_._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000000fU)) { + // string output = 2; + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!this_._internal_output().empty()) { + total_size += 1 + ::google::protobuf::internal::WireFormatLite::StringSize( + this_._internal_output()); + } + } + // int32 exit_code = 1; + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (this_._internal_exit_code() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this_._internal_exit_code()); + } + } + // int32 request_id = 3; + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (this_._internal_request_id() != 0) { + total_size += ::_pbi::WireFormatLite::Int32SizePlusOne( + this_._internal_request_id()); + } + } + // bool was_cancelled = 4; + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (this_._internal_was_cancelled() != 0) { + total_size += 2; + } + } + } + return this_.MaybeComputeUnknownFieldsSize(total_size, + &this_._impl_._cached_size_); +} + +void WorkResponse::MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg) { + auto* const _this = + static_cast(&to_msg); + auto& from = static_cast(from_msg); + if constexpr (::_pbi::DebugHardenCheckHasBitConsistency()) { + from.CheckHasBitConsistency(); + } + // @@protoc_insertion_point(class_specific_merge_from_start:blaze.worker.WorkResponse) + ABSL_DCHECK_NE(&from, _this); + ::uint32_t cached_has_bits = 0; + (void)cached_has_bits; + + cached_has_bits = from._impl_._has_bits_[0]; + if (BatchCheckHasBit(cached_has_bits, 0x0000000fU)) { + if (CheckHasBit(cached_has_bits, 0x00000001U)) { + if (!from._internal_output().empty()) { + _this->_internal_set_output(from._internal_output()); + } else { + if (_this->_impl_.output_.IsDefault()) { + _this->_internal_set_output(""); + } + } + } + if (CheckHasBit(cached_has_bits, 0x00000002U)) { + if (from._internal_exit_code() != 0) { + _this->_impl_.exit_code_ = from._impl_.exit_code_; + } + } + if (CheckHasBit(cached_has_bits, 0x00000004U)) { + if (from._internal_request_id() != 0) { + _this->_impl_.request_id_ = from._impl_.request_id_; + } + } + if (CheckHasBit(cached_has_bits, 0x00000008U)) { + if (from._internal_was_cancelled() != 0) { + _this->_impl_.was_cancelled_ = from._impl_.was_cancelled_; + } + } + } + _this->_impl_._has_bits_[0] |= cached_has_bits; + _this->_internal_metadata_.MergeFrom<::google::protobuf::UnknownFieldSet>( + from._internal_metadata_); +} + +void WorkResponse::CopyFrom(const WorkResponse& from) { + // @@protoc_insertion_point(class_specific_copy_from_start:blaze.worker.WorkResponse) + if (&from == this) return; + Clear(); + MergeFrom(from); +} + + +void WorkResponse::InternalSwap(WorkResponse* PROTOBUF_RESTRICT PROTOBUF_NONNULL other) { + using ::std::swap; + auto* arena = GetArena(); + ABSL_DCHECK_EQ(arena, other->GetArena()); + _internal_metadata_.InternalSwap(&other->_internal_metadata_); + swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]); + ::_pbi::ArenaStringPtr::InternalSwap(&_impl_.output_, &other->_impl_.output_, arena); + ::google::protobuf::internal::memswap< + PROTOBUF_FIELD_OFFSET(WorkResponse, _impl_.was_cancelled_) + + sizeof(WorkResponse::_impl_.was_cancelled_) + - PROTOBUF_FIELD_OFFSET(WorkResponse, _impl_.exit_code_)>( + reinterpret_cast(&_impl_.exit_code_), + reinterpret_cast(&other->_impl_.exit_code_)); +} + +::google::protobuf::Metadata WorkResponse::GetMetadata() const { + return ::google::protobuf::Message::GetMetadataImpl(GetClassData()->full()); +} +// @@protoc_insertion_point(namespace_scope) +} // namespace worker +} // namespace blaze +namespace google { +namespace protobuf { +} // namespace protobuf +} // namespace google +// @@protoc_insertion_point(global_scope) +PROTOBUF_ATTRIBUTE_INIT_PRIORITY2 static ::std::false_type + _static_init2_ [[maybe_unused]] = + (::_pbi::AddDescriptors(&descriptor_table_worker_5fprotocol_2eproto), + ::std::false_type{}); +#include "google/protobuf/port_undef.inc" diff --git a/tools/worker/worker_protocol.pb.h b/tools/worker/worker_protocol.pb.h new file mode 100644 index 000000000..5b35d25c7 --- /dev/null +++ b/tools/worker/worker_protocol.pb.h @@ -0,0 +1,1401 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: worker_protocol.proto +// Protobuf C++ Version: 7.34.0 + +#ifndef worker_5fprotocol_2eproto_2epb_2eh +#define worker_5fprotocol_2eproto_2epb_2eh + +#include +#include +#include +#include + +// clang-format off +#include "google/protobuf/runtime_version.h" +#if PROTOBUF_VERSION != 7034000 +#error "Protobuf C++ gencode is built with an incompatible version of" +#error "Protobuf C++ headers/runtime. See" +#error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp" +#endif +#include "google/protobuf/io/coded_stream.h" +#include "google/protobuf/arena.h" +#include "google/protobuf/arenastring.h" +#include "google/protobuf/generated_message_tctable_decl.h" +#include "google/protobuf/generated_message_util.h" +#include "google/protobuf/metadata_lite.h" +#include "google/protobuf/generated_message_reflection.h" +#include "google/protobuf/message.h" +#include "google/protobuf/message_lite.h" +#include "google/protobuf/repeated_field.h" // IWYU pragma: export +#include "google/protobuf/extension_set.h" // IWYU pragma: export +#include "google/protobuf/unknown_field_set.h" +// @@protoc_insertion_point(includes) + +// Must be included last. +#include "google/protobuf/port_def.inc" + +#define PROTOBUF_INTERNAL_EXPORT_worker_5fprotocol_2eproto + +namespace google { +namespace protobuf { +namespace internal { +template +::absl::string_view GetAnyMessageName(); +} // namespace internal +} // namespace protobuf +} // namespace google + +// Internal implementation detail -- do not use these members. +struct TableStruct_worker_5fprotocol_2eproto { + static const ::uint32_t offsets[]; +}; +extern "C" { +extern const ::google::protobuf::internal::DescriptorTable descriptor_table_worker_5fprotocol_2eproto; +} // extern "C" +namespace blaze { +namespace worker { +class Input; +struct InputDefaultTypeInternal; +extern InputDefaultTypeInternal _Input_default_instance_; +extern const ::google::protobuf::internal::ClassDataFull Input_class_data_; +class WorkRequest; +struct WorkRequestDefaultTypeInternal; +extern WorkRequestDefaultTypeInternal _WorkRequest_default_instance_; +extern const ::google::protobuf::internal::ClassDataFull WorkRequest_class_data_; +class WorkResponse; +struct WorkResponseDefaultTypeInternal; +extern WorkResponseDefaultTypeInternal _WorkResponse_default_instance_; +extern const ::google::protobuf::internal::ClassDataFull WorkResponse_class_data_; +} // namespace worker +} // namespace blaze +namespace google { +namespace protobuf { +} // namespace protobuf +} // namespace google + +namespace blaze { +namespace worker { + +// =================================================================== + + +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED WorkResponse final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:blaze.worker.WorkResponse) */ { + public: + inline WorkResponse() : WorkResponse(nullptr) {} + ~WorkResponse() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(WorkResponse* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(WorkResponse)); + } +#endif + + template + explicit constexpr WorkResponse(::google::protobuf::internal::ConstantInitialized); + + inline WorkResponse(const WorkResponse& from) : WorkResponse(nullptr, from) {} + inline WorkResponse(WorkResponse&& from) noexcept + : WorkResponse(nullptr, ::std::move(from)) {} + inline WorkResponse& operator=(const WorkResponse& from) { + CopyFrom(from); + return *this; + } + inline WorkResponse& operator=(WorkResponse&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const WorkResponse& default_instance() { + return *reinterpret_cast( + &_WorkResponse_default_instance_); + } + static constexpr int kIndexInFileMessages = 2; + friend void swap(WorkResponse& a, WorkResponse& b) { a.Swap(&b); } + inline void Swap(WorkResponse* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(WorkResponse* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] WorkResponse* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const WorkResponse& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const WorkResponse& from) { WorkResponse::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(WorkResponse* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "blaze.worker.WorkResponse"; } + + explicit WorkResponse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + WorkResponse(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const WorkResponse& from); + WorkResponse( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, WorkResponse&& from) noexcept + : WorkResponse(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kOutputFieldNumber = 2, + kExitCodeFieldNumber = 1, + kRequestIdFieldNumber = 3, + kWasCancelledFieldNumber = 4, + }; + // string output = 2; + void clear_output() ; + [[nodiscard]] const ::std::string& output() const; + template + void set_output(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_output(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_output(); + void set_allocated_output(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_output() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_output(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_output(); + + public: + // int32 exit_code = 1; + void clear_exit_code() ; + [[nodiscard]] ::int32_t exit_code() const; + void set_exit_code(::int32_t value); + + private: + ::int32_t _internal_exit_code() const; + void _internal_set_exit_code(::int32_t value); + + public: + // int32 request_id = 3; + void clear_request_id() ; + [[nodiscard]] ::int32_t request_id() const; + void set_request_id(::int32_t value); + + private: + ::int32_t _internal_request_id() const; + void _internal_set_request_id(::int32_t value); + + public: + // bool was_cancelled = 4; + void clear_was_cancelled() ; + [[nodiscard]] bool was_cancelled() const; + void set_was_cancelled(bool value); + + private: + bool _internal_was_cancelled() const; + void _internal_set_was_cancelled(bool value); + + public: + // @@protoc_insertion_point(class_scope:blaze.worker.WorkResponse) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<2, 4, + 0, 40, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const WorkResponse& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr output_; + ::int32_t exit_code_; + ::int32_t request_id_; + bool was_cancelled_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_worker_5fprotocol_2eproto; +}; + +extern const ::google::protobuf::internal::ClassDataFull WorkResponse_class_data_; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED Input final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:blaze.worker.Input) */ { + public: + inline Input() : Input(nullptr) {} + ~Input() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(Input* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(Input)); + } +#endif + + template + explicit constexpr Input(::google::protobuf::internal::ConstantInitialized); + + inline Input(const Input& from) : Input(nullptr, from) {} + inline Input(Input&& from) noexcept + : Input(nullptr, ::std::move(from)) {} + inline Input& operator=(const Input& from) { + CopyFrom(from); + return *this; + } + inline Input& operator=(Input&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const Input& default_instance() { + return *reinterpret_cast( + &_Input_default_instance_); + } + static constexpr int kIndexInFileMessages = 0; + friend void swap(Input& a, Input& b) { a.Swap(&b); } + inline void Swap(Input* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(Input* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] Input* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const Input& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const Input& from) { Input::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(Input* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "blaze.worker.Input"; } + + explicit Input(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + Input(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Input& from); + Input( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, Input&& from) noexcept + : Input(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kPathFieldNumber = 1, + kDigestFieldNumber = 2, + }; + // string path = 1; + void clear_path() ; + [[nodiscard]] const ::std::string& path() const; + template + void set_path(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_path(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_path(); + void set_allocated_path(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_path() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_path(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_path(); + + public: + // bytes digest = 2; + void clear_digest() ; + [[nodiscard]] const ::std::string& digest() const; + template + void set_digest(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_digest(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_digest(); + void set_allocated_digest(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_digest() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_digest(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_digest(); + + public: + // @@protoc_insertion_point(class_scope:blaze.worker.Input) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<1, 2, + 0, 31, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const Input& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::internal::ArenaStringPtr path_; + ::google::protobuf::internal::ArenaStringPtr digest_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_worker_5fprotocol_2eproto; +}; + +extern const ::google::protobuf::internal::ClassDataFull Input_class_data_; +// ------------------------------------------------------------------- + +class PROTOBUF_FUTURE_ADD_EARLY_WARN_UNUSED WorkRequest final : public ::google::protobuf::Message +/* @@protoc_insertion_point(class_definition:blaze.worker.WorkRequest) */ { + public: + inline WorkRequest() : WorkRequest(nullptr) {} + ~WorkRequest() PROTOBUF_FINAL; + +#if defined(PROTOBUF_CUSTOM_VTABLE) + void operator delete(WorkRequest* PROTOBUF_NONNULL msg, ::std::destroying_delete_t) { + SharedDtor(*msg); + ::google::protobuf::internal::SizedDelete(msg, sizeof(WorkRequest)); + } +#endif + + template + explicit constexpr WorkRequest(::google::protobuf::internal::ConstantInitialized); + + inline WorkRequest(const WorkRequest& from) : WorkRequest(nullptr, from) {} + inline WorkRequest(WorkRequest&& from) noexcept + : WorkRequest(nullptr, ::std::move(from)) {} + inline WorkRequest& operator=(const WorkRequest& from) { + CopyFrom(from); + return *this; + } + inline WorkRequest& operator=(WorkRequest&& from) noexcept { + if (this == &from) return *this; + if (::google::protobuf::internal::CanMoveWithInternalSwap(GetArena(), from.GetArena())) { + InternalSwap(&from); + } else { + CopyFrom(from); + } + return *this; + } + + [[nodiscard]] inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.unknown_fields<::google::protobuf::UnknownFieldSet>(::google::protobuf::UnknownFieldSet::default_instance); + } + [[nodiscard]] inline ::google::protobuf::UnknownFieldSet* PROTOBUF_NONNULL + mutable_unknown_fields() ABSL_ATTRIBUTE_LIFETIME_BOUND { + return _internal_metadata_.mutable_unknown_fields<::google::protobuf::UnknownFieldSet>(); + } + + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL descriptor() { + return GetDescriptor(); + } + [[nodiscard]] static const ::google::protobuf::Descriptor* PROTOBUF_NONNULL + GetDescriptor() { + return default_instance().GetMetadata().descriptor; + } + [[nodiscard]] static const ::google::protobuf::Reflection* PROTOBUF_NONNULL GetReflection() { + return default_instance().GetMetadata().reflection; + } + [[nodiscard]] static const WorkRequest& default_instance() { + return *reinterpret_cast( + &_WorkRequest_default_instance_); + } + static constexpr int kIndexInFileMessages = 1; + friend void swap(WorkRequest& a, WorkRequest& b) { a.Swap(&b); } + inline void Swap(WorkRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + if (::google::protobuf::internal::CanUseInternalSwap(GetArena(), other->GetArena())) { + InternalSwap(other); + } else { + ::google::protobuf::internal::GenericSwap(this, other); + } + } + void UnsafeArenaSwap(WorkRequest* PROTOBUF_NONNULL other) { + if (other == this) return; + ABSL_DCHECK(GetArena() == other->GetArena()); + InternalSwap(other); + } + + // implements Message ---------------------------------------------- + + [[nodiscard]] WorkRequest* PROTOBUF_NONNULL + New(::google::protobuf::Arena* PROTOBUF_NULLABLE arena = nullptr) const { + return ::google::protobuf::Message::DefaultConstruct(arena); + } + using ::google::protobuf::Message::CopyFrom; + void CopyFrom(const WorkRequest& from); + using ::google::protobuf::Message::MergeFrom; + void MergeFrom(const WorkRequest& from) { WorkRequest::MergeImpl(*this, from); } + + private: + static void MergeImpl(::google::protobuf::MessageLite& to_msg, + const ::google::protobuf::MessageLite& from_msg); + + public: + [[nodiscard]] bool IsInitialized() const { + return true; + } + ABSL_ATTRIBUTE_REINITIALIZES void Clear() PROTOBUF_FINAL; + #if defined(PROTOBUF_CUSTOM_VTABLE) + private: + [[nodiscard]] static ::size_t ByteSizeLong(const ::google::protobuf::MessageLite& msg); + [[nodiscard]] static ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + const ::google::protobuf::MessageLite& msg, ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream); + + public: + [[nodiscard]] ::size_t ByteSizeLong() const { return ByteSizeLong(*this); } + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const { + return _InternalSerialize(*this, target, stream); + } + #else // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] ::size_t ByteSizeLong() const final; + [[nodiscard]] ::uint8_t* PROTOBUF_NONNULL _InternalSerialize( + ::uint8_t* PROTOBUF_NONNULL target, + ::google::protobuf::io::EpsCopyOutputStream* PROTOBUF_NONNULL stream) const final; + #endif // PROTOBUF_CUSTOM_VTABLE + [[nodiscard]] int GetCachedSize() const { + return _impl_._cached_size_.Get(); + } + + private: + void SharedCtor(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static void SharedDtor(MessageLite& self); + void InternalSwap(WorkRequest* PROTOBUF_NONNULL other); + private: + template + friend ::absl::string_view(::google::protobuf::internal::GetAnyMessageName)(); + static ::absl::string_view FullMessageName() { return "blaze.worker.WorkRequest"; } + + explicit WorkRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + WorkRequest(::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const WorkRequest& from); + WorkRequest( + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, WorkRequest&& from) noexcept + : WorkRequest(arena) { + *this = ::std::move(from); + } + const ::google::protobuf::internal::ClassData* PROTOBUF_NONNULL GetClassData() const PROTOBUF_FINAL; + static void* PROTOBUF_NONNULL PlacementNew_( + const void* PROTOBUF_NONNULL, void* PROTOBUF_NONNULL mem, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + static constexpr auto InternalNewImpl_(); + + public: + static constexpr auto InternalGenerateClassData_(); + + [[nodiscard]] ::google::protobuf::Metadata GetMetadata() const; + // nested types ---------------------------------------------------- + + // accessors ------------------------------------------------------- + enum : int { + kArgumentsFieldNumber = 1, + kInputsFieldNumber = 2, + kSandboxDirFieldNumber = 6, + kRequestIdFieldNumber = 3, + kCancelFieldNumber = 4, + kVerbosityFieldNumber = 5, + }; + // repeated string arguments = 1; + [[nodiscard]] int arguments_size() + const; + private: + int _internal_arguments_size() const; + + public: + void clear_arguments() ; + [[nodiscard]] const ::std::string& arguments(int index) const; + ::std::string* PROTOBUF_NONNULL mutable_arguments(int index); + template + void set_arguments(int index, Arg_&& value, Args_... args); + ::std::string* PROTOBUF_NONNULL add_arguments(); + template + void add_arguments(Arg_&& value, Args_... args); + [[nodiscard]] const ::google::protobuf::RepeatedPtrField<::std::string>& + arguments() const; + [[nodiscard]] ::google::protobuf::RepeatedPtrField<::std::string>* PROTOBUF_NONNULL + mutable_arguments(); + + private: + const ::google::protobuf::RepeatedPtrField<::std::string>& _internal_arguments() const; + ::google::protobuf::RepeatedPtrField<::std::string>* PROTOBUF_NONNULL _internal_mutable_arguments(); + + public: + // repeated .blaze.worker.Input inputs = 2; + [[nodiscard]] int inputs_size() + const; + private: + int _internal_inputs_size() const; + + public: + void clear_inputs() ; + [[nodiscard]] ::blaze::worker::Input* PROTOBUF_NONNULL mutable_inputs(int index); + [[nodiscard]] ::google::protobuf::RepeatedPtrField<::blaze::worker::Input>* PROTOBUF_NONNULL + mutable_inputs(); + + private: + const ::google::protobuf::RepeatedPtrField<::blaze::worker::Input>& _internal_inputs() const; + ::google::protobuf::RepeatedPtrField<::blaze::worker::Input>* PROTOBUF_NONNULL _internal_mutable_inputs(); + public: + [[nodiscard]] const ::blaze::worker::Input& inputs(int index) const; + ::blaze::worker::Input* PROTOBUF_NONNULL add_inputs(); + [[nodiscard]] const ::google::protobuf::RepeatedPtrField<::blaze::worker::Input>& inputs() + const; + // string sandbox_dir = 6; + void clear_sandbox_dir() ; + [[nodiscard]] const ::std::string& sandbox_dir() const; + template + void set_sandbox_dir(Arg_&& arg, Args_... args); + ::std::string* PROTOBUF_NONNULL mutable_sandbox_dir(); + [[nodiscard]] ::std::string* PROTOBUF_NULLABLE release_sandbox_dir(); + void set_allocated_sandbox_dir(::std::string* PROTOBUF_NULLABLE value); + + private: + const ::std::string& _internal_sandbox_dir() const; + PROTOBUF_ALWAYS_INLINE void _internal_set_sandbox_dir(const ::std::string& value); + ::std::string* PROTOBUF_NONNULL _internal_mutable_sandbox_dir(); + + public: + // int32 request_id = 3; + void clear_request_id() ; + [[nodiscard]] ::int32_t request_id() const; + void set_request_id(::int32_t value); + + private: + ::int32_t _internal_request_id() const; + void _internal_set_request_id(::int32_t value); + + public: + // bool cancel = 4; + void clear_cancel() ; + [[nodiscard]] bool cancel() const; + void set_cancel(bool value); + + private: + bool _internal_cancel() const; + void _internal_set_cancel(bool value); + + public: + // int32 verbosity = 5; + void clear_verbosity() ; + [[nodiscard]] ::int32_t verbosity() const; + void set_verbosity(::int32_t value); + + private: + ::int32_t _internal_verbosity() const; + void _internal_set_verbosity(::int32_t value); + + public: + // @@protoc_insertion_point(class_scope:blaze.worker.WorkRequest) + private: + class _Internal; + friend class ::google::protobuf::internal::TcParser; + static const ::google::protobuf::internal::TcParseTable<3, 6, + 1, 53, + 2> + _table_; + + friend class ::google::protobuf::MessageLite; + friend class ::google::protobuf::Arena; + friend ::google::protobuf::internal::PrivateAccess; + template + friend class ::google::protobuf::Arena::InternalHelper; + using InternalArenaConstructable_ = void; + using DestructorSkippable_ = void; + struct Impl_ { + inline explicit constexpr Impl_(::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::internal::ConstantInitialized) noexcept; + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena); + inline explicit Impl_( + ::google::protobuf::internal::InternalVisibility visibility, + ::google::protobuf::Arena* PROTOBUF_NULLABLE arena, const Impl_& from, + const WorkRequest& from_msg); + ::google::protobuf::internal::HasBits<1> _has_bits_; + ::google::protobuf::internal::CachedSize _cached_size_; + ::google::protobuf::RepeatedPtrField<::std::string> arguments_; + ::google::protobuf::RepeatedPtrField< ::blaze::worker::Input > inputs_; + ::google::protobuf::internal::ArenaStringPtr sandbox_dir_; + ::int32_t request_id_; + bool cancel_; + ::int32_t verbosity_; + PROTOBUF_TSAN_DECLARE_MEMBER + }; + union { Impl_ _impl_; }; + friend struct ::TableStruct_worker_5fprotocol_2eproto; +}; + +extern const ::google::protobuf::internal::ClassDataFull WorkRequest_class_data_; + +// =================================================================== + + + + +// =================================================================== + + +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" +#endif // __GNUC__ +// ------------------------------------------------------------------- + +// Input + +// string path = 1; +inline void Input::clear_path() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.path_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline const ::std::string& Input::path() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:blaze.worker.Input.path) + return _internal_path(); +} +template +PROTOBUF_ALWAYS_INLINE void Input::set_path(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.path_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:blaze.worker.Input.path) +} +inline ::std::string* PROTOBUF_NONNULL Input::mutable_path() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_path(); + // @@protoc_insertion_point(field_mutable:blaze.worker.Input.path) + return _s; +} +inline const ::std::string& Input::_internal_path() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.path_.Get(); +} +inline void Input::_internal_set_path(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.path_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL Input::_internal_mutable_path() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.path_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE Input::release_path() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:blaze.worker.Input.path) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.path_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.path_.Set("", GetArena()); + } + return released; +} +inline void Input::set_allocated_path(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.path_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.path_.IsDefault()) { + _impl_.path_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:blaze.worker.Input.path) +} + +// bytes digest = 2; +inline void Input::clear_digest() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.digest_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline const ::std::string& Input::digest() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:blaze.worker.Input.digest) + return _internal_digest(); +} +template +PROTOBUF_ALWAYS_INLINE void Input::set_digest(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + _impl_.digest_.SetBytes(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:blaze.worker.Input.digest) +} +inline ::std::string* PROTOBUF_NONNULL Input::mutable_digest() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + ::std::string* _s = _internal_mutable_digest(); + // @@protoc_insertion_point(field_mutable:blaze.worker.Input.digest) + return _s; +} +inline const ::std::string& Input::_internal_digest() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.digest_.Get(); +} +inline void Input::_internal_set_digest(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.digest_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL Input::_internal_mutable_digest() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.digest_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE Input::release_digest() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:blaze.worker.Input.digest) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000002U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + auto* released = _impl_.digest_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.digest_.Set("", GetArena()); + } + return released; +} +inline void Input::set_allocated_digest(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000002U); + } + _impl_.digest_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.digest_.IsDefault()) { + _impl_.digest_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:blaze.worker.Input.digest) +} + +// ------------------------------------------------------------------- + +// WorkRequest + +// repeated string arguments = 1; +inline int WorkRequest::_internal_arguments_size() const { + return _internal_arguments().size(); +} +inline int WorkRequest::arguments_size() const { + return _internal_arguments_size(); +} +inline void WorkRequest::clear_arguments() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.arguments_.Clear(); + ClearHasBitForRepeated(_impl_._has_bits_[0], + 0x00000001U); +} +inline ::std::string* PROTOBUF_NONNULL WorkRequest::add_arguments() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::std::string* _s = + _internal_mutable_arguments()->InternalAddWithArena( + ::google::protobuf::MessageLite::internal_visibility(), GetArena()); + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_add_mutable:blaze.worker.WorkRequest.arguments) + return _s; +} +inline const ::std::string& WorkRequest::arguments(int index) const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:blaze.worker.WorkRequest.arguments) + return _internal_arguments().Get(index); +} +inline ::std::string* PROTOBUF_NONNULL WorkRequest::mutable_arguments(int index) + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable:blaze.worker.WorkRequest.arguments) + return _internal_mutable_arguments()->Mutable(index); +} +template +inline void WorkRequest::set_arguments(int index, Arg_&& value, Args_... args) { + ::google::protobuf::internal::AssignToString(*_internal_mutable_arguments()->Mutable(index), ::std::forward(value), + args... ); + // @@protoc_insertion_point(field_set:blaze.worker.WorkRequest.arguments) +} +template +inline void WorkRequest::add_arguments(Arg_&& value, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::google::protobuf::internal::AddToRepeatedPtrField( + ::google::protobuf::MessageLite::internal_visibility(), GetArena(), + *_internal_mutable_arguments(), ::std::forward(value), + args... ); + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_add:blaze.worker.WorkRequest.arguments) +} +inline const ::google::protobuf::RepeatedPtrField<::std::string>& WorkRequest::arguments() + const ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:blaze.worker.WorkRequest.arguments) + return _internal_arguments(); +} +inline ::google::protobuf::RepeatedPtrField<::std::string>* PROTOBUF_NONNULL +WorkRequest::mutable_arguments() ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000001U); + // @@protoc_insertion_point(field_mutable_list:blaze.worker.WorkRequest.arguments) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_arguments(); +} +inline const ::google::protobuf::RepeatedPtrField<::std::string>& +WorkRequest::_internal_arguments() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.arguments_; +} +inline ::google::protobuf::RepeatedPtrField<::std::string>* PROTOBUF_NONNULL +WorkRequest::_internal_mutable_arguments() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.arguments_; +} + +// repeated .blaze.worker.Input inputs = 2; +inline int WorkRequest::_internal_inputs_size() const { + return _internal_inputs().size(); +} +inline int WorkRequest::inputs_size() const { + return _internal_inputs_size(); +} +inline void WorkRequest::clear_inputs() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.inputs_.Clear(); + ClearHasBitForRepeated(_impl_._has_bits_[0], + 0x00000002U); +} +inline ::blaze::worker::Input* PROTOBUF_NONNULL WorkRequest::mutable_inputs(int index) + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_mutable:blaze.worker.WorkRequest.inputs) + return _internal_mutable_inputs()->Mutable(index); +} +inline ::google::protobuf::RepeatedPtrField<::blaze::worker::Input>* PROTOBUF_NONNULL WorkRequest::mutable_inputs() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_mutable_list:blaze.worker.WorkRequest.inputs) + ::google::protobuf::internal::TSanWrite(&_impl_); + return _internal_mutable_inputs(); +} +inline const ::blaze::worker::Input& WorkRequest::inputs(int index) const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:blaze.worker.WorkRequest.inputs) + return _internal_inputs().Get(index); +} +inline ::blaze::worker::Input* PROTOBUF_NONNULL WorkRequest::add_inputs() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + ::google::protobuf::internal::TSanWrite(&_impl_); + ::blaze::worker::Input* _add = + _internal_mutable_inputs()->InternalAddWithArena( + ::google::protobuf::MessageLite::internal_visibility(), GetArena()); + SetHasBitForRepeated(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_add:blaze.worker.WorkRequest.inputs) + return _add; +} +inline const ::google::protobuf::RepeatedPtrField<::blaze::worker::Input>& WorkRequest::inputs() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_list:blaze.worker.WorkRequest.inputs) + return _internal_inputs(); +} +inline const ::google::protobuf::RepeatedPtrField<::blaze::worker::Input>& +WorkRequest::_internal_inputs() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.inputs_; +} +inline ::google::protobuf::RepeatedPtrField<::blaze::worker::Input>* PROTOBUF_NONNULL +WorkRequest::_internal_mutable_inputs() { + ::google::protobuf::internal::TSanRead(&_impl_); + return &_impl_.inputs_; +} + +// int32 request_id = 3; +inline void WorkRequest::clear_request_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.request_id_ = 0; + ClearHasBit(_impl_._has_bits_[0], + 0x00000008U); +} +inline ::int32_t WorkRequest::request_id() const { + // @@protoc_insertion_point(field_get:blaze.worker.WorkRequest.request_id) + return _internal_request_id(); +} +inline void WorkRequest::set_request_id(::int32_t value) { + _internal_set_request_id(value); + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + // @@protoc_insertion_point(field_set:blaze.worker.WorkRequest.request_id) +} +inline ::int32_t WorkRequest::_internal_request_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.request_id_; +} +inline void WorkRequest::_internal_set_request_id(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.request_id_ = value; +} + +// bool cancel = 4; +inline void WorkRequest::clear_cancel() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.cancel_ = false; + ClearHasBit(_impl_._has_bits_[0], + 0x00000010U); +} +inline bool WorkRequest::cancel() const { + // @@protoc_insertion_point(field_get:blaze.worker.WorkRequest.cancel) + return _internal_cancel(); +} +inline void WorkRequest::set_cancel(bool value) { + _internal_set_cancel(value); + SetHasBit(_impl_._has_bits_[0], 0x00000010U); + // @@protoc_insertion_point(field_set:blaze.worker.WorkRequest.cancel) +} +inline bool WorkRequest::_internal_cancel() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.cancel_; +} +inline void WorkRequest::_internal_set_cancel(bool value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.cancel_ = value; +} + +// int32 verbosity = 5; +inline void WorkRequest::clear_verbosity() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.verbosity_ = 0; + ClearHasBit(_impl_._has_bits_[0], + 0x00000020U); +} +inline ::int32_t WorkRequest::verbosity() const { + // @@protoc_insertion_point(field_get:blaze.worker.WorkRequest.verbosity) + return _internal_verbosity(); +} +inline void WorkRequest::set_verbosity(::int32_t value) { + _internal_set_verbosity(value); + SetHasBit(_impl_._has_bits_[0], 0x00000020U); + // @@protoc_insertion_point(field_set:blaze.worker.WorkRequest.verbosity) +} +inline ::int32_t WorkRequest::_internal_verbosity() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.verbosity_; +} +inline void WorkRequest::_internal_set_verbosity(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.verbosity_ = value; +} + +// string sandbox_dir = 6; +inline void WorkRequest::clear_sandbox_dir() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.sandbox_dir_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000004U); +} +inline const ::std::string& WorkRequest::sandbox_dir() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:blaze.worker.WorkRequest.sandbox_dir) + return _internal_sandbox_dir(); +} +template +PROTOBUF_ALWAYS_INLINE void WorkRequest::set_sandbox_dir(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + _impl_.sandbox_dir_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:blaze.worker.WorkRequest.sandbox_dir) +} +inline ::std::string* PROTOBUF_NONNULL WorkRequest::mutable_sandbox_dir() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + ::std::string* _s = _internal_mutable_sandbox_dir(); + // @@protoc_insertion_point(field_mutable:blaze.worker.WorkRequest.sandbox_dir) + return _s; +} +inline const ::std::string& WorkRequest::_internal_sandbox_dir() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.sandbox_dir_.Get(); +} +inline void WorkRequest::_internal_set_sandbox_dir(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.sandbox_dir_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL WorkRequest::_internal_mutable_sandbox_dir() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.sandbox_dir_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE WorkRequest::release_sandbox_dir() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:blaze.worker.WorkRequest.sandbox_dir) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000004U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + auto* released = _impl_.sandbox_dir_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.sandbox_dir_.Set("", GetArena()); + } + return released; +} +inline void WorkRequest::set_allocated_sandbox_dir(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000004U); + } + _impl_.sandbox_dir_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.sandbox_dir_.IsDefault()) { + _impl_.sandbox_dir_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:blaze.worker.WorkRequest.sandbox_dir) +} + +// ------------------------------------------------------------------- + +// WorkResponse + +// int32 exit_code = 1; +inline void WorkResponse::clear_exit_code() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.exit_code_ = 0; + ClearHasBit(_impl_._has_bits_[0], + 0x00000002U); +} +inline ::int32_t WorkResponse::exit_code() const { + // @@protoc_insertion_point(field_get:blaze.worker.WorkResponse.exit_code) + return _internal_exit_code(); +} +inline void WorkResponse::set_exit_code(::int32_t value) { + _internal_set_exit_code(value); + SetHasBit(_impl_._has_bits_[0], 0x00000002U); + // @@protoc_insertion_point(field_set:blaze.worker.WorkResponse.exit_code) +} +inline ::int32_t WorkResponse::_internal_exit_code() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.exit_code_; +} +inline void WorkResponse::_internal_set_exit_code(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.exit_code_ = value; +} + +// string output = 2; +inline void WorkResponse::clear_output() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.output_.ClearToEmpty(); + ClearHasBit(_impl_._has_bits_[0], + 0x00000001U); +} +inline const ::std::string& WorkResponse::output() const + ABSL_ATTRIBUTE_LIFETIME_BOUND { + // @@protoc_insertion_point(field_get:blaze.worker.WorkResponse.output) + return _internal_output(); +} +template +PROTOBUF_ALWAYS_INLINE void WorkResponse::set_output(Arg_&& arg, Args_... args) { + ::google::protobuf::internal::TSanWrite(&_impl_); + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + _impl_.output_.Set(static_cast(arg), args..., GetArena()); + // @@protoc_insertion_point(field_set:blaze.worker.WorkResponse.output) +} +inline ::std::string* PROTOBUF_NONNULL WorkResponse::mutable_output() + ABSL_ATTRIBUTE_LIFETIME_BOUND { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + ::std::string* _s = _internal_mutable_output(); + // @@protoc_insertion_point(field_mutable:blaze.worker.WorkResponse.output) + return _s; +} +inline const ::std::string& WorkResponse::_internal_output() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.output_.Get(); +} +inline void WorkResponse::_internal_set_output(const ::std::string& value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.output_.Set(value, GetArena()); +} +inline ::std::string* PROTOBUF_NONNULL WorkResponse::_internal_mutable_output() { + ::google::protobuf::internal::TSanWrite(&_impl_); + return _impl_.output_.Mutable( GetArena()); +} +inline ::std::string* PROTOBUF_NULLABLE WorkResponse::release_output() { + ::google::protobuf::internal::TSanWrite(&_impl_); + // @@protoc_insertion_point(field_release:blaze.worker.WorkResponse.output) + if (!CheckHasBit(_impl_._has_bits_[0], 0x00000001U)) { + return nullptr; + } + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + auto* released = _impl_.output_.Release(); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString()) { + _impl_.output_.Set("", GetArena()); + } + return released; +} +inline void WorkResponse::set_allocated_output(::std::string* PROTOBUF_NULLABLE value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + if (value != nullptr) { + SetHasBit(_impl_._has_bits_[0], 0x00000001U); + } else { + ClearHasBit(_impl_._has_bits_[0], 0x00000001U); + } + _impl_.output_.SetAllocated(value, GetArena()); + if (::google::protobuf::internal::DebugHardenForceCopyDefaultString() && _impl_.output_.IsDefault()) { + _impl_.output_.Set("", GetArena()); + } + // @@protoc_insertion_point(field_set_allocated:blaze.worker.WorkResponse.output) +} + +// int32 request_id = 3; +inline void WorkResponse::clear_request_id() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.request_id_ = 0; + ClearHasBit(_impl_._has_bits_[0], + 0x00000004U); +} +inline ::int32_t WorkResponse::request_id() const { + // @@protoc_insertion_point(field_get:blaze.worker.WorkResponse.request_id) + return _internal_request_id(); +} +inline void WorkResponse::set_request_id(::int32_t value) { + _internal_set_request_id(value); + SetHasBit(_impl_._has_bits_[0], 0x00000004U); + // @@protoc_insertion_point(field_set:blaze.worker.WorkResponse.request_id) +} +inline ::int32_t WorkResponse::_internal_request_id() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.request_id_; +} +inline void WorkResponse::_internal_set_request_id(::int32_t value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.request_id_ = value; +} + +// bool was_cancelled = 4; +inline void WorkResponse::clear_was_cancelled() { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.was_cancelled_ = false; + ClearHasBit(_impl_._has_bits_[0], + 0x00000008U); +} +inline bool WorkResponse::was_cancelled() const { + // @@protoc_insertion_point(field_get:blaze.worker.WorkResponse.was_cancelled) + return _internal_was_cancelled(); +} +inline void WorkResponse::set_was_cancelled(bool value) { + _internal_set_was_cancelled(value); + SetHasBit(_impl_._has_bits_[0], 0x00000008U); + // @@protoc_insertion_point(field_set:blaze.worker.WorkResponse.was_cancelled) +} +inline bool WorkResponse::_internal_was_cancelled() const { + ::google::protobuf::internal::TSanRead(&_impl_); + return _impl_.was_cancelled_; +} +inline void WorkResponse::_internal_set_was_cancelled(bool value) { + ::google::protobuf::internal::TSanWrite(&_impl_); + _impl_.was_cancelled_ = value; +} + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif // __GNUC__ + +// @@protoc_insertion_point(namespace_scope) +} // namespace worker +} // namespace blaze + + +// @@protoc_insertion_point(global_scope) + +#include "google/protobuf/port_undef.inc" +// clang-format on + +#endif // worker_5fprotocol_2eproto_2epb_2eh diff --git a/tools/worker/worker_protocol.proto b/tools/worker/worker_protocol.proto new file mode 100644 index 000000000..ae17121ba --- /dev/null +++ b/tools/worker/worker_protocol.proto @@ -0,0 +1,100 @@ +// Copyright 2015 The Bazel Authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package blaze.worker; + +option java_package = "com.google.devtools.build.lib.worker"; + +// An input file. +message Input { + // The path in the file system where to read this input artifact from. This is + // either a path relative to the execution root (the worker process is + // launched with the working directory set to the execution root), or an + // absolute path. + string path = 1; + + // A hash-value of the contents. The format of the contents is unspecified and + // the digest should be treated as an opaque token. This can be empty in some + // cases. + bytes digest = 2; +} + +// This represents a single work unit that Blaze sends to the worker. +message WorkRequest { + repeated string arguments = 1; + + // The inputs that the worker is allowed to read during execution of this + // request. + repeated Input inputs = 2; + + // Each WorkRequest must have either a unique + // request_id or request_id = 0. If request_id is 0, this WorkRequest must be + // processed alone (singleplex), otherwise the worker may process multiple + // WorkRequests in parallel (multiplexing). As an exception to the above, if + // the cancel field is true, the request_id must be the same as a previously + // sent WorkRequest. The request_id must be attached unchanged to the + // corresponding WorkResponse. Only one singleplex request may be sent to a + // worker at a time. + int32 request_id = 3; + + // EXPERIMENTAL: When true, this is a cancel request, indicating that a + // previously sent WorkRequest with the same request_id should be cancelled. + // The arguments and inputs fields must be empty and should be ignored. + bool cancel = 4; + + // Values greater than 0 indicate that the worker may output extra debug + // information to stderr (which will go into the worker log). Setting the + // --worker_verbose flag for Bazel makes this flag default to 10. + int32 verbosity = 5; + + // The relative directory inside the workers working directory where the + // inputs and outputs are placed, for sandboxing purposes. For singleplex + // workers, this is unset, as they can use their working directory as sandbox. + // For multiplex workers, this will be set when the + // --experimental_worker_multiplex_sandbox flag is set _and_ the execution + // requirements for the worker includes 'supports-multiplex-sandbox'. + // The paths in `inputs` will not contain this prefix, but the actual files + // will be placed/must be written relative to this directory. The worker + // implementation is responsible for resolving the file paths. + string sandbox_dir = 6; +} + +// The worker sends this message to Blaze when it finished its work on the +// WorkRequest message. +message WorkResponse { + int32 exit_code = 1; + + // Output message for this work unit. + // This is akin to the combined stdout/stderr if the work unit were executed + // as a standalone process. Output pertaining to a work unit should be + // reported here instead of through the stdout/stderr of the worker process. + // Assumed to be UTF-8 encoded. + string output = 2; + + // This field must be set to the same request_id as the WorkRequest it is a + // response to. Since worker processes which support multiplex worker will + // handle multiple WorkRequests in parallel, this ID will be used to + // determined which WorkerProxy does this WorkResponse belong to. + int32 request_id = 3; + + // EXPERIMENTAL When true, indicates that this response was sent due to + // receiving a cancel request. The exit_code and output fields should be empty + // and will be ignored. Exactly one WorkResponse must be sent for each + // non-cancelling WorkRequest received by the worker, but if the worker + // received a cancel request, it doesn't matter if it replies with a regular + // WorkResponse or with one where was_cancelled = true. + bool was_cancelled = 4; +} From 519f5da7f41680afd3ca118bfcd5348686612699 Mon Sep 17 00:00:00 2001 From: Mauricio G Date: Tue, 11 Aug 2026 14:36:02 -0700 Subject: [PATCH 2/3] Update worker_protocol.cc --- tools/worker/worker_protocol.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/worker/worker_protocol.cc b/tools/worker/worker_protocol.cc index 5162bdd09..096b8069a 100644 --- a/tools/worker/worker_protocol.cc +++ b/tools/worker/worker_protocol.cc @@ -30,10 +30,7 @@ namespace bazel_rules_swift::worker_protocol { namespace { -// Which wire format the peer speaks. Bazel selects JSON via the -// requires-worker-protocol execution requirement, but that requirement is -// client-side only: remote persistent worker runners (e.g. EngFlow) always -// speak the original length-delimited protobuf encoding. Detect the encoding +// Which wire format the peer speaks. Detect the encoding // from the first byte of the first request: JSON requests are // newline-delimited objects that begin with '{' (0x7b), while protobuf // frames begin with a varint message length (a 123-byte request would be From 5daafa0f5be7a17639be0900bb9520582736515f Mon Sep 17 00:00:00 2001 From: Mauricio G Date: Tue, 11 Aug 2026 14:36:44 -0700 Subject: [PATCH 3/3] Update actions.bzl --- swift/internal/actions.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/internal/actions.bzl b/swift/internal/actions.bzl index f261e825c..e5e0d60b6 100644 --- a/swift/internal/actions.bzl +++ b/swift/internal/actions.bzl @@ -202,7 +202,7 @@ def run_toolchain_action( tool_config.use_param_file ): execution_requirements["supports-workers"] = "1" - execution_requirements["requires-worker-protocol"] = "proto" + execution_requirements["requires-worker-protocol"] = "json" executable = swift_toolchain.swift_worker tool_executable_args.add(tool_config.executable)