winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Virtual Packages

Open tats-u opened this issue 1 year ago • 4 comments

Description of the new feature / enhancement

For example, there are many OpenJDK flavors:

  • Oracle.JDK.21
  • EclipseAdoptium.Temurin.21.JDK
  • Microsoft.OpenJDK.21
  • Azul.Zulu.21.JDK
  • BellSoft.LibericaJDK.21
  • BellSoft.LibericaJDK.21.Full
  • Amazon.Corretto.21

For packages that depend on OpenJDK 21, they do not have to tell the identity of the JDK that has already been installed in the system. Winget packages that depend on OpenJDK try to install Microsoft.OpenJDK even though another JDK has already been installed. We have to make them depend on another package that does not depend on a specific OpenJDK flavor instead of Microsoft.OpenJDK.

Proposed technical implementation details

  • Provides a package named VirtualPackage.OpenJDK.21.SDK as an example
  • Let the above packages provide it.
  • If the user tries to install another package that depends on VirtualPackage.OpenJDK.21.SDK and has installed at least one of OpenJDK 21 flavors before, no additional packages are installed.
  • If not installed yet, the one most recommended by the virtual package definition (Microsoft.OpenJDK.21?) will be installed.

A similar system has been available in Ubuntu. (no most recommended package feature is not implemented)

tats-u avatar Jan 17 '24 13:01 tats-u

Related to:

  • #1789

denelon avatar Jan 17 '24 15:01 denelon

@denelon We have to rewrite every version of OpenJDK packages when a new version is released. We have to add a new OpenJDK flavor that has just been available to every package that depends on OpenJDK.

tats-u avatar Jan 18 '24 09:01 tats-u

Also related to -

  • #2969

Trenly avatar Jan 18 '24 13:01 Trenly

@Trenly It lacks how most recommended one is suggested. Non-advanced users should not know it. It is not kind to neglect to suggest a concrete package name.

tats-u avatar Jan 19 '24 15:01 tats-u