diff options
Diffstat (limited to 'src/buildtool/serve_api/remote')
-rw-r--r-- | src/buildtool/serve_api/remote/TARGETS | 5 | ||||
-rw-r--r-- | src/buildtool/serve_api/remote/config.hpp | 14 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/buildtool/serve_api/remote/TARGETS b/src/buildtool/serve_api/remote/TARGETS index f77fac04..8b64aee7 100644 --- a/src/buildtool/serve_api/remote/TARGETS +++ b/src/buildtool/serve_api/remote/TARGETS @@ -2,7 +2,10 @@ { "type": ["@", "rules", "CC", "library"] , "name": ["config"] , "hdrs": ["config.hpp"] - , "deps": [["src/buildtool/common/remote", "remote_common"]] + , "deps": + [ ["src/buildtool/common/remote", "remote_common"] + , ["src/buildtool/main", "build_utils"] + ] , "stage": ["src", "buildtool", "serve_api", "remote"] } , "source_tree_client": diff --git a/src/buildtool/serve_api/remote/config.hpp b/src/buildtool/serve_api/remote/config.hpp index 94f00f8e..8978565b 100644 --- a/src/buildtool/serve_api/remote/config.hpp +++ b/src/buildtool/serve_api/remote/config.hpp @@ -21,6 +21,7 @@ #include <vector> #include "src/buildtool/common/remote/remote_common.hpp" +#include "src/buildtool/main/build_utils.hpp" class RemoteServeConfig { public: @@ -65,6 +66,10 @@ class RemoteServeConfig { return Instance().timeout_ > std::chrono::seconds{0}; } + static void SetTCStrategy(TargetCacheWriteStrategy strategy) noexcept { + Instance().tc_strategy_ = strategy; + } + // Remote execution address, if set [[nodiscard]] static auto RemoteAddress() noexcept -> std::optional<ServerAddress> { @@ -93,6 +98,12 @@ class RemoteServeConfig { return Instance().timeout_; } + // Get the target-level cache write strategy + [[nodiscard]] static auto TCStrategy() noexcept + -> TargetCacheWriteStrategy { + return Instance().tc_strategy_; + } + private: // Server address of remote execution. std::optional<ServerAddress> remote_address_{}; @@ -108,6 +119,9 @@ class RemoteServeConfig { // Action timeout std::chrono::milliseconds timeout_{}; + + // Strategy for synchronizing target-level cache + TargetCacheWriteStrategy tc_strategy_{TargetCacheWriteStrategy::Sync}; }; #endif // INCLUDED_SRC_BUILDTOOL_SERVE_API_REMOTE_CONFIG_HPP |