diff --git a/source/dub/dependencyresolver.d b/source/dub/dependencyresolver.d index 93d756f..cd9ef17 100644 --- a/source/dub/dependencyresolver.d +++ b/source/dub/dependencyresolver.d @@ -139,6 +139,7 @@ } else { auto config = all_configs[childidx][config_indices[childidx]]; auto chnode = TreeNode(ch.pack, config); + if (config == CONFIG.invalid || !matches(ch.configs, config)) { // if we are at the root level, we can safely skip the maxcpi computation and instead choose another childidx config if (parentbase == root_base_pack) { @@ -152,7 +153,9 @@ logDebug("%s (ci=%s)", error, maxcpi); } } - maxcpi = max(maxcpi, validateConfigs(chnode, error)); + + if (config != CONFIG.invalid) + maxcpi = max(maxcpi, validateConfigs(chnode, error)); } } return maxcpi;