diff --git a/source/dub/dependency.d b/source/dub/dependency.d index 58622f1..90d5e4e 100644 --- a/source/dub/dependency.d +++ b/source/dub/dependency.d @@ -141,6 +141,8 @@ const { string r; + if (this == invalid) return "invalid"; + if( m_versA == m_versB && m_cmpA == ">=" && m_cmpB == "<=" ){ // Special "==" case if (m_versA == Version.MASTER ) r = "~master"; diff --git a/source/dub/dependencyresolver.d b/source/dub/dependencyresolver.d index cd9ef17..f4a5e8a 100644 --- a/source/dub/dependencyresolver.d +++ b/source/dub/dependencyresolver.d @@ -139,7 +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,10 +152,14 @@ error = format("Dependency %s -> %s %s mismatches with selected version %s", parent.pack, ch.pack, ch.configs, config); logDebug("%s (ci=%s)", error, maxcpi); } + + // we know that either the child or the parent needs to be switched + // to another configuration, no need to continue with other children + if (config == CONFIG.invalid) break; + + maxcpi = max(maxcpi, validateConfigs(chnode, error)); } - if (config != CONFIG.invalid) - maxcpi = max(maxcpi, validateConfigs(chnode, error)); } } return maxcpi;