Replies: 3 comments
-
Sorry for the noise, I just saw https://docs.chocolatey.org/en-us/create/create-packages/#testing-your-package , which proposes to use The only remaining thing to check would be the behavior I describe with just |
Beta Was this translation helpful? Give feedback.
-
If you have a suggestion for the docs, open an issue here: https://github.com/chocolatey/docs |
Beta Was this translation helpful? Give feedback.
-
I think @TheCakeIsNaOH is right, your issue seems to be with the docs rather than Chocolatey CLI itself (and frankly, it doesn't seem like a "bug" in any case). I can transfer this over to the docs repo, or convert it to a discussion where we can chat about debugging packages. I'll admit my package-testing workflow differs a bit from the docs, at least partially in that I have a test source setup which mitigates this issue. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Checklist
What You Are Seeing?
I am not sure of what should be done to debug efficiently packages that have dependencies, and there were possibly confusing behaviors.
Sorry if it has been already discussed somewhere that I missed.
What is Expected?
Simplify/Clarify the debug method for packages with dependencies.
How Did You Get This To Happen?
In https://docs.chocolatey.org/en-us/create/create-packages-quick-start/#test-the-package , it is suggested to run
in a virtual machine, which, I guess, should be ideally clean with only the latest version of choco installed.
However, this command appears to immediately fail if the package has dependencies.
A first idea could be to first install a previous online version of the package but this would not help fully testing the behavior of the package version we want to debug (since often just uninstalling the previous version does not fully set back to the situation where the package itself was not yet installed while its dependencies were just installed), also previous online version of the package might not exist yet for a new package id.
A second idea could be to use
and just
choco install package-name
in the folder with the package version we want to debug.
Everything appears to install as expected, however it turned out it was not the package in my folder that was installed but instead the online version currently in moderation, which could be confusing (both have the same version, but are theoretically different in this edge case). At first sight, I would have expected either the latest approved version would be installed, or, ideally, the one in my folder (it seems it was correctly doing that with choco v1.4.0), but never the one currently in moderation (I confirm I did not use the
--version
parameter). Therefore I end up with similar drawbacks as the first idea.Then, I realized that there was a concept of priorities for sources:
and tried
together with
choco install package-name
which appeared to correctly install the package from the folder, with all the dependencies from online.
A third idea could be to manually install all dependencies of the package we want to debug, before running
choco install package-name --source .
. Maybe it is the most reliable, although it can be tedious in case a package has many dependencies with exact versions to specify for each.Am I doing it wrong?
System Details
Installed Packages
Output Log
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions