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

[Bug] CmdLine can't skip virtual recommendations #3477

Open
HebaruSan opened this issue Nov 14, 2021 · 0 comments
Open

[Bug] CmdLine can't skip virtual recommendations #3477

HebaruSan opened this issue Nov 14, 2021 · 0 comments
Labels
Bug Cmdline Issues affecting the command line Core (ckan.dll) Issues affecting the core part of CKAN Relationships Issues affecting depends, recommends, etc.

Comments

@HebaruSan
Copy link
Member

HebaruSan commented Nov 14, 2021

Background

By default, ckan install tries to install recommendations but skips them if they're incompatible (because apt-get does it that way). You can use the --no-recommends option to ignore recommendations.

Problem

EnvironmentalVisualEnhancements recommends EnvironmentalVisualEnhancements-Config, which is provided by several modules. This means it should be possible to install that module without the recommendation. When the prompt appears, the user can pick c or n to choose none of the above. However, this aborts the entire installation rather than skipping the recommendation:

$ ckan install EnvironmentalVisualEnhancements
Module EnvironmentalVisualEnhancements-Config is provided by more than one available module. Please choose one of the following:
1) AstronomersVisualPack (Astronomer's Visual Pack)
2) EnvironmentalVisualEnhancements-HR (Environmental Visual Enhancements - Stock Planet Config files)
3) GPPCloudsHighRes (GPP HighRes clouds)
4) GPPCloudsLowRes (GPP LowRes clouds)
5) RSSVE-HR (RSS Visual Enhancements - High Resolution)
6) RSSVE-LR (RSS Visual Enhancements - Low Resolution)
7) Spectra (Spectra)
Enter a number between 1 and 7 (To cancel press "c" or "n".): 
n
Selection cancelled.

In effect this treats virtual recommendations as required rather than optional (which is not how it works for normal recommendations, because if they're incompatible or not found, they're just skipped rather than causing the install to fail). For recommendations, "none of the above" should be a valid option.

Obviously this is fairly unimportant because many more users use GUI (and even ConsoleUI), and virtual recommendations are not very common.

Causes

  • The RelationshipResolver throws TooManyModsProvideKraken in this case just like for depends, and the UI has no way to know the difference
  • Even if the UI knew it wanted to continue the installation without this recommendation, there is no way to make the RelationshipResolver do that, because its inputs are only the modules to install and remove, a RelationshipResolverOptions object, the registry, and the compatible game versions:
    /// <summary>
    /// Creates a new resolver that will find a way to install all the modules specified.
    /// </summary>
    /// <param name="modulesToInstall">Modules to install</param>
    /// <param name="modulesToRemove">Modules to remove</param>
    /// <param name="options">Options for the RelationshipResolver</param>
    /// <param name="registry">CKAN registry object for current game instance</param>
    /// <param name="GameVersion">The current KSP version criteria to consider</param>
    public RelationshipResolver(IEnumerable<CkanModule> modulesToInstall, IEnumerable<CkanModule> modulesToRemove, RelationshipResolverOptions options, IRegistryQuerier registry,
    GameVersionCriteria GameVersion)

    There is no way to express "ignore this recommendation" using that interface.

Suggestions

I guess the RelationshipResolver should accept recommendations to skip as a new input, and CmdLine should populate that input when the user selects c or n for a recommendation.

@HebaruSan HebaruSan added Bug Cmdline Issues affecting the command line Core (ckan.dll) Issues affecting the core part of CKAN Relationships Issues affecting depends, recommends, etc. labels Nov 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Cmdline Issues affecting the command line Core (ckan.dll) Issues affecting the core part of CKAN Relationships Issues affecting depends, recommends, etc.
Projects
None yet
Development

No branches or pull requests

1 participant