Baselines, version>= & Overrides
vcpkg's versioning model is deliberately different from Conan's. There are no version ranges and no lockfile. Instead, three mechanisms combine:
- The baseline: a commit of the registry. Every port has exactly one version at that commit, and that's the version you get unless something says otherwise.
- Minimum versions:
"version>=": "x"on a dependency raises that port's floor. vcpkg picks the lowest version that satisfies every constraint, which is the highest of the floors and the baseline. - Overrides:
"overrides"in the top-level manifest pins an exact version and wins over everything else.
Because the result depends only on files in Git (the baseline commit and your manifest), the same manifest resolves the same way on every machine, now and in ten years. That's why vcpkg doesn't need a lockfile.
The version database
vcpkg can resolve an older version because the registry keeps history: versions/baseline.json maps each port to its version at that commit, and versions/<letter>-/<port>.json lists every version ever published with the Git tree that holds its port files.
cd "$VCPKG_ROOT"
python3 -c "
import json
b = json.load(open('versions/baseline.json'))['default']
for p in ('fmt', 'spdlog', 'catch2'):
print(p, b[p])
"
head -14 versions/f-/fmt.jsonfmt {'baseline': '12.2.0', 'port-version': 1}
spdlog {'baseline': '1.17.0', 'port-version': 1}
catch2 {'baseline': '3.16.0', 'port-version': 0}
{
"versions": [
{
"git-tree": "7ca0b8c0026883daf28a0db75f6b4964bae2979a",
"version": "12.2.0",
"port-version": 1
},
{
"git-tree": "823af43db9df2c4be15c4331b36b3cc419afa02c",
"version": "12.2.0",
"port-version": 0
},
{
"git-tree": "936231a2c765082457d348a8781ea9d3610eb331",
A version has two parts: the upstream version and a port-version, which counts packaging changes for the same upstream version. 12.2.0#1 means "fmt 12.2.0, second revision of its port". vcpkg checks out an older version's port files from Git by their git-tree hash.
version>= and overrides in a manifest
mkdir -p app && cd app
cat > vcpkg.json <<'JSON'
{
"builtin-baseline": "5d4a3dc90c0b3773f3bac81bf41297b54328f471",
"dependencies": [
{ "name": "fmt", "version>=": "12.2.0#1" },
"spdlog"
],
"overrides": [
{ "name": "spdlog", "version": "1.17.0", "port-version": 1 }
]
}
JSON
vcpkg install 2>&1 | grep -E '^ +[*]? *[a-z0-9-]+(\[.*\])?:x64-linux|completed successfully' fmt:x64-linux@12.2.0#1
spdlog[core,fmt,tz-offset]:x64-linux@1.17.0#1
* vcpkg-cmake:x64-linux@2025-08-07
* vcpkg-cmake-config:x64-linux@2026-07-21
All requested installations completed successfully in: 25.5 ms
This resolves to the baseline versions because the constraints happen to match them. Now step away from the baseline. First, a minimum version must be a version that exists in the version database (11.0.0 was never a vcpkg version of fmt):
mkdir -p app && cd app
cat > vcpkg.json <<'JSON'
{
"builtin-baseline": "5d4a3dc90c0b3773f3bac81bf41297b54328f471",
"dependencies": [ { "name": "fmt", "version>=": "11.0.0" } ]
}
JSON
vcpkg install 2>&1 | head -6error: no version database entry for fmt at 11.0.0.
Available versions:
12.2.0#1
12.2.0
12.1.0
12.0.0
Second, a version that exists but differs from the baseline. An override to the older fmt 12.1.0 makes vcpkg check out that version's port files from Git (by the git-tree hash in the version database) and build it from source, since the binary cache only holds the baseline's 12.2.0:
mkdir -p app && cd app
cat > vcpkg.json <<'JSON'
{
"builtin-baseline": "5d4a3dc90c0b3773f3bac81bf41297b54328f471",
"dependencies": [ "fmt" ],
"overrides": [ { "name": "fmt", "version": "12.1.0" } ]
}
JSON
vcpkg install 2>&1 | grep -E '^ +[*]? *[a-z0-9-]+(\[.*\])?:x64-linux|^Building|Using cached|completed successfully'
grep -h 'define FMT_VERSION' vcpkg_installed/x64-linux/include/fmt/base.h fmt:x64-linux@12.1.0
* vcpkg-cmake:x64-linux@2025-08-07
* vcpkg-cmake-config:x64-linux@2026-07-21
Building fmt:x64-linux@12.1.0...
-- Using cached fmtlib-fmt-12.1.0.tar.gz
All requested installations completed successfully in: 5.7 s
#define FMT_VERSION 120100
The installed headers really are fmt 12.1.0 (FMT_VERSION 120100). An override is also how you pin an older major version, for example when a library you use hasn't been ported to fmt 12 yet. It wins over everything, even a version>= floor that asks for more:
mkdir -p app && cd app
cat > vcpkg.json <<'JSON'
{
"builtin-baseline": "5d4a3dc90c0b3773f3bac81bf41297b54328f471",
"dependencies": [ { "name": "fmt", "version>=": "12.0.0" } ],
"overrides": [ { "name": "fmt", "version": "11.2.0" } ]
}
JSON
vcpkg install 2>&1 | grep -E '^ +[*]? *[a-z0-9-]+(\[.*\])?:x64-linux|^Building|Using cached|completed successfully'
grep -h 'define FMT_VERSION' vcpkg_installed/x64-linux/include/fmt/base.h fmt:x64-linux@11.2.0
* vcpkg-cmake:x64-linux@2025-08-07
* vcpkg-cmake-config:x64-linux@2026-07-21
Building fmt:x64-linux@11.2.0...
-- Using cached fmtlib-fmt-11.2.0.tar.gz
All requested installations completed successfully in: 4.9 s
#define FMT_VERSION 110200
vcpkg didn't complain about the version>= 12.0.0 floor: the override silently replaced it. That's the point of overrides, and the reason to comment each one in a real manifest.
Both builds worked offline only because this course's image has a full vcpkg clone (the Git history holding old port files) and the source tarballs of exactly these two versions already in $VCPKG_ROOT/downloads (Using cached …). Any other version, say 12.0.0, resolves fine but then needs the network to fetch its source:
mkdir -p app && cd app
cat > vcpkg.json <<'JSON'
{
"builtin-baseline": "5d4a3dc90c0b3773f3bac81bf41297b54328f471",
"dependencies": [ "fmt" ],
"overrides": [ { "name": "fmt", "version": "12.0.0" } ]
}
JSON
vcpkg install 2>&1 | grep -E '^Downloading|curl operation failed|BUILD_FAILED'Downloading https://github.com/fmtlib/fmt/archive/12.0.0.tar.gz -> fmtlib-fmt-12.0.0.tar.gz
error: curl operation failed with error code 6 (Couldn't resolve host name).
error: building fmt:x64-linux failed with: BUILD_FAILED
Two practical takeaways. CI images need a full clone of vcpkg if you use overrides or version>= on older versions (a git clone --depth 1 fails with vcpkg was cloned as a shallow repository). And anything other than the baseline version means a source build, so either the CI machine has network access, or an asset cache / binary cache already holds it.
Updating the baseline
Moving to newer libraries is a one-line change: set builtin-baseline to a newer vcpkg commit. vcpkg x-update-baseline does it for you (it needs to fetch the registry), and --add-initial-baseline adds one to a manifest that has none. Update the baseline in its own pull request, so a CI run shows what the new versions break.
A runnable model: vcpkg's resolution
The rule is "highest floor wins, override beats all", applied per port across the whole graph, including version>= constraints that your dependencies' manifests declare:
def ver(v):
base, _, port = v.partition("#")
return tuple(int(x) for x in base.split(".")), int(port or 0)
def resolve(baseline, constraints, overrides):
result = {}
for port, base_version in baseline.items():
if port in overrides:
result[port] = (overrides[port], "override")
continue
floors = [(base_version, "baseline")] + [(v, f"version>= from {who}")
for who, p, v in constraints if p == port]
result[port] = max(floors, key=lambda f: ver(f[0]))
return result
baseline = {"fmt": "11.2.0", "spdlog": "1.15.0#1", "zlib": "1.3.1"}
constraints = [ # (who asks, port, minimum)
("app", "fmt", "11.0.2#1"),
("spdlog", "fmt", "12.1.0"), # a dependency's own manifest can raise the floor
("app", "spdlog", "1.15.0#1"),
]
overrides = {"zlib": "1.2.13"}
for port, (version, why) in resolve(baseline, constraints, overrides).items():
print(f"{port:<7} {version:<9} ({why})")fmt 12.1.0 (version>= from spdlog)
spdlog 1.15.0#1 (baseline)
zlib 1.2.13 (override)
Note the zlib line: an override can go below the baseline. That's its purpose (work around a regression), and its danger (ports that need newer zlib may break).
Test yourself
The baseline has fmt 11.2.0, and a dependency declares fmt version>= 12.1.0. Which fmt do you get?
- 11.2.0
- 12.1.0, the lowest version satisfying every constraint
- The newest fmt in the registry
- An error
Why doesn't vcpkg need a lockfile?
- It does, called vcpkg.lock
- The baseline commit plus the manifest's constraints and overrides fully determine every version
- It always uses the latest versions
- Versions are chosen at random
What does 12.2.0#1 mean in vcpkg?
- Version 12.2.0, build number 1 of your app
- Upstream version 12.2.0, port-version 1 (second packaging revision)
- Version 12.2.1
- A Git tag