This repository has been archived by the owner on Feb 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 344
[BUG] Package depending on newer Chocolatey is installed using existing Chocolatey #460
Labels
Comments
Yes! |
I knew of this issue. I thought we already had a discussion or this put up as an enhancement/bug (depends on your perspective, I consider it a bug). |
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. |
Pretty sure I fixed this issue by reimporting the module during upgrade. :) |
Fixed in 54fca9b |
ferventcoder
added a commit
to ferventcoder/chocolatey
that referenced
this issue
Jun 16, 2014
…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.
ferventcoder
added a commit
to ferventcoder/chocolatey
that referenced
this issue
Jun 16, 2014
* 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
In other words, package dependency on a certain (newer) Chocolatey version is not fully taken into account when installing that package.
Consider this scenario:
cinst P
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:
elevate.native
uses theGet-ProcessorBits
helper introduced in Chocolatey 0.9.8.21 and specifies a dependency on that Chocolatey version,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.
This is clearly visible in my transcript: installation attempts fail until I manually unload Chocolatey modules, after that the package is installed successfully.
A few approaches to solving this problem come to mind:
cup
first. Probably quickest to implement, but not exactly user friendly.The above notwithstanding, chocolatey.ps1 should clean up after itself when it finishes, i.e. remove the modules.
The text was updated successfully, but these errors were encountered: