microsoft / microsoft/winget-cli

Support alternative dependency

Open
#2,103 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dependencies Issue-Feature
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named in the issue. Start by clarifying which of the three alternative-dependency models should be pursued and then locate the manifest and dependency-resolution areas. Done means the selected model is specified and its behavior is covered for conflicting packages.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.