summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildtool/execution_api')
-rw-r--r--src/buildtool/execution_api/common/execution_api.hpp3
-rw-r--r--src/buildtool/execution_api/git/git_api.hpp3
-rw-r--r--src/buildtool/execution_api/local/local_api.hpp5
-rw-r--r--src/buildtool/execution_api/remote/bazel/bazel_api.cpp3
-rw-r--r--src/buildtool/execution_api/remote/bazel/bazel_api.hpp2
5 files changed, 7 insertions, 9 deletions
diff --git a/src/buildtool/execution_api/common/execution_api.hpp b/src/buildtool/execution_api/common/execution_api.hpp
index 72663c2e..b86ddd1f 100644
--- a/src/buildtool/execution_api/common/execution_api.hpp
+++ b/src/buildtool/execution_api/common/execution_api.hpp
@@ -35,6 +35,7 @@
class IExecutionApi {
public:
using Ptr = std::shared_ptr<IExecutionApi const>;
+ using OptionalPtr = std::optional<gsl::not_null<IExecutionApi const*>>;
IExecutionApi() = default;
IExecutionApi(IExecutionApi const&) = delete;
@@ -70,7 +71,7 @@ class IExecutionApi {
[[nodiscard]] virtual auto RetrieveToPaths(
std::vector<Artifact::ObjectInfo> const& artifacts_info,
std::vector<std::filesystem::path> const& output_paths,
- std::optional<gsl::not_null<const IExecutionApi*>> const& alternative =
+ IExecutionApi::OptionalPtr const& alternative =
std::nullopt) const noexcept -> bool = 0;
/// \brief Retrieve artifacts from CAS and write to file descriptors.
diff --git a/src/buildtool/execution_api/git/git_api.hpp b/src/buildtool/execution_api/git/git_api.hpp
index 53184988..d35000fd 100644
--- a/src/buildtool/execution_api/git/git_api.hpp
+++ b/src/buildtool/execution_api/git/git_api.hpp
@@ -54,8 +54,7 @@ class GitApi final : public IExecutionApi {
[[nodiscard]] auto RetrieveToPaths(
std::vector<Artifact::ObjectInfo> const& artifacts_info,
std::vector<std::filesystem::path> const& output_paths,
- std::optional<
- gsl::not_null<const IExecutionApi*>> const& /*alternative*/
+ IExecutionApi::OptionalPtr const& /*alternative*/
= std::nullopt) const noexcept -> bool override {
if (artifacts_info.size() != output_paths.size()) {
Logger::Log(LogLevel::Error,
diff --git a/src/buildtool/execution_api/local/local_api.hpp b/src/buildtool/execution_api/local/local_api.hpp
index 928fb5b8..cbb904ef 100644
--- a/src/buildtool/execution_api/local/local_api.hpp
+++ b/src/buildtool/execution_api/local/local_api.hpp
@@ -78,9 +78,8 @@ class LocalApi final : public IExecutionApi {
[[nodiscard]] auto RetrieveToPaths(
std::vector<Artifact::ObjectInfo> const& artifacts_info,
std::vector<std::filesystem::path> const& output_paths,
- std::optional<
- gsl::not_null<const IExecutionApi*>> const& /*alternative*/
- = std::nullopt) const noexcept -> bool final {
+ IExecutionApi::OptionalPtr const& /*alternative*/ =
+ std::nullopt) const noexcept -> bool final {
if (artifacts_info.size() != output_paths.size()) {
Logger::Log(LogLevel::Error,
"different number of digests and output paths.");
diff --git a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp
index b475dfe8..f636c265 100644
--- a/src/buildtool/execution_api/remote/bazel/bazel_api.cpp
+++ b/src/buildtool/execution_api/remote/bazel/bazel_api.cpp
@@ -221,8 +221,7 @@ auto BazelApi::CreateAction(
[[nodiscard]] auto BazelApi::RetrieveToPaths(
std::vector<Artifact::ObjectInfo> const& artifacts_info,
std::vector<std::filesystem::path> const& output_paths,
- std::optional<gsl::not_null<const IExecutionApi*>> const& alternative)
- const noexcept -> bool {
+ IExecutionApi::OptionalPtr const& alternative) const noexcept -> bool {
if (artifacts_info.size() != output_paths.size()) {
Logger::Log(LogLevel::Warning,
"different number of digests and output paths.");
diff --git a/src/buildtool/execution_api/remote/bazel/bazel_api.hpp b/src/buildtool/execution_api/remote/bazel/bazel_api.hpp
index a9149450..e5669933 100644
--- a/src/buildtool/execution_api/remote/bazel/bazel_api.hpp
+++ b/src/buildtool/execution_api/remote/bazel/bazel_api.hpp
@@ -62,7 +62,7 @@ class BazelApi final : public IExecutionApi {
[[nodiscard]] auto RetrieveToPaths(
std::vector<Artifact::ObjectInfo> const& artifacts_info,
std::vector<std::filesystem::path> const& output_paths,
- std::optional<gsl::not_null<const IExecutionApi*>> const& alternative =
+ IExecutionApi::OptionalPtr const& alternative =
std::nullopt) const noexcept -> bool final;
[[nodiscard]] auto RetrieveToFds(