chocolatey / chocolatey/choco

Upgrade shouldn't run if package constraints resolve to the installed version

Open
#3,404 4 comments 4 reactions 0 assignees View on GitHub
0 - Triaging Bug ClickUp - Backlog
Dominant language
C#
Stars
11.5k
Forks
960
PR merge metrics
No merged PRs in 30d

Description

### Checklist

- [X] I confirm there are no unresolved issues reported on the [Chocolatey Status page](https://status.chocolatey.org).
- [X] I have verified this is the correct repository for opening this issue.
- [X] I have verified no other issues exist related to my problem.
- [X] I have verified this is not an issue for a specific package.
- [X] I have verified this issue is not security related.
- [X] I confirm I am using **official**, and **not** unofficial, or modified, Chocolatey products.

### What You Are Seeing?

```
>>> choco upgrade --yes --skip-if-not-installed dart-sdk

You have dart-sdk v3.3.0 installed. Version 3.3.1 is available based on your source(s).
[NuGet] One or more unresolved package dependency constraints detected in the Chocolatey lib folder. All dependency constraints must be resolved to add or update packages. If these packages are being updated this message may be ignored, if not the following error(s) may be blocking the current package operation: 'sass 1.71.1 constraint: dart-sdk (= 3.3.0)'
Re-attempting package dependency resolution using additional available package information...
[NuGet] One or more unresolved package dependency constraints detected in the Chocolatey lib folder. All dependency constraints must be resolved to add or update packages. If these packages are being updated this message may be ignored, if not the following error(s) may be blocking the current package operation: 'sass 1.71.1 constraint: dart-sdk (= 3.3.0)'
Progress: Downloading dart-sdk 3.3.0... 100%

dart-sdk v3.3.0 [Approved]
dart-sdk package files upgrade completed. Performing other installation steps.
```

### What is Expected?

```
>>> choco upgrade --yes --skip-if-not-installed dart-sdk

You have dart-sdk v3.3.0 installed. Version 3.3.1 is available based on your source(s).
[NuGet] One or more unresolved package dependency constraints detected in the Chocolatey lib folder. All dependency constraints must be resolved to add or update packages. If these packages are being updated this message may be ignored, if not the following error(s) may be blocking the current package operation: 'sass 1.71.1 constraint: dart-sdk (= 3.3.0)'
Re-attempting package dependency resolution using additional available package information...
[NuGet] One or more unresolved package dependency constraints detected in the Chocolatey lib folder. All dependency constraints must be resolved to add or update packages. If these packages are being updated this message may be ignored, if not the following error(s) may be blocking the current package operation: 'sass 1.71.1 constraint: dart-sdk (= 3.3.0)'

You already have dart-sdk v3.3.0 installed.
```

### How Did You Get This To Happen?

Installed `sass` package, that has fixed version of `dart-sdk` dependency.

Later, `dart-sdk` was updated, so my `choco outdated --ignore-pinned -r` listed it and passed to `choco upgrade --yes --skip-if-not-installed [packages]`. The same would happen with `choco upgrade --all --yes`.

The same happens when upgrading any package with newer available version, but constraints restricting it to the currently installed version.

### System Details

* Operating System: 10.0.22635.0
* Windows PowerShell version: 5.1.22621.2706
* Chocolatey CLI Version: 2.2.2
* Chocolatey Licensed Extension version: -
* Chocolatey License type: -
* Terminal/Emulator: cmder

### Installed Packages

```bash
sass
dart-sdk
```

### Output Log

https://gist.github.com/iki/7b10b95c0671c325f2c890355f39e739

### Additional Context

_No response_

┆Issue is synchronized with this [Clickup task](https://app.clickup.com/t/868j271up) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the shown `choco upgrade --yes --skip-if-not-installed dart-sdk` command after installing `sass` and `dart-sdk`. Trace the upgrade decision and dependency-resolution output for this case. Done means a package constrained to its installed version is not downloaded or upgraded, and the command reports that it is already installed.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.