Fix diagnostic output for dependency resolution failures.
1 parent 7256712 commit b2b6199b7c289ef194c6224bb785faf4967e90d3
@Sönke Ludwig Sönke Ludwig authored on 18 Dec 2016
Showing 1 changed file
View
6
source/dub/dependencyresolver.d
foreach (n, i; package_indices) logDebug(" %s (%s%s): %s", n, i, n in maybe_optional_deps ? ", maybe optional" : ", required", all_configs[i]);
 
auto config_indices = new size_t[all_configs.length];
config_indices[] = 0;
 
string last_error;
 
visited = null;
sizediff_t validateConfigs(TreeNode parent, ref string error)
{
throw new Exception(format("Root package %s references unknown package %s", parent.pack, ch.pack));
}
// choose another parent config to avoid the invalid child
if (parentidx > maxcpi) {
error = format("Package %s contains invalid dependency %s", parent.pack, ch.pack);
error = format("Package %s contains invalid dependency %s (no version candidates)", parent.pack, ch.pack);
logDiagnostic("%s (ci=%s)", error, parentidx);
maxcpi = parentidx;
}
} else {
// check if the current combination of configurations works out
visited = null;
string error;
auto conflict_index = validateConfigs(root, error);
if (first_error !is null) first_error = error;
if (first_error is null) first_error = error;
 
// print out current iteration state
logDebug("Interation (ci=%s) %s", conflict_index, {
import std.array : join;