-
-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check all dependencies for compatibility checking #2963
Conversation
This comment has been minimized.
This comment has been minimized.
83a8afd
to
bab9435
Compare
This comment has been minimized.
This comment has been minimized.
I wasn't sure about those. In many places we pass |
Okay, let's leave those alone. |
This comment has been minimized.
This comment has been minimized.
65ecbc1
to
2f579f1
Compare
Right, this hasn't been rebased; both PRs were tripped up by something else, apparently some third party changes in net-core. Do we have enough information to submit an issue to https://github.com/dotnet/core/issues ? |
e425c1c
to
5e5b94a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, the core build fail can be investigated separately.
Edit: Maybe just remove the .travis.yml change before merging.
Problems
The Compatible and Incompatible filters in GUI check dependencies, but only one level. For example, OuterPlanetsMod depends on Kopernicus depends on ModularFlightIntegrator; if the first two are compatible and the third isn't, then OuterPlanetsMod appears to be installable but will fail.
We do extra work when loading the GUI filters, since
Registry.Available
andRegistry.Incompatible
both loop over all modules and check their dependencies, and the results are not re-used. Similarly, various operations that refresh the mod list are slower than they need to be because we re-check all those same relationships over again even if they haven't changed.Sometimes "Available" includes incompatible modules:
Registry.available_modules
Registry.AllAvailable
Registry.SetAllAvailable
Registry.HasAnyAvailable
Registry.AddAvailable
Registry.RemoveAvailable
Registry.GetAvailableMetadata
And sometimes it excludes them:
Registry.Available
ckan available
This is confusing.
Changes
Now
Registry
uses a newCompatibilitySorter
class to track module compatibility, which has public propertiesCompatible
andIncompatible
and aCompatibleVersions
property to represent which versions they're compatible with. When we need the compatible or incompatible mods, we check whether the compatible versions are the same as last time, and if so, we return the same lists as previously (which solves the problem ofRegistry.Available
andRegistry.Incompatible
duplicating work), otherwise we create a newCompatibilitySorter
to compute the new compatibilities.CompatibilitySorter
uses a fully recursive dependency checking algorithm, so modules will only be counted as compatible if all of their dependencies are compatible. It also uses the lists of compatible and incompatible mods to speed up the search as it goes, rather than re-checking over and over whether dependencies are compatible (now that it's recursive, we don't want to re-check all of Kopernicus's dependencies over and over for all of its many depending mods).Now "Available" means all modules, and anything that excludes incompatible mods is renamed to "Compatible".
AllAvailable
is renamed toAvailableByIdentifier
since it doesn't return "all" of anything.ckan available
retains its old name so users don't have to switch to a new command.Fixes #1105.
Fixes #1646.
Fixes #2231.
Fixes #2849.