microsoft / vcpkg

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

Manifest mode - misleading listing of available versions for a dependency #41937

Open Crzyrndm opened 3 weeks ago

Crzyrndm commented 3 weeks ago

Image In manifest mode, entering an invalid version spec results in printing a list of potentially valid versions. This is mostly great, however it is misleading. While all the listed versions are indeed valid version specifications, it may be only some of them are usable because the current baseline sets a version floor.

This behaviour is non-obvious to those unused to how vcpkg works and this is not helped by the fact that getting a list of resolved versions in a short and readable manner is surprisingly difficult

There are several issues at play here but I will focus on the misleading "available versions" text.

dg0yt commented 3 weeks ago

While all the listed versions are indeed valid version specifications, it may be only some of them are usable because the current baseline sets a version floor.

AFAICT the baseline sets a version default, not a version floor. And the git HEAD sets a ceiling.

Choosing lower versions (via overrides) is more likely to choose unbuildable configurations. So marking the baseline can add value indeed. (And for all other version, printing the ref as a baseline alternative could be useful, too. But this would add much more output.)

Crzyrndm commented 3 weeks ago

While all the listed versions are indeed valid version specifications, it may be only some of them are usable because the current baseline sets a version floor.

AFAICT the baseline sets a version default, not a version floor. And the git HEAD sets a ceiling.

For a git registry at least (not submodule. I have private deps), my testing shows it to be a version floor, not just the default. Lower versions are only accessible through overrides

Either way, the behaviour is significantly non-obvious and some additional details are needed in a few places

dg0yt commented 3 weeks ago

Lower versions are only accessible through overrides

Sure. AFAICT version>= and overrides is what is offered in addition to the baseline.

Your initial post doesn't make it explicit because it doesn't show an extract from the manifest. Let me try to elaborate: