-
Notifications
You must be signed in to change notification settings - Fork 7.7k
[vcpkg] Add initial versioning documentation #15565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ras0219-msft
merged 12 commits into
microsoft:master
from
ras0219:dev/roschuma/versions
Jan 15, 2021
Merged
Changes from 3 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
58fde40
[vcpkg] Improve efficiency and tests of versioning
ras0219 904ae01
[vcpkg] Add initial versioning documentation and rename x-default-bas…
ras0219 63ffdc3
[vcpkg] Enable metrics for builtin-baseline & overrides
ras0219 5e04846
[vcpkg] Address PR comments
ras0219 2aa2860
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
ras0219 661c132
[vcpkg] Add support for syntax in version>=
ras0219 f6a38e3
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
ras0219 62e7b88
[vcpkg] Remove port-version from dependency syntax
ras0219 6ea7b4c
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
ras0219 4d17b81
Merge branch 'master' of https://github.com/Microsoft/vcpkg into dev/…
ras0219 342194b
[vcpkg] Address CR comment
ras0219 1bfe8cc
[vcpkg] Minor docs fixup
ras0219 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| # Versioning | ||
|
|
||
| **This feature is experimental and requires `--feature-flags=versions`** | ||
|
|
||
| Versioning allows you to deterministically control the precise revisions of dependencies used by | ||
| your project from within your manifest file. | ||
|
|
||
| ## Version schemes | ||
|
|
||
| ### Schemes | ||
| Versions in vcpkg come in three primary flavors: | ||
|
|
||
| #### version | ||
| A dot-separated sequence of numbers (1.2.3.4) | ||
|
|
||
| #### version-date | ||
| A date (2021-01-01.5) | ||
|
|
||
| #### version-semver | ||
| A Semantic Version 2.0 (2.1.0-rc2) | ||
|
|
||
| See https://semver.org/ for a full specification. | ||
|
|
||
| #### version-string | ||
| An exact, incomparable version (strawberry) | ||
|
|
||
| ### Port Versions | ||
| Each version additionally has a "port-version" which is a natural number. When rendered as text, the | ||
|
ras0219 marked this conversation as resolved.
Outdated
|
||
| port version (if nonzero) is added as a suffix to the primary version text separated by a hash (#). | ||
| Port-versions are sorted lexographically after the primary field, for example: | ||
|
ras0219 marked this conversation as resolved.
Outdated
|
||
|
|
||
| 1.0.0 < 1.0.0#1 < 1.0.1 < 1.0.1#5 < 2.0.0 | ||
|
|
||
| ## Constraints | ||
|
|
||
| Manifests can place three kinds of constraints upon the versions used: | ||
|
|
||
| ### builtin-baseline | ||
| The baseline references a commit within the vcpkg repository that | ||
| establishes a minimum version on every dependency in the graph. If | ||
| no other constraints are specified (directly or transitively), | ||
| then the version from the baseline of the top level manifest will | ||
| be used. | ||
|
|
||
| You can get the current commit of your vcpkg instance either by adding an empty `"builtin-baseline"` field, installing, and examining the error message or by running `git rev-parse HEAD` in the root of the vcpkg instance. | ||
|
|
||
| Baselines provide stability and ease of development for top-level manifest files. They are not considered from ports consumed as a dependency. If a minimum version constraint is required during transitive version resolution, the port should use `version>=`. | ||
|
|
||
| ### version>= | ||
| Within the "dependencies" field, each dependency can have a | ||
| minimum constraint listed. These minimum constraints will be used | ||
| when transitively depending upon this library. A minimum | ||
| port-version can additionally be specified with the "port-version" | ||
| field in the same object. | ||
|
|
||
| ### overrides | ||
| When used as the top-level manifest (such as when running `vcpkg | ||
| install` in the directory), overrides allow a manifest to | ||
| short-circuit dependency resolution and specify exactly the | ||
| version to use. These can be used to handle version conflicts, | ||
| such as with `version-string` dependencies. | ||
|
|
||
| Overrides are not considered from ports consumed as a dependency. | ||
|
|
||
| ## Example top-level manifest: | ||
| ```json | ||
| { | ||
| "name": "example", | ||
| "version": "1.0", | ||
| "builtin-baseline": "a14a6bcb27287e3ec138dba1b948a0cdbc337a3a", | ||
| "dependencies": [ | ||
| { "name": "zlib", "version>=": "1.2.11", "port-version": 8 }, | ||
|
ras0219 marked this conversation as resolved.
Outdated
|
||
| "rapidjson" | ||
| ], | ||
| "overrides": [ | ||
| { "name": "rapidjson", "version": "2020-09-14" } | ||
| ] | ||
| } | ||
| ``` | ||
| See also the [manifest documentation](manifests.md) for more syntax information. | ||
|
|
||
| ## Original Specification | ||
|
|
||
| See also the [original specification](https://github.com/vicroms/vcpkg/blob/versioning-spec/docs/specifications/versioning.md) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
scripts/testing/version-files/without-default-baseline-2/port_versions/z-/zlib.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| { | ||
| "versions": [ | ||
| { | ||
| "git-tree": "7bb2b2f3783303a4dd41163553fe4cc103dc9262", | ||
| "version-string": "1.2.11", | ||
| "port-version": 9 | ||
| }, | ||
| { | ||
| "git-tree": "4927735fa9baca564ebddf6e6880de344b20d7a8", | ||
| "version-string": "1.2.11", | ||
| "port-version": 8 | ||
| } | ||
| ] | ||
| } |
7 changes: 7 additions & 0 deletions
7
scripts/testing/version-files/without-default-baseline-2/vcpkg.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "name": "without-default-baseline-test-2", | ||
| "version-string": "0", | ||
| "dependencies": [ | ||
| "zlib" | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -81,8 +81,7 @@ namespace vcpkg::Versions | |
| enum class Type | ||
| { | ||
| None, | ||
| Minimum, | ||
| Exact | ||
| Minimum | ||
| }; | ||
| }; | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.