chocolatey / choco

Chocolatey - the package manager for Windows
https://chocolatey.org
Other
10.04k stars 890 forks source link

Improve package dependency lookup when an exact version is defined #3433

Closed AdmiringWorm closed 2 months ago

AdmiringWorm commented 2 months ago

Checklist

Is Your Feature Request Related To A Problem? Please describe.

When a package has dependencies and we are installing these, the dependencies are looked up by querying all of the available versions for those dependencies.

This causes unnecessary length of time and issues in some cases.

An additional problem is that when the package being installed has a dependency on a package in the moderation queue or Chocolatey Community Repository, where the package attempted to be installed is approved/exempted, but the dependency has not been approved/exempted, the installation will fail because of this. Even when a specific version is attempted.

Describe The Solution. Why is it needed?

We should update the dependency lookup to be a bit smarter.

When a version range with an inclusive upper limit is specified, then attempt to look up this exact version first. This would cover both inclusive upper limits, and exact version ranges so we do not have to do additional larger queries.

If there is no upper limit then we should attempt to look up the absolute latest version of the package (stable or pre-release dependending on configuration).

When an exclusive upper limit is used, or if the previous two checks fails it should fall back to the grabbing all the available versions of the dependency.

Additional Context

N/A

Related Issues

No response

choco-bot commented 3 weeks ago

:tada: This issue has been resolved in version 2.3.0 :tada:

The release is available on:

Your GitReleaseManager bot :package: :rocket: