Skip to content

[vcpkg] Error on '#' in version strings to avoid confusion#14927

Merged
ras0219-msft merged 6 commits intomicrosoft:masterfrom
ras0219:dev/roschuma/warn-port-version
Dec 4, 2020
Merged

[vcpkg] Error on '#' in version strings to avoid confusion#14927
ras0219-msft merged 6 commits intomicrosoft:masterfrom
ras0219:dev/roschuma/warn-port-version

Conversation

@ras0219
Copy link
Copy Markdown
Contributor

@ras0219 ras0219 commented Dec 3, 2020

With versioning, we will now be displaying versions to users either as text or text#port-version. If a user sees this output and attempts to input it directly as a version constraint, it will not match and cause confusion.

This PR makes #s illegal in all version strings, reserving it for use for port-version suffixes. It then suggests how to fix the issue for users.

As a drive by, this PR also refactors out the several copies of deserializing version-xyz's.

Example:

{
  "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
  "name": "versiontest",
  "version-string": "2020-03-03",
  "description": [],
  "homepage": "",
  "dependencies": [
    { "name": "fmt", "version>=": "1.0.0#2" }
  ]
}
> vcpkg install --feature-flags=manifests,versions --dry-run
Errors occurred while parsing C:\src\vcpkg\testing\vcpkg.json
    $.dependencies[0].version>= (a version): invalid character '#' in version text. Did you mean "port-version": 2?
See https://github.com/Microsoft/vcpkg/tree/master/docs/users/manifests.md for more information.

+@strega-nil

@ras0219 ras0219 force-pushed the dev/roschuma/warn-port-version branch from 5dc3778 to 9bb0ece Compare December 3, 2020 22:52
@JackBoosY JackBoosY added category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed info:internal labels Dec 4, 2020
@JackBoosY
Copy link
Copy Markdown
Contributor

That's awesome!

@ras0219-msft ras0219-msft merged commit 60aa143 into microsoft:master Dec 4, 2020
strega-nil pushed a commit to strega-nil/vcpkg that referenced this pull request May 5, 2021
…#14927)

* [vcpkg] Refactor deserializers to reduce duplicate functionality

* [vcpkg] Error on '#' in version strings to avoid confusion with port-version

* [vcpkg] Improve error message

* [vcpkg] Reorder field output

* [vcpkg] Fix tests

Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants