-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
Fix installation of AVP while removing EVE default configs #3366
Fix installation of AVP while removing EVE default configs #3366
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I see, in other cases it does disappear (tested with RealismOverhaul and KerbalJointReinforcementNext). Ugh, no idea where that goes wrong.
Interesting, maybe connected to the above problem? EVE-HR doesn't get added to the changeset, though. So the relationship resolver is doing something right, but somewhere along the chain the error seems to be lost. |
Okay, turns out that by sending the more accurate list of installed mods the resolver is now "too good", which causes it to not find any candidates at all, which in turn causes a
... instead of going on with the resolution and adding the mod to a list of conflicts if CKAN/Core/Relationships/RelationshipResolver.cs Lines 500 to 524 in f053ee4
And in Lines 453 to 461 in f053ee4
CKAN/GUI/Controls/ManageMods.cs Line 1602 in f053ee4
So I think for the second attempt to get candidates in CKAN/Core/Relationships/RelationshipResolver.cs Lines 442 to 448 in f053ee4
we should pass and empty |
Changes of the last commit:
In the first search for candidates in In the second search for candidates (if the previous didn't find any), pass an empty list for This also solved the conflict message not disappearing after deselecting the conflicting mod(s). And |
The stuff that I was testing last time now works seemingly flawlessly, thanks for patching it up. 👍 |
LGTM. Can we add a test or two so we have better guard rails the next time we want to change the resolver? |
I can try to expand |
52c9776
to
4dc434d
Compare
Okay, squashed the fixup commit, and expanded the new unit test to also cover what happened behind the scenes when doing the toggle switcharoo. It's basically scenario 2, which shouldn't have thrown any exceptions because we had |
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.
Really nice, will be great to have this. 🐏
Is it time to start preparing to release v1.30.2?
Or: Fix resolution of circular dependencies when conflicts are involved.
Or: Another open heart surgery of the relationship resolver.
Problem
Have EnvironmentalVisualEnhancements with its default configs EnvironmentalVisualEnhancements-HR installed.
Now deselect EnvironmentalVisualEnhancements-HR and select AVP.
See this double error message:
The issue goes down to
MightBeInstallable()
returning false for any AstronomersVisualPack,because
LatestAvailableWithProvides()
can't find any provider forAVP-Textures
,because they all depend on AstronomersVisualPack again,
which
LatestAvailableWithProvides()
/AvailableModule.Latest()
sees as incompatibledue to the conflict with
EnvironmentalVisualEnhancements-HR
,which
AvailableModule.Latest()
doesn't know we're uninstalling.In short: We pass the list of actually installed modules to
AvailableModule.Latest()
instead of the theoretical one of theRelationshipResolver
.Another bug: our invocations of
FindRemovableAutoInstalled()
also try to remove mods that will be re-required by new mods we're about to install, so those mods get scheduled once for removal and once for reinstallation. Not a big problem, but preferably it shouldn't remove them in the first hand.And: If the install step in
MainInstall.InstallMods()
throws aTooManyModsProvide
kraken and it gets resolved by the user, it tries to start again from the beginning, re-trying to remove mods that have already been removed in the first round.Changes
The whole chain of
LatestAvailableWithProvides()
methods gets a new optionalinstalled
parameter, next totoInstall
. If given, it passes that one along toAvailableModule.Latest()
instead ofRegistry.InstalledModules
.Additionally,
MightBeInstallable()
passes the current source/parent of the stanza we're investigating astoInstall
LatestAvailableWithProvides()
, since it's not yet in the list of installed modules. Basically we assume that the stanza source is compatible when checking its dependencies. I don't think this was needed to fix the above bug, but it should help when force-installing outdated mods.I've written a unit test that models this relationship constellation. I'm actually quite proud of this one, it works really well. You can cherry-pick / checkout that commit on itself to see the test fail.
To fix
FindRemovableAutoInstalled()
staging removals of dependencies we need for new modules again, we concatenate the list of installed modules with the list of modules we're about to install, wrapped in pseudo-InstalledModule
s.And to fix the installation failure when
TooManyModsProvide
is thrown after the removal step, we clear the change lists after finishing them.