-
Notifications
You must be signed in to change notification settings - Fork 905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
choco uninstall all does not honor dependencies #1822
Comments
Does it error when it goes the wrong way? |
@ferventcoder as choco currently first uninstalls the extension, the POSH module and it’s commands are removed before the uninstallation of the vscode add-on package. In the add-on uninstaller, the one of the POSH module commandlets is used to remove the add-on from vscode. |
@ferventcoder I’ll try to make a gist soon. |
@ferventcoder https://gist.github.com/mkevenaar/9461720e59305b0b6602bda880fe2147 On line 554 you'll see the error message that /cc: @gep13 |
Oh I think I understand. The packages required extensions in other packages that were removed first. So I don't think NuGet supports dependency order by default - you can force dependencies on uninstall if you want it to attempt proper order. |
@ferventcoder When you have things setup as mentioned above, and try to run |
@mkevenaar that is correct behavior. You need to uninstall things in the proper order. Which is about what this issue is. What happens if you run |
@ferventcoder that was not the point I was trying to make here. I think this might be the location of the problem: choco/src/chocolatey/infrastructure.app/services/NugetService.cs Lines 1441 to 1447 in 17f00eb
|
Do you think removing the force dependencies would work? Something we could do without #508 |
I think this needs to be tested, but it might work. |
Solution: When you specify "all", chocolatey grabs packages from here:
The list "packagesToUpdate" needs to be ordered according to dependency flow. This can be done via Topological sorting using depth-first search (DFS) algorithm. |
What You Are Seeing?
choco uninstall all -y
uninstalling all on alphabetWhat is Expected?
Uninstalling honoring the dependencies
How Did You Get This To Happen? (Steps to Reproduce)
NOTE Only try this on the chocolatey-test-environment or a test machine!
choco install ci-cd-assets-vscode
choco uninstall all -y
I would expect that it would uninstall
ci-cd-assets-vscode
chocolatey-vscode.extension
vscode
Actual order is 2,1,3 (including chocolatey, as expected)
The text was updated successfully, but these errors were encountered: