diff --git a/etc/repos.json b/etc/repos.json index 54808ca7..c28134ff 100644 --- a/etc/repos.json +++ b/etc/repos.json @@ -268,11 +268,11 @@ , "bazel_remote_apis": { "repository": { "type": "archive" - , "content": "b5deb95d544f03f1918cc9d611c7904b8173befa" - , "fetch": "https://github.com/bazelbuild/remote-apis/archive/v2.0.0.tar.gz" - , "sha256": "79204ed1fa385c03b5235f65b25ced6ac51cf4b00e45e1157beca6a28bdb8043" - , "sha512": "7465f4726a9cc263352f6f0ec5b065c53e2ad787611740e1a458331858bdf28d53d69ba3db3d83fbf4a578229a413ac230886b5fcd33ab76425c61b1f08ef3b3" - , "subdir": "remote-apis-2.0.0" + , "content": "da6d7d589ccd1924ba9840a4e329e438dfa27f86" + , "fetch": "https://github.com/bazelbuild/remote-apis/archive/e1fe21be4c9ae76269a5a63215bb3c72ed9ab3f0.tar.gz" + , "sha256": "7421abd5352ccf927c2050453a4dbfa1f7b1c7170ec3e8702b6fe2d39b8805fe" + , "sha512": "3042690ee4b17a27db92ca867b4225c25f3f16344dce5fe86695d72ddda531e1593a5f0f70a291283451ce1e9f606c2285d222df3787815cd8f4054e1113bc9d" + , "subdir": "remote-apis-e1fe21be4c9ae76269a5a63215bb3c72ed9ab3f0" } , "target_root": "import targets" , "target_file_name": "TARGETS.bazel_remote_apis" diff --git a/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp b/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp index 12f7398f..9104b94d 100644 --- a/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp +++ b/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp @@ -211,9 +211,10 @@ template copy_nodes(dir.mutable_directories(), dirs); copy_nodes(dir.mutable_symlinks(), links); - std::copy(props.cbegin(), - props.cend(), - pb::back_inserter(dir.mutable_node_properties())); + std::copy( + props.cbegin(), + props.cend(), + pb::back_inserter(dir.mutable_node_properties()->mutable_properties())); return dir; } @@ -229,7 +230,8 @@ template node.set_is_executable(IsExecutableObject(type)); std::copy(props.cbegin(), props.cend(), - pb::back_inserter(node.mutable_node_properties())); + pb::back_inserter( + node.mutable_node_properties()->mutable_properties())); return node; } @@ -252,7 +254,8 @@ template node.set_target(target); std::copy(props.cbegin(), props.cend(), - pb::back_inserter(node.mutable_node_properties())); + pb::back_inserter( + node.mutable_node_properties()->mutable_properties())); return node; } @@ -322,6 +325,10 @@ template std::vector const& platform_properties) -> CommandBundle::Ptr { bazel_re::Command msg; + // DEPRECATED as of v2.2: platform properties are now specified + // directly in the action. See documentation note in the + // [Action][build.bazel.remote.execution.v2.Action] for migration. + // (https://github.com/bazelbuild/remote-apis/blob/e1fe21be4c9ae76269a5a63215bb3c72ed9ab3f0/build/bazel/remote/execution/v2/remote_execution.proto#L646) msg.set_allocated_platform(CreatePlatform(platform_properties).release()); std::copy(std::cbegin(args), std::cend(args), @@ -349,7 +356,7 @@ template [[nodiscard]] auto CreateActionBundle( bazel_re::Digest const& command, bazel_re::Digest const& root_dir, - std::vector const& output_node_properties, + std::vector const& platform_properties, bool do_not_cache, std::chrono::milliseconds const& timeout) -> ActionBundle::Ptr { using seconds = std::chrono::seconds; @@ -368,9 +375,12 @@ template gsl::owner{new bazel_re::Digest{command}}); msg.set_allocated_input_root_digest( gsl::owner{new bazel_re::Digest{root_dir}}); - std::copy(output_node_properties.cbegin(), - output_node_properties.cend(), - pb::back_inserter(msg.mutable_output_node_properties())); + // New in version 2.2: clients SHOULD set these platform properties + // as well as those in the + // [Command][build.bazel.remote.execution.v2.Command]. Servers + // SHOULD prefer those set here. + // (https://github.com/bazelbuild/remote-apis/blob/e1fe21be4c9ae76269a5a63215bb3c72ed9ab3f0/build/bazel/remote/execution/v2/remote_execution.proto#L516) + msg.set_allocated_platform(CreatePlatform(platform_properties).release()); auto content_creator = [&msg] { return SerializeMessage(msg); }; @@ -728,7 +738,6 @@ auto BazelMsgFactory::CreateActionDigestFromCommandLine( bazel_re::Digest const& exec_dir, std::vector const& output_files, std::vector const& output_dirs, - std::vector const& output_node_properties, std::vector const& env_vars, std::vector const& properties, bool do_not_cache, @@ -740,7 +749,7 @@ auto BazelMsgFactory::CreateActionDigestFromCommandLine( // create action auto action = CreateActionBundle( - cmd->Digest(), exec_dir, output_node_properties, do_not_cache, timeout); + cmd->Digest(), exec_dir, properties, do_not_cache, timeout); if (store_blob) { (*store_blob)(cmd->MakeBlob(/*is_exec=*/false)); diff --git a/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp b/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp index ca913c63..f27f246f 100644 --- a/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp +++ b/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp @@ -127,7 +127,6 @@ class BazelMsgFactory { bazel_re::Digest const& exec_dir, std::vector const& output_files, std::vector const& output_dirs, - std::vector const& output_node_properties, std::vector const& env_vars, std::vector const& properties, bool do_not_cache, diff --git a/src/buildtool/execution_api/execution_service/capabilities_server.cpp b/src/buildtool/execution_api/execution_service/capabilities_server.cpp index ea480301..35126bd3 100644 --- a/src/buildtool/execution_api/execution_service/capabilities_server.cpp +++ b/src/buildtool/execution_api/execution_service/capabilities_server.cpp @@ -30,7 +30,7 @@ auto CapabilitiesServiceImpl::GetCapabilities( ::bazel_re::CacheCapabilities cache; ::bazel_re::ExecutionCapabilities exec; - cache.add_digest_function( + cache.add_digest_functions( ::bazel_re::DigestFunction_Value::DigestFunction_Value_SHA256); cache.mutable_action_cache_update_capabilities()->set_update_enabled(false); static constexpr std::size_t kMaxBatchTransferSize = 1024 * 1024; diff --git a/src/buildtool/execution_api/local/local_action.hpp b/src/buildtool/execution_api/local/local_action.hpp index 95f95ff4..82101016 100644 --- a/src/buildtool/execution_api/local/local_action.hpp +++ b/src/buildtool/execution_api/local/local_action.hpp @@ -91,7 +91,6 @@ class LocalAction final : public IExecutionAction { exec_dir, output_files_, output_dirs_, - {} /*FIXME output node properties*/, BazelMsgFactory::CreateMessageVectorFromMap< bazel_re::Command_EnvironmentVariable>(env_vars_), properties_, diff --git a/src/buildtool/execution_api/remote/bazel/bazel_action.cpp b/src/buildtool/execution_api/remote/bazel/bazel_action.cpp index d7f9f389..04d4c3f7 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_action.cpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_action.cpp @@ -91,7 +91,6 @@ auto BazelAction::CreateBundlesForAction(BlobContainer* blobs, exec_dir, output_files_, output_dirs_, - {} /*FIXME output node properties*/, env_vars_, properties_, do_not_cache,