Skip to content

[vcpkg-tool] vcpkg install fails if baseline is newer than reference #42293

@bansan85

Description

@bansan85

Describe the bug

You have a buggy vcpkg-configuration.json and a registry's kind git.

You wrongly set reference to a branch that is older than baseline.

vcpkg install will fails with error like:

error: no version database entry for catch2 at 3.7.0.
Available versions:
  3.1.0
...

Vcpkg reads versions/baseline.json at reference branch, then checkout at baseline and finally try to install latest package. Since baseline has versions that reference doesn't have, vcpkg complains.

Error is tricky so I think that vcpkg should check that baseline commit is not newer than master branch.

Failure logs

Log with --debug
[DEBUG] To include the environment variables in debug output, pass --debug-env
[DEBUG] Trying to load bundleconfig from D:\tmp\vcpkg-tool\build\Debug\vcpkg-bundle.json
[DEBUG] Failed to open: D:\tmp\vcpkg-tool\build\Debug\vcpkg-bundle.json
[DEBUG] Bundle config: readonly=false, usegitregistry=false, embeddedsha=nullopt, deployment=Git, vsversion=nullopt
[DEBUG] Metrics enabled.
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] Feature flag 'dependencygraph' unset
[DEBUG] Using scripts-root: D:\vcpkg\scripts
[DEBUG] Using builtin-ports: D:\vcpkg\ports
[DEBUG] Using installed-root: D:\repos\urx\build\vcpkg_installed
[DEBUG] Using buildtrees-root: D:\vcpkg\buildtrees
[DEBUG] Using packages-root: D:\vcpkg\packages
[DEBUG] Using manifest-root: D:\repos\urx
[DEBUG] Using vcpkg-root: D:\vcpkg
[DEBUG] Using builtin-registry: D:\vcpkg\versions
[DEBUG] Using downloads-root: D:\vcpkg\downloads
[DEBUG] External asset downloads are allowed (x-block-origin is disabled)...
[DEBUG] Asset cache is not configured.
[DEBUG] Detecting host with IsWow64Process2
[DEBUG] Found path: C:\Program Files\Git\cmd\git.exe
[DEBUG] 1000: CreateProcessW("C:\Program Files\Git\cmd\git.exe" --version)
[DEBUG] 1000: cmd_execute_and_stream_data() returned 0 after   110715 us
[DEBUG] 1001: CreateProcessW("C:\Program Files\Git\cmd\git.exe" "--git-dir=C:\Users\v.legarrec\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\v.legarrec\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false show 2f210a9c13fcf2b0c36b1f2187366feec37e3390:versions/baseline.json)
[DEBUG] 1001: cmd_execute_and_stream_data() returned 0 after   128683 us
[DEBUG] Failed to open: D:\repos\urx\build\vcpkg_installed\vcpkg\vcpkg-lock.json
[DEBUG] Failed to load lockfile: no such file or directory
Fetching registry information from d:/vcpkg/.git (HEAD)...
[DEBUG] 1002: CreateProcessW("C:\Program Files\Git\cmd\git.exe" "--git-dir=C:\Users\v.legarrec\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\v.legarrec\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false init)
[DEBUG] 1002: cmd_execute_and_stream_data() returned 0 after    94124 us
[DEBUG] 1003: CreateProcessW("C:\Program Files\Git\cmd\git.exe" "--git-dir=C:\Users\v.legarrec\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\v.legarrec\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false fetch --update-shallow -- d:/vcpkg/.git HEAD)
[DEBUG] 1003: cmd_execute_and_stream_data() returned 0 after  1920715 us
[DEBUG] 1004: CreateProcessW("C:\Program Files\Git\cmd\git.exe" "--git-dir=C:\Users\v.legarrec\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\v.legarrec\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false rev-parse FETCH_HEAD)
[DEBUG] 1004: cmd_execute_and_stream_data() returned 0 after    67406 us
[DEBUG] 1005: CreateProcessW("C:\Program Files\Git\cmd\git.exe" "--git-dir=C:\Users\v.legarrec\AppData\Local\vcpkg\registries\git\.git" "--work-tree=C:\Users\v.legarrec\AppData\Local\vcpkg\registries\git" -c core.autocrlf=false rev-parse 46798970f06b38f255953864e3a5a5e2045b7e66:versions)
[DEBUG] 1005: cmd_execute_and_stream_data() returned 0 after    77921 us
[DEBUG] Loading dep info for: urx:x64-wsmep
[DEBUG] Found path: C:\Program Files\CMake\bin\cmake.exe
[DEBUG] 1006: CreateProcessW("C:\Program Files\CMake\bin\cmake.exe" --version)
[DEBUG] 1006: cmd_execute_and_stream_data() returned 0 after    86724 us
[DEBUG] 1007: CreateProcessW("C:\Program Files\CMake\bin\cmake.exe" -DVCPKG_ROOT_DIR=D:/vcpkg -DPACKAGES_DIR=D:/vcpkg/packages -DBUILDTREES_DIR=D:/vcpkg/buildtrees -D_VCPKG_INSTALLED_DIR=D:/repos/urx/build/vcpkg_installed -DDOWNLOADS=D:/vcpkg/downloads -DVCPKG_MANIFEST_INSTALL=OFF -P "D:\vcpkg\buildtrees\0.vcpkg_dep_info.cmake")
[DEBUG] 1007: cmd_execute_and_stream_data() returned 0 after    60233 us
error: no version database entry for catch2 at 3.7.0.
Available versions:
  3.1.0
  3.0.1#2
  3.0.1#1
  3.0.1
  2.13.9#1
  2.13.9
  2.13.8#1

Additional context

In my case, I cloned vcpkg locally (in d:/vcpkg) to speedup fetching.

My problem is that I fetched but I don't checkout -B main origin/main so my reference branch became older than my baseline commit.

Metadata

Metadata

Assignees

Labels

category:vcpkg-featureThe issue is a new capability of the tool that doesn’t already exist and we haven’t committed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions