summaryrefslogtreecommitdiff
path: root/src/buildtool/build_engine/target_map/target_map.cpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2024-01-15 10:06:48 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2024-01-16 18:50:42 +0100
commitfb365b17ca339a25688ff61918280a46d64943b9 (patch)
tree08d5413c279567b4d2feee7d1837eb63aa457994 /src/buildtool/build_engine/target_map/target_map.cpp
parent6c456dbbd4e5aa7e54f3c51fbf7f45ea98d4abd2 (diff)
downloadjustbuild-fb365b17ca339a25688ff61918280a46d64943b9.tar.gz
Analysed target: keep track of implied export targets
... that are eligible for caching. In this way, we can accurately keep track of the dependencies between target-level cache entries. Note that it is enough to track the export targets eligible for caching, as no target depending on an ineligible export target can be eligible.
Diffstat (limited to 'src/buildtool/build_engine/target_map/target_map.cpp')
-rw-r--r--src/buildtool/build_engine/target_map/target_map.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/buildtool/build_engine/target_map/target_map.cpp b/src/buildtool/build_engine/target_map/target_map.cpp
index ebb07a91..5ca46c93 100644
--- a/src/buildtool/build_engine/target_map/target_map.cpp
+++ b/src/buildtool/build_engine/target_map/target_map.cpp
@@ -297,6 +297,13 @@ void withDependencies(
}
}
+ // Compute implied export targets
+ std::set<std::string> implied_export{};
+ for (auto const& dep : dependency_values) {
+ implied_export.insert((*dep)->ImpliedExport().begin(),
+ (*dep)->ImpliedExport().end());
+ }
+
// Evaluate string parameters
auto string_fields_fcts =
FunctionMap::MakePtr(FunctionMap::underlying_map_t{
@@ -849,6 +856,7 @@ void withDependencies(
std::move(trees),
std::move(effective_vars),
std::move(tainted),
+ std::move(implied_export),
deps_info);
analysis_result =
result_map->Add(key.target, effective_conf, std::move(analysis_result));
@@ -1371,6 +1379,7 @@ void withTargetNode(
{},
{},
{},
+ {},
TargetGraphInformation::kSource}));
}
else {
@@ -1472,6 +1481,7 @@ void TreeTarget(
std::vector<Tree::Ptr>{},
std::unordered_set<std::string>{},
std::set<std::string>{},
+ std::set<std::string>{},
TargetGraphInformation::kSource);
analysis_result =
result_map->Add(key.target, {}, std::move(analysis_result));
@@ -1557,6 +1567,7 @@ void TreeTarget(
std::vector<Tree::Ptr>{tree},
std::unordered_set<std::string>{},
std::set<std::string>{},
+ std::set<std::string>{},
TargetGraphInformation::kSource);
analysis_result = result_map->Add(
key.target, {}, std::move(analysis_result));
@@ -1590,6 +1601,7 @@ void GlobResult(const std::vector<AnalysedTargetPtr const*>& values,
std::vector<Tree::Ptr>{},
std::unordered_set<std::string>{},
std::set<std::string>{},
+ std::set<std::string>{},
TargetGraphInformation::kSource);
(*setter)(std::move(target));
}