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

Handle incompatible force-installed dependencies of recommendations #3305

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

HebaruSan
Copy link
Member

Problem

  1. Find an incompatible mod that has a compatible recommendation or suggestion that depends back on the original mod.
    (One example is RasterPropMonitor and RasterPropMonitor-Core, which are not compatible with KSP 1.11, and recommend ASETProps, which depends on RasterPropMonitor-Core.)
  2. Use the Versions tab checkboxes to add the incompatible mod(s) to the change set.
  3. Click Apply to go to the recommendations/suggestions screen
  4. Check the checkbox for the mod that depends on the incompatible mods you're force-installing.
    (In our example, this is ASETProps)
  5. On Windows:
    screenshot
    On Linux, the same exception is printed to stdout.
    CKAN.DependencyNotSatisfiedKraken: ASETProps dependency on RasterPropMonitor-Core 1:v0.30.2 or later version (any) not satisfied
       at CKAN.RelationshipResolver.ResolveStanza(IEnumerable`1 stanza, SelectionReason reason, RelationshipResolverOptions options, Boolean soft_resolve, IEnumerable`1 old_stanza)
       at CKAN.RelationshipResolver.Resolve(CkanModule module, RelationshipResolverOptions options, IEnumerable`1 old_stanza)
       at CKAN.RelationshipResolver.AddModulesToInstall(IEnumerable`1 modules)
       at CKAN.ChooseRecommendedMods.FindConflicts()
       at CKAN.ChooseRecommendedMods.MarkConflicts()
       at CKAN.ChooseRecommendedMods.RecommendedModsListView_ItemChecked(Object sender, ItemCheckedEventArgs e)
       at System.Windows.Forms.ListView.OnItemChecked(ItemCheckedEventArgs e)
       at System.Windows.Forms.ListView.WmReflectNotify(Message& m)
       at System.Windows.Forms.ListView.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
    

Cause

The conflict checker in the recommendations/suggestions screen doesn't know about the mods we're force-installing, so when it asks the RelationshipResolver to look for conflicts, it finds out that the dependencies aren't satisfied.

Changes

  • Now LoadRecommendations has parameters for the mods that are planned to install and remove, and it includes them in the mods it passes to the RelationshipResolver for checking conflicts
  • If we somehow get this exception again anyway, we now catch it and display it instead of letting it go to the unhandled exception handler:
    image

Fixes #3303.

@HebaruSan HebaruSan added Bug Something is not working as intended GUI Issues affecting the interactive GUI Pull request Relationships Issues affecting depends, recommends, etc. labels Feb 24, 2021
@HebaruSan HebaruSan requested a review from DasSkelett February 24, 2021 18:38
@HebaruSan
Copy link
Member Author

@Arkhorse, there's a test build available if you scroll all the way down to the bottom of this page:

@DasSkelett
Copy link
Member

Ah, and it didn't know about the mods selected via the normal modlist checkbox either, but that wasn't a problem because the resolver could just find a compatible version to satisfy the dependency. 💡

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.

The exception was only visible in the terminal, that explains a lot...

Looks good, thanks.

@HebaruSan HebaruSan merged commit d3624b9 into KSP-CKAN:master Feb 24, 2021
@HebaruSan HebaruSan deleted the fix/rec-incompat-dep branch February 24, 2021 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended GUI Issues affecting the interactive GUI Relationships Issues affecting depends, recommends, etc.
Projects
None yet
2 participants