-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
crashing bug in prerelease version parser #3147
Comments
Maybe the |
Yep, and it looks like there might have been a fix for this? |
And yesterday, when I first tried Velocity, it worked. Today, it does not. :P Great timing! I was just about to add it to another dozen projects or so. In any case, I too am getting this error. I thought the referenced fix went into a pre-1.0 meteor, but apparently either it did not fix it, or it is a new issue. It's not clear what was fixed, as no commits reference that issue number. |
What if it's called 1.0.0-rc6-cucumber? That is, without the .6? |
It's the dash character. The dash is reserved for release suffix, and this creates two suffixes. |
It seems that anything after the first dash should be the suffix... |
Depends on how the regex is written. |
I tried two new releases right after that, which are:
None of them supercede the previously added two dashes |
From the semantic versioning spec 2.0.0:
It looks like meteor's parser is not following the spec, regardless of how the regexp is written. :) Plus, with the ability to have build info (with a + marker) it looks like a simple parser using a regexp would be out of the question at this point. It looks like it'll have to become stateful, and follow character by character to determine what it is parsing as it finds the first and following dots, dash, and plus sign. |
Without actually doing it yet... I'd probably write this as:
The prerelease part may need to be further broken up by dots later, if the major.minor.patch comparison is equal, since "alpha" < "alpha.1". |
I think the numbers 0-9 are missing in https://github.com/meteor/meteor/blob/release/METEOR%401.0/tools/package-version-parser.js#L97? |
I don't think so. It looks like numbers are intended to be caught in the "if (typeof part === 'number')" case. |
I think the real problem here is that pre-release IDs are probably able to be treated as simple strings for comparison, and instead it's trying to do magic. Of course, that there are dots inside a pre-release ID that matter, makes this harder. I guess one could compare pure numeric fields as numeric, and any field that has a string as a string, but I have no idea what happens when you try to compare "alpha.0" and "alpha.b" |
I think the semver package parses the version to: |
So, to get this package working again for those of us wanting to use it... can Version 1.0.0-rc6-cucumber and rc.6-cucumber.0 be removed from the package system entirely? |
A temporary fix is to add
|
Here's a simple reproduction repo I just made. |
Can't each of the elements of a pre-release ID (that is, the parts between the dots) be treated as a string, and directly compared that way? "1" < "100", "10" < "100", etc. This appears to be the intent of the spec, but it's not clear on this. Thus, if you had an array: ["rc", "6-cucumber"] it would compare to ["rc", "6"] and come after it automatically and predictability. |
I just published velocity:core@0.3.0 (equivalent to rc5) as a work around for this issue. |
Success! There is no way to un-publish something once it's published? That seems like a flaw. |
Totally. I'm glad we've found an issue and I'm sure the MDG will fix it. Here's a story I'd love to see implemented: As a package maintainer :) |
OK, does that mean there's no current emergency issue here? We can remove packages right now but it's not the greatest operation (eg it ends up requiring a full catalog resync for all users due to how the sync protocol works). And we'll look into the underlying bug soon too. (I apologize, I'm generally in charge of our GitHub bug triage process and I've been taking a few weeks of focusing on fixing [a few problems](https://github.com/meteor/meteor/milestones/Tool Performance and Stability) instead of incoming bugs!) |
Yes. We have solved our issue, that velocity:core was no longer usable, by releasing a new version 0.3.0. |
Yesterday I published a velocity:core with version set to
1.0.0-rc.6-cucumber
. Since then, all packages that depend on previous versions of velocity:core are no longer working, the error displayed is shown below.To replicate try to add
mike:mocha
to any meteor project. Here's a copy/paste repro:You will see the following:
The text was updated successfully, but these errors were encountered: