summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-12-06 15:11:53 +0100
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2023-12-12 16:09:10 +0100
commit515edfa9e64f020836a8c9066c2b79170b5649cc (patch)
treed7199358e9bf0a48b1545efdcfe7931e1e7ef9ed /src
parenta45eb254dc8df06bd35402653392fc790f6f4f6e (diff)
downloadjustbuild-515edfa9e64f020836a8c9066c2b79170b5649cc.tar.gz
absent_target_map: Improved logging
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/build_engine/target_map/absent_target_map.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/buildtool/build_engine/target_map/absent_target_map.cpp b/src/buildtool/build_engine/target_map/absent_target_map.cpp
index 6d41f182..7eed2c84 100644
--- a/src/buildtool/build_engine/target_map/absent_target_map.cpp
+++ b/src/buildtool/build_engine/target_map/absent_target_map.cpp
@@ -38,7 +38,7 @@ auto BuildMaps::Target::CreateAbsentTargetMap(
(*logger)(fmt::format("Failed to get the target root id for "
"repository \"{}\"",
repo_name),
- true);
+ /*fatal=*/true);
return;
}
auto flexible_vars = ServeApi::ServeTargetVariables(
@@ -49,7 +49,7 @@ auto BuildMaps::Target::CreateAbsentTargetMap(
(*logger)(fmt::format("Failed to obtain flexible config variables "
"for target \"{}\"",
key.target.ToString()),
- true);
+ /*fatal=*/true);
return;
}
// TODO(asartori): avoid code duplication in export.cpp
@@ -60,11 +60,17 @@ auto BuildMaps::Target::CreateAbsentTargetMap(
(*logger)(
fmt::format("Failed to obtain repository key for repo \"{}\"",
target_name.repository),
- true);
+ /*fatal=*/true);
return;
}
auto target_cache_key =
TargetCacheKey::Create(*repo_key, target_name, effective_config);
+ if (not target_cache_key) {
+ (*logger)(fmt::format("Could not produce cache key for target {}",
+ key.target.ToString()),
+ /*fatal=*/true);
+ return;
+ }
std::optional<std::pair<TargetCacheEntry, Artifact::ObjectInfo>>
target_cache_value{std::nullopt};
target_cache_value =
@@ -82,7 +88,7 @@ auto BuildMaps::Target::CreateAbsentTargetMap(
if (!target_cache_value) {
(*logger)(fmt::format("Could not get target cache value for key {}",
target_cache_key->Id().ToString()),
- true);
+ /*fatal=*/true);
return;
}
auto const& [entry, info] = *target_cache_value;
@@ -124,7 +130,7 @@ auto BuildMaps::Target::CreateAbsentTargetMap(
}
(*logger)(fmt::format("Reading target entry for key {} failed",
target_cache_key->Id().ToString()),
- true);
+ /*fatal=*/true);
};
#else
auto target_reader = [](auto /*ts*/,