From 2cd74eab7fdfb58d0c6a340ed5c3ed6484d57b48 Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Tue, 2 Jul 2024 19:39:39 -0700 Subject: [PATCH] While building the dependency graph, also follow aliases. Aliases might lead us to a different package that we don't know about yet. --- bant/explore/dependency-graph.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bant/explore/dependency-graph.cc b/bant/explore/dependency-graph.cc index 9f94061..0b9eda1 100644 --- a/bant/explore/dependency-graph.cc +++ b/bant/explore/dependency-graph.cc @@ -162,7 +162,14 @@ DependencyGraph BuildDependencyGraph(Session &session, // The list to insert all the dependencies our current target has. std::vector &depends_on = graph.depends_on.insert({*target_or, {}}).first->second; - for (const auto dep : query::ExtractStringList(result.deps_list)) { + + // Follow dependencies and alias references. + auto to_follow = query::ExtractStringList(result.deps_list); + if (!result.actual.empty()) { + to_follow.push_back(result.actual); + } + + for (const auto dep : to_follow) { auto dependency_or = BazelTarget::ParseFrom(dep, current_package); if (!dependency_or.has_value()) continue;