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

Pub allows leading zeros in versions, semantic versioning does not #20

Closed
DartBot opened this issue Jun 4, 2015 · 2 comments
Closed
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@DartBot
Copy link

DartBot commented Jun 4, 2015

<img src="https://avatars.githubusercontent.com/u/5475521?v=3" align="left" width="96" height="96"hspace="10"> Issue by ricowind
Originally opened as dart-lang/sdk#23425


Example:
browser_controller has version 0.00.2-dev

Semantic versioning says:
A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes.

There is a discrepancy between the dart and python versions of pub.dartlang.org on how this is displayed and linked to (basically the python version will show 0.0.2, but link to 0.00.2, the dart version will show 0.00.2, but link to 0.0.2).

@DartBot
Copy link
Author

DartBot commented Jun 4, 2015

<img src="https://avatars.githubusercontent.com/u/46275?v=3" align="left" width="48" height="48"hspace="10"> Comment by munificent


I recall we had to add some special case support in the Dart code for pub to handle this, but I don't remember exactly why. I think support for leading zeroes may have initially been a bug in pub that we then had to deliberately support for backwards compatibility.

Natalie might remember the details. If not, I can dig through the commit history.


cc @nex3.

@DartBot DartBot added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Jun 4, 2015
@DartBot
Copy link
Author

DartBot commented Jun 4, 2015

<img src="https://avatars.githubusercontent.com/u/188?v=3" align="left" width="48" height="48"hspace="10"> Comment by nex3


For reasons I can get into further if you're curious, Pub supports semantic versioning 2.0.0-rc.1 (http://semver.org/spec/v2.0.0-rc.1.html), which has nothing in particular to say about leading zeros. The pub_semver package treats them as identical to versions without leading zeros, but will display them with the leading zeros. Can the server use the "display version" for linking?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

2 participants