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

Rustpkg should support versions integrated with a VCS #5684

Closed
graydon opened this issue Apr 2, 2013 · 2 comments
Closed

Rustpkg should support versions integrated with a VCS #5684

graydon opened this issue Apr 2, 2013 · 2 comments
Milestone

Comments

@graydon
Copy link
Contributor

graydon commented Apr 2, 2013

Sub-bug of #5677

Rustpkg should support pkgids with version numbers in them, rather than treating versions as a separate component of a dependency specification. The easiest thing I can think of is to use a URI-like fragment-specifier: path/to/pkgid#version. Then version is passed through somewhat directly to the underlying fetch mechanism (as a revision identifier -- either a tag/ref or a hash) and is mapped into a (sub)directory when checking out and building packages. We can start with specific revisions and extend to accepting revision-ranges (say, separated by ..) in dependency requirements at some point if we find this is something people want.

Note that this is not in opposition to using semvers. We should encourage revision tags that are semvers. But users will occasionally want or need to refer to non-semver tags:

  • Users who just want HEAD of some repo, while doing development
  • Users who need a specific ref (by content-hash) that has no associated semver

We can (probably?) differentiate cases using the following algorithm (though it's getting tight):

  • Split any version-specifier at a .. pair. If there's such a pair, it's a version range. If not, it's a single version.
  • If there is a . in a version, try to parse it as a semver.
  • If not, or if semver-parsing fails, consider it as an exact VCS revision identifier (tag, ref, etc.)
@catamorphism
Copy link
Contributor

I'm about to submit a pull request for just parsing the version at all. I'll implement the ability to request a specific version next.

catamorphism added a commit to catamorphism/rust that referenced this issue May 30, 2013
For now, the test I added just checks that PkgId::new parses the
version number out of a git repo's tags list, where relevant.
catamorphism added a commit to catamorphism/rust that referenced this issue Jun 9, 2013
For now, the test I added just checks that PkgId::new parses the
version number out of a git repo's tags list, where relevant.
@catamorphism
Copy link
Contributor

Fixed in d92b435

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