Skip to content
Latchkey

vcpkg baseline "does not match" error in CI

Manifest mode pins a builtin-baseline commit that vcpkg uses to resolve port versions. If the vcpkg registry checkout does not contain that commit, vcpkg cannot check it out and reports a baseline mismatch.

What this error means

vcpkg install fails with "error: while checking out baseline <sha>" or "the baseline ... does not match", often after a shallow clone of the vcpkg registry.

vcpkg
error: while checking out baseline from commit '7e3d3beac5ca6fe8aab4599d4e1d8ce270ccf8e3'
This may be fixed by updating the baseline, or fetching the full history.

Common causes

A shallow vcpkg clone lacks the baseline commit

The registry was cloned with limited history, so the pinned baseline commit is not present to check out.

A baseline that does not exist upstream

The builtin-baseline sha in vcpkg.json was mistyped or never merged, so no checkout can match it.

How to fix it

Fetch full vcpkg history

Ensure the vcpkg registry checkout has the commit the baseline pins.

Terminal
git -C "$VCPKG_ROOT" fetch --unshallow || git -C "$VCPKG_ROOT" fetch --depth=1000

Update the baseline to a real commit

  1. Run vcpkg x-update-baseline to set the baseline to the current registry commit.
  2. Commit the updated vcpkg.json.
  3. Re-run install so the baseline resolves.
Terminal
vcpkg x-update-baseline --add-initial-baseline

How to prevent it

  • Use vcpkg x-update-baseline to set a baseline that exists upstream.
  • Avoid shallow-cloning the vcpkg registry when a pinned baseline is old.
  • Commit the exact baseline your manifest resolves against.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →