Skip to content
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

[vcpkg] Warn on unmatched removal with reasonable alternative #11083

Merged

Conversation

ras0219-msft
Copy link
Contributor

This PR causes vcpkg to warn if the user attempts to remove a package that is not installed, but has the same port installed in a different triplet.

Before:

> ./vcpkg remove zlib:x64-windows --dry-run
The following packages are not installed, so not removed:
    zlib:x64-windows

> ./vcpkg remove zlib:x86-windows --dry-run
The following packages will be removed:
  * cpprestsdk:x86-windows
    zlib:x86-windows
Additional packages (*) need to be removed to complete this operation.
If you are sure you want to remove them, run the command with the --recurse option

After:

> .\toolsrc\out\build\x64-Release\vcpkg remove zlib:x64-windows --dry-run
The following packages are not installed, so not removed:
    zlib:x64-windows
Another installed package matches the name of an unmatched request. Did you mean zlib:x86-windows?
Another installed package matches the name of an unmatched request. Did you mean zlib:arm64-windows?
Another installed package matches the name of an unmatched request. Did you mean zlib:x64-uwp?

> .\toolsrc\out\build\x64-Release\vcpkg remove zlib:x86-windows --dry-run
The following packages will be removed:
  * cpprestsdk:x86-windows
    zlib:x86-windows
Additional packages (*) need to be removed to complete this operation.
If you are sure you want to remove them, run the command with the --recurse option

Additionally, I have deprecated the (relatively) undocumented "purge" feature and removed extraneous messages to reduce noise.

Yes

@ras0219-msft ras0219-msft added the info:internal This PR or Issue was filed by the vcpkg team. label Apr 29, 2020
@ras0219-msft ras0219-msft self-assigned this Apr 29, 2020
@ras0219-msft ras0219-msft merged commit 3ae3bd3 into microsoft:master Apr 30, 2020
strega-nil pushed a commit to strega-nil/vcpkg that referenced this pull request May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info:internal This PR or Issue was filed by the vcpkg team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants