Skip to content

Commit

Permalink
[buildenv] fix uses
Browse files Browse the repository at this point in the history
  • Loading branch information
k2rate committed Nov 8, 2024
1 parent a437f74 commit ba32601
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions buildkit/re/buildenv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,22 @@ namespace re
return;
}

for (auto &[name, dep] : pTarget->used_mapping)
{
RE_TRACE(" PopulateTargetDependencySet: Attempting to resolve uses-mapping '{}' <- '{}'\n", pTarget->module,
dep->ToString());
// for (auto &[name, dep] : pTarget->used_mapping)
// {
// RE_TRACE(" PopulateTargetDependencySet: Attempting to resolve uses-mapping '{}' <- '{}'\n", pTarget->module,
// dep->ToString());

if (!dep_resolver(*pTarget, *dep, dep->resolved))
{
RE_TRACE(" failed\n");
// fmt::print("dep: {}\n", dep->ToString());

if (throw_on_missing)
RE_THROW TargetDependencyException(pTarget, "unresolved uses-map dependency {}", dep->name);
}
}
// if (dep->resolved.empty() && !dep_resolver(*pTarget, *dep, dep->resolved))
// {
// fmt::print("failed dep: {}\n", dep->ToString());
// RE_TRACE(" failed\n");

// if (throw_on_missing)
// RE_THROW TargetDependencyException(pTarget, "unresolved uses-map dependency {}", dep->name);
// }
// }

for (auto &dep : pTarget->dependencies)
{
Expand Down Expand Up @@ -687,6 +690,7 @@ namespace re
if (dep.ns.empty())
{
auto result = GetDeepSiblingDep(&target, dep.name);
// fmt::print("ResolveTargetDependencyImpl: target: {}\n", target.name);

// Arch coercion - this is SOMETIMES very useful
if (result)
Expand Down Expand Up @@ -718,6 +722,8 @@ namespace re
result = ecfg_existing;
}

// fmt::print("target.build_var_scope = {}, result->build_var_scope = {}\n", target.build_var_scope.has_value(), result->build_var_scope.has_value());

if (target.build_var_scope && result->build_var_scope)
{
auto target_arch = target.build_var_scope->ResolveLocal("arch");
Expand Down

0 comments on commit ba32601

Please sign in to comment.