Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[BUG] Package depending on newer Chocolatey is installed using existing Chocolatey #460
In other words, package dependency on a certain (newer) Chocolatey version is not fully taken into account when installing that package.
Consider this scenario:
The problem is that the last step is performed by the already running Chocolatey version X, not the updated Y. As a consequence, features from Chocolatey Y are unavailable and installation of package P fails.
A concrete example:
Here is a link to a transcript from my test.
The problem is that although Chocolatey files are updated, the old state is still present in PowerShell memory. In particular, already loaded Chocolatey modules do not include functions that were added in the updated Chocolatey.
A few approaches to solving this problem come to mind:
The above notwithstanding, chocolatey.ps1 should clean up after itself when it finishes, i.e. remove the modules.
Hmm, can't find any mention of it, neither on Github, nor on the mailing list.
I could take a stab at implementing option 2) some time next week and see if it fixes this issue and possibly #459. Not a bullet-proof solution, but perhaps good enough, and with C#-Choco around the corner it seems unfeasible to put much work into PS-Choco.
…atey is installed using existing chocolatey" During install/upgrade force the module to be imported, which will refresh the functions and all new commands and versions will be available when the install is called on an item later depending on the newer version.
* stable: (chocolatey-archiveGH-460) Fix for "Package depending on newer chocolatey is installed using existing chocolatey" (chocolatey-archiveGH-459) Fix for "Cannot find Update-SessionInformation" (maint) formatting (chocolatey-archiveGH-153)(chocolatey-archiveGH-134) Update PATH on cmd.exe (maint) ensure powershell module loading preference is on