When upgrading packages where a long dependency tree is in play, the package upgrade order doesn't respect the dependency tree that is involved. For example:
Package E depends on Package D
Package D depends on Package A
Package C depends on Package B and Package A
Package B depends on Package A
The ideal installation order would be:
Package A
Package B
Package C
Package D
Package E
However, there are cases we have seen where Package C is upgraded first, which causes problems due to the chocolateyBeforeModify.ps1 file causing application to be restarted and then failing restart due to dependency not first being installed.
What is Expected?
The chosen order of the packages that are being upgraded should respect the dependencies of the packages that are being touched. For example, if Package B depends on Package A, then Package A should be acted on first, before anything is done with Package B. And this should be true for all packages within the dependency tree.
How Did You Get This To Happen? (Steps to Reproduce)
With the above packages in play, perform the operation choco upgrade PackageA (NOTE: This scenario really comes into play when performing an upgrade on packages which use a version range, and you are crossing the major version range when upgrading the packages. i.e. installed packages have a range similar to [1.2.0, 1.999.999] and you are attempting to upgrade to version 2.0.0 of the package.
System Details
OS Build (In PowerShell run [System.Environment]::OSVersion.version.tostring()): Windows 10
Windows PowerShell version (Run: $PSVersionTable): PSv5
Chocolatey version (Run choco --version): Choco vNext
What You Are Seeing?
When upgrading packages where a long dependency tree is in play, the package upgrade order doesn't respect the dependency tree that is involved. For example:
Package E depends on Package D Package D depends on Package A Package C depends on Package B and Package A Package B depends on Package A
The ideal installation order would be:
Package A Package B Package C Package D Package E
However, there are cases we have seen where Package C is upgraded first, which causes problems due to the
chocolateyBeforeModify.ps1
file causing application to be restarted and then failing restart due to dependency not first being installed.What is Expected?
The chosen order of the packages that are being upgraded should respect the dependencies of the packages that are being touched. For example, if Package B depends on Package A, then Package A should be acted on first, before anything is done with Package B. And this should be true for all packages within the dependency tree.
How Did You Get This To Happen? (Steps to Reproduce)
With the above packages in play, perform the operation
choco upgrade PackageA
(NOTE: This scenario really comes into play when performing an upgrade on packages which use a version range, and you are crossing the major version range when upgrading the packages. i.e. installed packages have a range similar to[1.2.0, 1.999.999]
and you are attempting to upgrade to version 2.0.0 of the package.System Details
[System.Environment]::OSVersion.version.tostring()
): Windows 10$PSVersionTable
): PSv5choco --version
): Choco vNextOutput Log
N/A
Related Issues
https://github.com/chocolatey/choco/issues/508