microsoft / microsoft/winget-cli

Support for "or" dependencies.

Open
#1,789 6 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Manifest 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

I would like to be able to express that multiple different packages could be used to fufill a dependency. If an application relies on the OpenJDK, it is unlikely that it would rely on a specific vendor's implementation, and we shouldn't install a different version if the user already has one. Similarly, ReSharper (and other developer tools) rely on any version of Visual Studio being installed, but under the current system we could only express a single version and edition combination.

Proposed technical implementation details

One implementation could be that the dependencies key in the manifest could accept arrays of package id/version combinations in addition to single dependencies, where any value in the array would satisfy the dependency. For example:

# ...
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
    - PackageIdentifier: Microsoft.VisualStudio.2019.Professional
    - PackageIdentifier: Microsoft.VisualStudio.2019.Enterprise
    - PackageIdentifier: Microsoft.VisualStudio.2022.Community
    - PackageIdentifier: Microsoft.VisualStudio.2022.Professional
    - PackageIdentifier: Microsoft.VisualStudio.2022.Enterprise

The YAML "array of arrays" syntax isn't awesome, so maybe this isn't the best method.

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

Start by tracing how manifest Dependencies.PackageDependencies are represented and resolved, especially where a single package dependency is validated. Compare that flow with the proposed alternatives and define an unambiguous manifest shape and completion criteria; the issue names no source file or test to run.

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
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.