With vcpkg manifests, how do builtin-baseline, version>= constraints and overrides combine under minimum version selection to pick each library's version?
answer
- lowest version meeting every constraint
- baseline adds an implicit minimum
- transitive minimums can raise it
- only top-level overrides force a version
basics
~20 svcpkg selects, per port, the lowest version satisfying every minimum: the baseline's version, top-level version>= and version>= from dependencies' manifests. There are no upper bounds; a top-level override replaces all of that with one exact version.
solid answer
~50 svcpkg uses **minimum version selection**: it never upgrades on its own and never runs a constraint solver. Each port in the graph collects minimums from three places: the **baseline** (its version at the baseline commit), **declared** `version>=` in the top-level manifest, and **transitive** `version>=` from the manifests of the versions selected for its dependents. The highest of those minimums wins, which is the lowest version meeting them all. There is no less-than constraint, so `version>=` can raise a port above the baseline but never pull it below. To go below, or to settle a conflict, the top-level manifest adds an `overrides` entry, which forces one exact version and ignores every other constraint. Overrides in dependencies' manifests are ignored, and two schemes that cannot be compared, such as `version-string` against `version`, produce a version conflict whose message suggests adding an override. In vcpkg 2026.10.16 an override's port-version is written as `#N` in its `version` string.
code
json · 11 lines{
"dependencies": [
"spdlog",
"fmt",
{ "name": "zlib", "version>=": "1.3.2#2" }
],
"builtin-baseline": "9eec002df1cd109f8f104cd966a763daf9751489",
"overrides": [
{ "name": "fmt", "version": "11.2.0" }
]
}go deeper
Recall that vcpkg picks the lowest version meeting all minimums, and that overrides force an exact version.
Explain the four constraint sources, baseline, declared, transitive and override, and why version>= can raise but never lower a version.
Walk through a real resolution: a new dependency raising a shared library, an override to hold one library back, and the incomparable-scheme conflict and its fix.
Set the rule for overrides: each one is justified in review and removed when its reason expires, because it silently overrules every dependent's stated minimum.
## Minimum version selection vcpkg resolves versions with **minimum version selection**, an approach the vcpkg docs credit to Go's module system and adapt with baselines. Given a set of minimum-version constraints, it installs the **oldest** version of each package that satisfies all of them. The design choices follow from that: - results are predictable and change only when an input changes; - nothing upgrades just because a newer release appeared in the registry; - no SAT solver is needed, because every constraint is a lower bound. ## Where constraints come from | Flavour | Declared by | Effect | |---|---|---| | Baseline | `builtin-baseline` or a registry's `baseline` | each port's baseline version is a minimum | | Declared | `version>=` in the top-level manifest | a minimum chosen by the project | | Transitive | `version>=` in a dependency's manifest | a minimum imposed by that dependency | | Override | `overrides` in the top-level manifest | an exact version; other constraints ignored | The resolver walks the graph roughly like this: 1. Add the top-level dependencies and their constraints. 2. When a port joins the graph, also add its baseline constraint. 3. When a new constraint arrives for a port: if an override exists, use the override's version; otherwise keep the current selection unless the constraint is higher, in which case select the higher version and pull in that version's own dependencies and constraints. 4. If two versions use schemes that cannot be compared, record a conflict. 5. Install if there are no conflicts; otherwise report them. ## A worked example The vcpkg docs use an abstract graph: `A 1.1` depends on `B 1.0` and `C 3.0`, `A 1.2` exists as well, and the manifest says `A version>= 1.1` and `C version>= 2.0`, with a baseline that has `A` at 1.0. The result is: - `A 1.1`, the lowest version meeting the declared 1.1, even though 1.2 exists; - `B 1.0`, required transitively by `A 1.1`; - `C 3.0`, raised from the declared 2.0 by `A 1.1`'s transitive constraint. ## Overrides An entry in `overrides` names a port and one version. It: - forces that version and ignores the baseline, declared and transitive constraints for that port; - takes effect only if the port is in the graph (directly or transitively); - may appear once per port name; - counts only in the **top-level** manifest; overrides in dependencies' manifests are ignored. In the 2026.10.16 release the port-version belongs in the string, as `"version": "1.2.3#7"`; the separate `port-version` field and the scheme-specific spellings (`version-semver` and friends) inside an override are documented as deprecated. ## Errors you will meet - **Version not in the database**: a `version>=` or override naming a version the registry never had fails with an error that there is no version entry for that port at that version. - **Incomparable schemes**: a port whose baseline uses the relaxed `version` scheme cannot be compared with a constraint in the `version-string` scheme; vcpkg reports a version conflict and prints an `overrides` snippet as the fix. - **No baseline**: `version>=` and `overrides` are rejected outright. ## Reading what vcpkg decided The resolution is visible before anything builds. `vcpkg install --dry-run` prints the install plan, every package with its version and selected features, without installing anything. Comparing that plan before and after a manifest change shows exactly which libraries a new dependency or a moved baseline raised. `vcpkg depend-info` prints the dependency graph of a port, as a list, a tree or a DOT, DGML or Mermaid graph, which helps find the dependent whose `version>=` raised a shared library. Because every input is in the manifest and the baseline commit, the same plan comes out on every machine; a difference between two machines points at a different manifest, a different configuration file or an overlay directory that only one of them has. ## Practical consequences for a pinned desktop application - Upgrading one library means raising its `version>=` (or the baseline); downgrading one means an override. - A new dependency can silently raise a shared library through its own `version>=`; reviewing the resolved plan in the install output catches that. - Overrides are a sharp tool: they bypass every dependent's stated minimum, so a forced old version can break a library that needs newer APIs. Record why each one exists and remove it once the reason is gone. - Ports taken from an overlay directory skip version constraints entirely; overlays are covered with ports and triplets.
- Why does vcpkg have no less-than constraint?Minimum version selection always installs the lowest version meeting every minimum, so an upper bound is never needed to stop surprise upgrades; versions move only when a minimum or the baseline moves. When you truly need an older version, a top-level override states it explicitly.
- A library's own manifest contains an overrides section. Does it affect your build?No. Overrides, like baselines and other registry settings, are honoured only in the top-level manifest. A port that needs a minimum version of something must express it with `version>=`, which does propagate transitively.
- What does vcpkg suggest when a version>= cannot be compared with the baseline version?It reports a version conflict, lists the two schemes involved, for example relaxed against string, and prints an `overrides` entry for the baseline version as a fix. Alternatively, rewrite the constraint using the scheme the port uses now.
- vcpkg installs the newest version that satisfies the version>= constraints.
- version>= with an older version than the baseline downgrades that library.
- A dependency's overrides section pins versions for everyone who consumes it.
- When two dependencies ask for different minimums, vcpkg reports a conflict.
- vcpkg runs a SAT solver to find a compatible set of versions.
Assumes vcpkg 2026.10.16 with vcpkg-tool 2026-09-26; override port-versions are written as a #N suffix in the version string.