Skip to content
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

Satisfy dependencies with installed incompatible modules #3137

Merged
merged 1 commit into from
Aug 9, 2020

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Aug 7, 2020

Problem

If you force-install an incompatible module (with no compatible versions), then try to install a mod with a recommendation that depends on it, you get this in the recommendations screen:

CKAN.DependencyNotSatisfiedKraken: Exception of type 'CKAN.DependencyNotSatisfiedKraken' was thrown.
  at CKAN.RelationshipResolver.ResolveStanza (System.Collections.Generic.IEnumerable`1[T] stanza, CKAN.SelectionReason reason, CKAN.RelationshipResolverOptions options, System.Boolean soft_resolve, System.Collections.Generic.IEnumerable`1[T] old_stanza) [0x0038f] in /home/DasSkelett/git/CKAN/Core/Relationships/RelationshipResolver.cs:434 
  at CKAN.RelationshipResolver.Resolve (CKAN.CkanModule module, CKAN.RelationshipResolverOptions options, System.Collections.Generic.IEnumerable`1[T] old_stanza) [0x00038] in /home/DasSkelett/git/CKAN/Core/Relationships/RelationshipResolver.cs:318 
  at CKAN.RelationshipResolver.AddModulesToInstall (System.Collections.Generic.IEnumerable`1[T] modules) [0x00189] in /home/DasSkelett/git/CKAN/Core/Relationships/RelationshipResolver.cs:260 
  at CKAN.RelationshipResolver..ctor (System.Collections.Generic.IEnumerable`1[T] modulesToInstall, System.Collections.Generic.IEnumerable`1[T] modulesToRemove, CKAN.RelationshipResolverOptions options, CKAN.IRegistryQuerier registry, CKAN.Versioning.KspVersionCriteria kspversion) [0x00028] in /home/DasSkelett/git/CKAN/Core/Relationships/RelationshipResolver.cs:183 
  at CKAN.ChooseRecommendedMods.FindConflicts () [0x00001] in /home/DasSkelett/git/CKAN/GUI/Controls/ChooseRecommendedMods.cs:116 
  at CKAN.ChooseRecommendedMods.MarkConflicts () [0x00001] in /home/DasSkelett/git/CKAN/GUI/Controls/ChooseRecommendedMods.cs:87 
  at CKAN.ChooseRecommendedMods.RecommendedModsListView_ItemChecked (System.Object sender, System.Windows.Forms.ItemCheckedEventArgs e) [0x00045] in /home/DasSkelett/git/CKAN/GUI/Controls/ChooseRecommendedMods.cs:81 
  at System.Windows.Forms.ListView.OnItemChecked (System.Windows.Forms.ItemCheckedEventArgs e) [0x00019] in <f8d3988c81fd41129e6b0d880060d203>:0 
  at System.Windows.Forms.ListViewItem.set_Checked (System.Boolean value) [0x0006c] in <f8d3988c81fd41129e6b0d880060d203>:0 

If you try to install a mod that depends on the depending mod, without the recommendations step:

image

Somehow if you simply install a mod that depends on the manually installed mod, that works fine. No idea why, RelationshipResolver is magic. 🌠

Cause

RelationshipResolver.MightBeInstallable, which is used as the first-pass basic installability checker, only looks at compatible available modules to satisfy dependencies. It doesn't check installed modules at all.

Changes

Now dependencies that are satisfied by an installed module will be treated as satisfied.

The DependencyNotSatisfiedKraken also has some more informative default reason messages.

Fixes #3134.

@HebaruSan HebaruSan added Bug Core (ckan.dll) Issues affecting the core part of CKAN Pull request Registry Issues affecting the registry Relationships Issues affecting depends, recommends, etc. labels Aug 7, 2020
Copy link
Member

@DasSkelett DasSkelett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Urgh, the most complex issues always have the simplest fixes.
Thanks for digging through this!

@HebaruSan HebaruSan merged commit f0f02d6 into KSP-CKAN:master Aug 9, 2020
@HebaruSan HebaruSan deleted the fix/inst-incompat-dep branch August 9, 2020 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Core (ckan.dll) Issues affecting the core part of CKAN Pull request Registry Issues affecting the registry Relationships Issues affecting depends, recommends, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] DependencyNotSatisfiedKraken on recommendation screen
2 participants