Skip to content
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

NewConstraintIC interprets a dash in the prerelease tag as a range separator #59

Closed
carolynvs opened this issue Jul 26, 2017 · 1 comment
Labels
v2 Related to the 2.x version used by dep

Comments

@carolynvs
Copy link

carolynvs commented Jul 26, 2017

In golang/dep, we are using semver.NewConstraintIC to parse raw strings as constraints and some of them aren't being handled as expected:

  • v1.12.0-g2fd980e properly returns (semver.rangeConstraint) ^1.12.0-g2fd980e
  • v0.12.0-12-g2fd980e returns (semver.rangeConstraint) >=0.12.0, <=12.0.0-g2fd980e, when I expected ^1.12.0-g2fd980e
  • v1.12.0-2-g2fd980e returns (semver.rangeConstraint) >=1.12.0, <=2.0.0-g2fd980e, when I expected ^v1.12.0-2-g2fd980e.
  • v1.3.1-1-gf12c623 returns an unexpected (semver.none) . I expected ^1.3.1-1-gf12c623, or at the very least an error.

Essentially the dash in the prerelease tag is causing the function parse the input a range between v1.3.1 to 1-gf12c623.

I'm going to try having it first check if the input string is a valid version first, and if that pans out, submit a PR.

@carolynvs carolynvs changed the title NewConstraintIC interprets a dash in the metadata as a range separator NewConstraintIC interprets a dash in the prerelease tag as a range separator Jul 26, 2017
carolynvs added a commit to carolynvs/dep that referenced this issue Aug 3, 2017
@mattfarina mattfarina added the v2 Related to the 2.x version used by dep label Sep 5, 2019
@mattfarina
Copy link
Member

This issue is 3 years old and v2 is no longer being developed. It was never released. Closing issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 Related to the 2.x version used by dep
Projects
None yet
Development

No branches or pull requests

2 participants