diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/buildtool/main/TARGETS | 1 | ||||
-rw-r--r-- | src/buildtool/main/add_to_cas.cpp | 14 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/buildtool/main/TARGETS b/src/buildtool/main/TARGETS index b3c89391..7298af47 100644 --- a/src/buildtool/main/TARGETS +++ b/src/buildtool/main/TARGETS @@ -157,6 +157,7 @@ [ ["src/buildtool/compatibility", "compatibility"] , ["src/buildtool/execution_api/bazel_msg", "bazel_msg_factory"] , ["src/buildtool/execution_api/common", "common"] + , ["src/buildtool/common", "common"] , ["src/buildtool/file_system", "file_system_manager"] , ["src/buildtool/logging", "log_level"] , ["src/buildtool/logging", "logging"] diff --git a/src/buildtool/main/add_to_cas.cpp b/src/buildtool/main/add_to_cas.cpp index 73f19502..2a7b2c0b 100644 --- a/src/buildtool/main/add_to_cas.cpp +++ b/src/buildtool/main/add_to_cas.cpp @@ -21,7 +21,8 @@ #include <optional> #include <string> -#include "src/buildtool/compatibility/native_support.hpp" +#include "src/buildtool/common/artifact_digest.hpp" +#include "src/buildtool/compatibility/compatibility.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp" #include "src/buildtool/execution_api/common/execution_api.hpp" #include "src/buildtool/file_system/file_system_manager.hpp" @@ -31,10 +32,7 @@ auto AddArtifactsToCas(ToAddArguments const& clargs, Storage const& storage, ApiBundle const& apis) -> bool { - auto const& cas = storage.CAS(); - std::optional<bazel_re::Digest> digest{}; auto object_location = clargs.location; - if (clargs.follow_symlinks) { if (not FileSystemManager::ResolveSymlinks(&object_location)) { Logger::Log(LogLevel::Error, @@ -53,6 +51,8 @@ auto AddArtifactsToCas(ToAddArguments const& clargs, return false; } + auto const& cas = storage.CAS(); + std::optional<ArtifactDigest> digest{}; switch (*object_type) { case ObjectType::File: digest = cas.StoreBlob(object_location, /*is_executable=*/false); @@ -101,10 +101,10 @@ auto AddArtifactsToCas(ToAddArguments const& clargs, return false; } - std::cout << NativeSupport::Unprefix(digest->hash()) << std::endl; + std::cout << digest->hash() << std::endl; - auto object = std::vector<Artifact::ObjectInfo>{ - Artifact::ObjectInfo{ArtifactDigest(*digest), *object_type, false}}; + auto const object = std::vector<Artifact::ObjectInfo>{ + Artifact::ObjectInfo{*digest, *object_type, false}}; if (not apis.local->RetrieveToCas(object, *apis.remote)) { Logger::Log(LogLevel::Error, |