diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-25 17:02:03 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-30 12:10:06 +0200 |
commit | b5a92a60035ea3731a96bbdc8bca18986b558a05 (patch) | |
tree | 088d85e95d929b31cf74afb1a922b34c4afa7138 /src/buildtool/main/main.cpp | |
parent | deba068d8692bf6d265926885de5601d72f5d461 (diff) | |
download | justbuild-b5a92a60035ea3731a96bbdc8bca18986b558a05.tar.gz |
Pass RemoteContext to ApiBundle
The CreateRemote method is also updated to receive all
remote-related information as arguments, such that it does not have
to rely on the ApiBundle internal fields which will eventually be
removed.
Diffstat (limited to 'src/buildtool/main/main.cpp')
-rw-r--r-- | src/buildtool/main/main.cpp | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index 1676cbb4..10fde879 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -75,6 +75,7 @@ #include "src/buildtool/execution_api/local/config.hpp" #include "src/buildtool/execution_api/local/context.hpp" #include "src/buildtool/execution_api/remote/config.hpp" +#include "src/buildtool/execution_api/remote/context.hpp" #include "src/buildtool/graph_traverser/graph_traverser.hpp" #include "src/buildtool/main/describe.hpp" #include "src/buildtool/main/retry.hpp" @@ -815,12 +816,15 @@ auto main(int argc, char* argv[]) -> int { .exec_config = &*local_exec_config, .storage_config = &*storage_config, .storage = &storage}; + // pack the remote context instances to be passed as needed + RemoteContext const remote_context{ + .auth = &*auth_config, + .retry_config = &retry_config, + .exec_config = &remote_exec_config}; ApiBundle const exec_apis{&local_context, - /*repo_config=*/nullptr, - &*auth_config, - &retry_config, - &remote_exec_config}; + &remote_context, + /*repo_config=*/nullptr}; return execution_server->Run(&local_context, exec_apis, @@ -877,12 +881,15 @@ auto main(int argc, char* argv[]) -> int { .exec_config = &*local_exec_config, .storage_config = &*storage_config, .storage = &storage}; + // pack the remote context instances to be passed as needed + RemoteContext const remote_context{ + .auth = &*auth_config, + .retry_config = &*retry_config, + .exec_config = &*remote_exec_config}; ApiBundle const serve_apis{&local_context, - /*repo_config=*/nullptr, - &*auth_config, - &*retry_config, - &*remote_exec_config}; + &remote_context, + /*repo_config=*/nullptr}; auto serve = ServeApi::Create(*serve_config, &storage, &serve_apis); @@ -972,12 +979,13 @@ auto main(int argc, char* argv[]) -> int { LocalContext const local_context{.exec_config = &*local_exec_config, .storage_config = &*storage_config, .storage = &storage}; + // pack the remote context instances to be passed as needed + RemoteContext const remote_context{.auth = &*auth_config, + .retry_config = &*retry_config, + .exec_config = &*remote_exec_config}; - ApiBundle const main_apis{&local_context, - &repo_config, - &*auth_config, - &*retry_config, - &*remote_exec_config}; + ApiBundle const main_apis{ + &local_context, &remote_context, &repo_config}; GraphTraverser const traverser{ {jobs, std::move(arguments.build), |