microsoft / vcpkg

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

Versioning fails to find new port-version when some port versions are missing. #39613

Open Happlo opened 3 days ago

Happlo commented 3 days ago

Describe the bug I have a private registry where I have copied some ports from the official registry and mirrored the source of the ports to internal repositories. (I think I read that this was a recommended approach somewhere but I cannot find where I read this anymore). Now when I wanted to copy the some boost packaged I am struck with the following issue trying to build boost-cmake (which has a dependency to boost-uninstall)

error: no version database entry for boost-uninstall at 1.85.0.
Available versions: 
    1.85.0#1

The dependency looks from boost-cmake looks like this:

...
  "dependencies": [
    {
      "name": "boost-uninstall",
      "version>=": "1.85.0"
    },
...

The issue seems to be that I don't have any port-version 0.

Since I copied boost-uninstall from the official registry to my private registry with port-version 1 I don't have any port-version 0.

If this is how it is supposed to work then this issue can be closed, but I would expect the x-add-version command to complain about missing port-version but this seems to work fine:

vcpkg x-add-version --all --x-builtin-ports-root=ports --x-builtin-registry-versions-dir=versions

Environment

To Reproduce Steps to reproduce the behavior:

  1. Create a private registry
  2. Copy all ports that boost-cmake is dependent on to the new private registry
  3. Copy boost-cmake port to the new private registry
  4. Try to build boost-cmake

Expected behavior Successful build

Failure logs

error: no version database entry for boost-uninstall at 1.85.0.
Available versions: 
    1.85.0#1

Additional context It I set the port version to 0 it works fine but I want to have the same port version as the official registry since it makes it easy for automated scripts to check if the port has been updated.

Happlo commented 3 days ago

I have now created a new registry here: https://github.com/Happlo/vcpkg-issue-39613

To Reproduce

  1. Create a folder and add the following to files: vcpkg.json:
    
    {
    "dependencies": [
    "boost-cmake"
    ]
    }
vcpkg-configuration.json:

{ "default-registry": { "kind": "git", "baseline": "17077355419c3a9fee7f9ced4f69db620e20048f", "repository": "https://github.com/Happlo/vcpkg-issue-39613" } }



2. Install
`vcpkg install`