Skip to content

Problems updating packages with existing dependencies pushed by previous versions of Chocolatey (probably due to SemVer v2 enforcement since choco v2) #3499

@lebarsfa

Description

@lebarsfa

Checklist

  • I confirm there are no unresolved issues reported on the Chocolatey Status page.
  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • I confirm I am using official, and not unofficial, or modified, Chocolatey products.

What You Are Seeing?

https://community.chocolatey.org/packages/libopencv-dev/4.5.4.20240807#versionhistory is saying "Waiting on dependencies" forever. The changes in the package are only links and corresponding checksums in chocolateyInstall.ps1.
This seems linked to a silent change made by choco pack that removes leading 0 in its mingw dependency version numbers.
A possible workaround seems to pack with an older version of choco, e.g. v1.4.0.

What is Expected?

Ideally, providing minor fixes to existing packages should be as easy as possible.

How Did You Get This To Happen?

EDIT 2024-08-14: some of the mentioned links may have been updated in the meantime.

I was trying to do:

choco push libopencv-dev.4.5.4.20240807.nupkg

which returned success, I received a confirmation e-mail but the status on https://community.chocolatey.org/packages/libopencv-dev/4.5.4.20240807#versionhistory was saying "Waiting on dependencies" and did not seem to change while other packages I submitted near the same time seemed to follow the usual procedure.

So, I looked below on the page and saw "mingw (= 11.2.0.7112021)" in the dependencies and clicked on the underlying link (https://community.chocolatey.org/packages/mingw/11.2.0.7112021) which said 404 error. Indeed, the version I needed was 11.2.0.07112021 (with leading 0), as still correctly listed on https://community.chocolatey.org/packages/libopencv-dev/4.5.4.20240203#dependencies , which is the previous version of the package for which I want to provide a fix.

I checked my libopencv-dev.nuspec and it was correctly showing 11.2.0.07112021 but after choco pack and extraction of the resulting .nupkg, I see that choco pack changes 11.2.0.07112021 to 11.2.0.7112021 in the .nuspec, hence the problems.

Then, I realized that it was probably since Chocolatey v2 that versions are corrected and the last time I used choco pack for a package with dependency "mingw (= 11.2.0.07112021)" was probably with Chocolatey v1.4.0.
So, I prepared a virtual machine, installed choco, and then downgraded it:

choco upgrade -y chocolatey --version=1.4.0 --allow-downgrade

Then, I packed https://community.chocolatey.org/packages/libopencv-dev/4.10.0 (which also had the same problems) with that version of choco and pushed from my main computer which has choco v2.2.2 and I do not see problems up to now.

Is there a better solution for this type of problem?

System Details

  • Operating System: Windows 10
  • Windows PowerShell version: default
  • Chocolatey CLI Version: 2.3.0, 2.2.2
  • Chocolatey Licensed Extension version:
  • Chocolatey License type:
  • Terminal/Emulator: CMD

Installed Packages

N/A

Output Log

N/A

Additional Context

I took note of these issues when searching for a solution:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No Response / StaleUsed on issues when additional information is requested, and no response has been given.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions