microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.38k stars 6.46k forks source link

[vcpkg remove] Can't remove package if overlay-triplet doesn't exist anymore. #25442

Closed olafurw closed 1 year ago

olafurw commented 2 years ago

Describe the bug If I install a package with a custom triplet and --overlay-triplet and then remove the triplet file, I can't remove the package.

Environment

To Reproduce Install a package with a custom triplet and --overlay-triplet=somepath Then delete/rename the file. Then try to remove the package.

Expected behavior If I know the full package name I should be able to remove it.

Failure logs

C:\Users\olafu\source\vcpkg>vcpkg list raylib
raylib:raylib-framerate                            4.0.0#3          A simple and easy-to-use library to enjoy videog...
raylib[use-audio]:raylib-framerate                                  Build raylib with audio module

Ok then I try to remove raylib.

C:\Users\olafu\source\vcpkg>vcpkg remove raylib
The following packages are not installed, so not removed:
    raylib:x86-windows
Another installed package matches the name of an unmatched request. Did you mean raylib:raylib-framerate?
Removing 1/1 raylib:x86-windows

Sure, I can remove that triplet.

C:\Users\olafu\source\vcpkg>vcpkg remove raylib:raylib-framerate
Error: invalid triplet: raylib-framerate
Available architecture triplets
VCPKG built-in triplets:
  arm-uwp
  arm64-windows
  ... // continues on, listing all the normal triplets, not including raylib-framerate

I even try the folder that used to have the custom triplet.

C:\Users\olafu\source\vcpkg>vcpkg remove raylib:raylib-framerate --overlay-triplets="c:\Users\olafu\source\repos\chain-reaction"
Error: invalid triplet: raylib-framerate
Available architecture triplets
VCPKG built-in triplets:
  arm-uwp
  arm64-windows
  ... // continues on, listing all the normal triplets, not including raylib-framerate

If I put the file back it works.

JackBoosY commented 2 years ago

I'm not clear this should be feature or bug., marked vcpkg-feature temporary. cc @BillyONeal

BillyONeal commented 2 years ago

In general, I think remove should not be looking at the inputs (ports, triplets, etc.) at all. If it exists in the installed tree, it should be removable.

It is certainly in the gray area between bug and feature.

BillyONeal commented 2 years ago

@ras0219-msft tells me that the installed database should have that information so it should be doable, yes.

olafurw commented 1 year ago

❤️

dg0yt commented 1 year ago

~deleted~ I see, overlay triplet.

BillyONeal commented 1 year ago

Was fixed in https://github.com/microsoft/vcpkg/pull/32885