Skip to content

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

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

Closed
ricowind opened this issue May 11, 2015 · 4 comments
Closed

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

ricowind opened this issue May 11, 2015 · 4 comments

Comments

@ricowind
Copy link
Contributor

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).

@munificent
Copy link
Member

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.

@nex3
Copy link
Member

nex3 commented May 11, 2015

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?

1 similar comment
@nex3
Copy link
Member

nex3 commented May 11, 2015

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?

@DartBot
Copy link

DartBot commented Jun 4, 2015

This issue has been moved to dart-lang/pub#20.

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

5 participants