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

Cargo doesn't understand prerelease versions or build metadata #2935

Closed
jethrogb opened this issue Jul 31, 2016 · 3 comments
Closed

Cargo doesn't understand prerelease versions or build metadata #2935

jethrogb opened this issue Jul 31, 2016 · 3 comments

Comments

@jethrogb
Copy link
Contributor

Semver allows specifying versions such as 1.0.0-beta+exp.sha.5114f85, see http://semver.org/#spec-item-9 . Cargo doesn't handle these versions well or at all. See e.g. https://crates.io/crates/core_rustc-serialize which has these versions:

  • 0.3.19
  • 0.3.19+patch1
  • 0.3.20-v0.3.19patch1

Specifying a dependency core_rustc-serialize = "*" (or core_rustc-serialize = "^0.3") results in Cargo choosing 0.3.19, while it should choose the newer 0.3.20-v0.3.19patch1. You can't specify 0.3.20-v0.3.19patch1 in either case by using cargo update --precise. Specifying the exact version string does work.

There is simply no way to select 0.3.19+patch1. Putting it in the Cargo.toml results in the error message "the given version requirement is invalid". You also can't select it using cargo update --precise. This results in a crate existing on crates.io that can effectively not be used by anyone.

@alexcrichton
Copy link
Member

I think this may be a dupe of #2222 which has been discussed a bit more towards the end of the thread, so I'm going to close in favor of that.

cc @steveklabnik

@jethrogb
Copy link
Contributor Author

jethrogb commented Jul 31, 2016

That bug is currently solely about prerelease versions. There's also an issue with build metadata which has not been discussed in #2222. I'm happy to move that conversation over there too, but then the issue description should be updated. Otherwise, please re-open here and I'll make this about build metadata only.

@alexcrichton
Copy link
Member

Ah ok make sense to me, want to reopen one targeted at build metadata (may be good to start fresh). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants