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

Support alternative dependency #2103

Open
stevapple opened this issue Apr 18, 2022 · 5 comments
Open

Support alternative dependency #2103

stevapple opened this issue Apr 18, 2022 · 5 comments
Labels
Dependencies Related to package level dependencies Issue-Feature This is a feature request for the Windows Package Manager client.
Milestone

Comments

@stevapple
Copy link

Description of the new feature / enhancement

Some of the packages are known to be conflicted (eg. Microsoft.VC++2015-2022Redist-x64 and Microsoft.VC++2015-2019Redist-x64), but we can only specify one of them in the manifest, and users with another installed cannot successfully upgrade or install our package.

Proposed technical implementation details

We have several means of resolving this:

  • One is to let the library specify its possible alternatives in its manifest, so Microsoft.VC++2015-2019Redist-x64 can indicate that it's replaceable by Microsoft.VC++2015-2022Redist-x64. When the user try to install a package that depends on Microsoft.VC++2015-2019Redist-x64, winget scans if any of the alternatives is installed, and skip installing Microsoft.VC++2015-2019Redist-x64 accordingly.
  • A slightly different way is to let the package specify the package it can replace, so Microsoft.VC++2015-2022Redist-x64 can indicate that it's capable of replacing Microsoft.VC++2015-2019Redist-x64. winget will regard Microsoft.VC++2015-2019Redist-x64 as installed as long as Microsoft.VC++2015-2022Redist-x64 is installed.
  • The safest solution is let the dependent application to specify a list of alternative. When the application is being installed, winget will check the alternatives besides the default dependency. If none of them is installed, winget will kick off installing the default one.
@stevapple stevapple added the Issue-Feature This is a feature request for the Windows Package Manager client. label Apr 18, 2022
@ghost ghost added the Needs-Triage Issue need to be triaged label Apr 18, 2022
@jedieaston
Copy link
Contributor

Do you think that the proposal in #1789 would resolve this problem? Several packages that each would satisfy the same dependency.

@stevapple
Copy link
Author

stevapple commented Apr 18, 2022

@jedieaston I think that’s almost the third option I proposed — but I believe there should be a primary (in other word, recommended) one, which winget will pick up when neither of the alternatives matches.

@denelon denelon removed the Needs-Triage Issue need to be triaged label Apr 18, 2022
@denelon
Copy link
Contributor

denelon commented Apr 18, 2022

We've been discussing the best way to handle determining which of a collection of dependencies to install if none are present. One of our goals is to support unattended "import" scenarios. This scenario is one of the more complex ones due to dependencies like language runtimes that may have different licensing concerns.

@stevapple
Copy link
Author

My preferred manifest layout would be:

# ...
Dependencies:
  PackageDependencies:
  - PackageIdentifier: Microsoft.VC++2013Redist-x64
    MinimumVersion: 12.0.30501.0
  - PackageIdentifier: Microsoft.VC++2013Redist-x86
    MinimumVersion: 12.0.30501.0
  - PackageIdentifier: Microsoft.VisualStudio.2019.Community
    MinimumVersion: 16.11.0
    Alternatives:
    - PackageIdentifier: Microsoft.VisualStudio.2019.Professional
      MinimumVersion: 16.11.0
    - PackageIdentifier: Microsoft.VisualStudio.2019.Enterprise
      MinimumVersion: 16.11.0
    - PackageIdentifier: Microsoft.VisualStudio.2022.Community
    - PackageIdentifier: Microsoft.VisualStudio.2022.Professional
    - PackageIdentifier: Microsoft.VisualStudio.2022.Enterprise

The easiest way is to let the application vendor decide the recommended option, which some of them are already doing in official documents or installation guides. In my scenario this just works. However, I do understand that there could be more complicated needs (license for example).

@Trenly
Copy link
Contributor

Trenly commented Jun 16, 2023

[Policy] Dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependencies Related to package level dependencies Issue-Feature This is a feature request for the Windows Package Manager client.
Projects
None yet
Development

No branches or pull requests

4 participants