Check compatibility of providing modules #3003
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
In a KSP 1.9.0 install with no additional versions marked compatible, 115 modules are shown as compatible, but 21 of them can't be installed due to missing dependencies.
Cause
SVE-HighResolution has a bit of a crazy history. It currently depends on StockVisualEnhancements, but in versions 1:104–2:1.1.6 it provided StockVisualEnhancements.
The compatibility resolver from #2963 is confused by this. It tries to allow any compatible version of a module to satisfy a dependency, but circular dependencies are treated as tentatively compatible because otherwise they'd be impossible to resolve. This might be OK, except it also uses the provides-index from #2354 to resolve
"provides"
-based relationships, and that index is compatibility-agnostic; incompatible providing modules are included.This means current versions of SVE-HighResolution can have their StockVisualEnhancements dependency satisfied by older versions of SVE-HighResolution, which is a circular dependency, so we treat SVE-HighResolution as tentatively compatible, and eventually we treat it as truly compatible.
This allows any module depending on StockVisualEnhancements to be considered compatible. As a bonus, those older SVE-HighResolution versions also provided Scatterer, so mods depending on Scatterer are also marked compatible.
Changes
Now a
"provides"
relationship will only be obeyed if the providing module is compatible.We accomplish this by filtering out incompatible providers before running the compatibility checks.