diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-03-14 17:07:50 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-03-19 10:31:33 +0100 |
commit | d156302b055a8c1595a4c96d40ee8adbc94fce77 (patch) | |
tree | 398e18fa5922bf31ac29f82346b88a28436656bc /src/buildtool/main/build_utils.hpp | |
parent | 7b0a91b901ee44ef3cfae9bc9fc7de08d483e592 (diff) | |
download | justbuild-d156302b055a8c1595a4c96d40ee8adbc94fce77.tar.gz |
WriteTargetCacheEntries: Be explicit in logging location...
...by allowing a Logger instance to be provided. Also adds a flag
in order for failed artifacts from builds orchestrated by the serve
endpoint to be able to be reported as errors instead of warnings.
Diffstat (limited to 'src/buildtool/main/build_utils.hpp')
-rw-r--r-- | src/buildtool/main/build_utils.hpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/buildtool/main/build_utils.hpp b/src/buildtool/main/build_utils.hpp index cf1c68ec..e86e2a90 100644 --- a/src/buildtool/main/build_utils.hpp +++ b/src/buildtool/main/build_utils.hpp @@ -30,6 +30,7 @@ #include "src/buildtool/common/artifact.hpp" #include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/execution_api/common/execution_api.hpp" +#include "src/buildtool/logging/logger.hpp" #include "src/buildtool/multithreading/async_map_consumer.hpp" #include "src/buildtool/storage/storage.hpp" #include "src/buildtool/storage/target_cache.hpp" @@ -79,6 +80,8 @@ static const std::function<std::string(Artifact::ObjectInfo const&)> return x.ToString(); }; +/// \brief Write the target cache entries resulting after a build. +/// \param strict_logging Bump warnings to actual errors. void WriteTargetCacheEntries( std::unordered_map<TargetCacheKey, AnalysedTargetPtr> const& cache_targets, std::unordered_map<ArtifactDescription, Artifact::ObjectInfo> const& @@ -87,7 +90,9 @@ void WriteTargetCacheEntries( gsl::not_null<IExecutionApi*> const& local_api, gsl::not_null<IExecutionApi*> const& remote_api, TargetCacheWriteStrategy strategy = TargetCacheWriteStrategy::Sync, - TargetCache<true> const& tc = Storage::Instance().TargetCache()); + TargetCache<true> const& tc = Storage::Instance().TargetCache(), + Logger const* logger = nullptr, + bool strict_logging = false); #endif // BOOTSTRAP_BUILD_TOOL #endif // INCLUDED_SRC_BUILDOOL_MAIN_BUILD_UTILS_HPP |