-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Comments
Do you think that the proposal in #1789 would resolve this problem? Several packages that each would satisfy the same dependency. |
@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 |
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. |
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). |
[Policy] Dependencies |
Description of the new feature / enhancement
Some of the packages are known to be conflicted (eg.
Microsoft.VC++2015-2022Redist-x64
andMicrosoft.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:
Microsoft.VC++2015-2019Redist-x64
can indicate that it's replaceable byMicrosoft.VC++2015-2022Redist-x64
. When the user try to install a package that depends onMicrosoft.VC++2015-2019Redist-x64
,winget
scans if any of the alternatives is installed, and skip installingMicrosoft.VC++2015-2019Redist-x64
accordingly.Microsoft.VC++2015-2022Redist-x64
can indicate that it's capable of replacingMicrosoft.VC++2015-2019Redist-x64
.winget
will regardMicrosoft.VC++2015-2019Redist-x64
as installed as long asMicrosoft.VC++2015-2022Redist-x64
is installed.winget
will check the alternatives besides the default dependency. If none of them is installed,winget
will kick off installing the default one.The text was updated successfully, but these errors were encountered: