-
Notifications
You must be signed in to change notification settings - Fork 44
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
How is the latest version determined? #185
Comments
Looks like ReactiveCocoa isn't using semantic versioning so the ordering isn't working correctly for them. |
Thanks @orta for the quick answer, if I get this right, is it because the patch version is missing? |
Yep 👍 |
Actually, this might be a bug in our version sorting, since I'm not sure it's supposed to be case sensitive? |
@segiddins not the case, 3.0.0 (alpha 1) is newer than 3.0 (rc1) instead. |
@kylef you're correct. I asked the ReactiveCocoa maintainers to add the patch number so that future releases will be fully compliant with semver. To be fair, the ReactiveCocoa versions seem to be ordered correctly (the patch number is missing in all the 3.0 pre-releases) but the 3.0.0-alpha.1 breaks the ordering. In the meantime, is it possible to either amend or remove the |
@kylef the version class should be padding the missing 0, so that shouldn't be it |
@kylef These two are treated as equals, and sort order between them is not defined. |
Uppercase and lowercase are both allowed on pre-release versions, and are compared lexically in ASCII sort order. See this excerpt from http://semver.org:
So an uppercase RC is < to a lowercase alpha (see an ASCII table). |
So I assume this will be resolved by using |
cool! |
@floere if I get this right, considering what @segiddins said about padding of the patch version, then shouldn't
|
@gabro Not 100% sure about the padding (I haven't seen that particular part of the source code) – but assuming he's right, then yes, that would evaluate to true. If not, we need to look into the patch version comparison code. |
@floere Well |
@gabro Thanks for the feedback! How it works is much simpler than I thought. It splits the version string into pieces of numeric or A-Za-z pieces.Then it moves through them in order, and compares each piece. So |
P.S: Code is in e.g. Ruby 2.3.0 in file |
@floere oh I see! That makes sense, thanks! Thanks again for the prompt support 👍 |
@gabro Oh yeah! I did not want to be unfair :) Just wanted to point out that if you add a patch number, it will always win against a version without. So once you move onto patch numbers, you need to use them … forever ;) |
This seems very unsemantic, though, we could fix this.
Is that really a semver v2 specification? |
@alloy it doesn't seem like an explicit semver specification, although the comparison algorithm is well detailed
The key here is that they (rightfully) assume major, minor and patch versions to be present in the identifier. I personally think padding the missing ones before performing the comparison wouldn't hurt. |
By the way, @segiddins is correct: the padding is in place when accessing the However those accessors are not used by the One would need to override |
@alloy No, hence the "get onto it". What I did was explain how |
@floere I think the issue right now is that CocoaPods allows for pods with a version not compliant with the semver specification, and then treats them as semver (for instance when comparing them) So, I think two sensible alternatives would be:
|
@gabro I know – we explicitly did not design it with SemVer in mind and left it open, but then started using |
Rejecting is not an option. |
Yes, I agree rejecting doesn't seem like a viable option right now and I very much prefer option 2 as well. If My ruby is quite rusty, but I can I can give it a shot during this weekend, if you guys agree this is a desirable change in behavior. |
@floere I guess I don’t understand what you were saying then at all 😿 |
@gabro That would be awesome, thanks! So yeah, trailing zeroes in segments (before the prerelease segment) that the other version does not have can be ignored. |
@alloy No worries 🌳 I was just explaining what is currently happening and why patch versions always (well, almost) win over non-patch versions. One thing… currently, the order is defined |
@floere right, do we want to set an explicit order for "synonyms"? It could be something as simple as having return this <=> other at the end, as opposed to the current return 0 That would get us
|
Yes, sorting needs to be stable (and these changes would need to go into CocoaPods-core) |
The latest version of ReactiveCocoa is
3.0.0-RC.1
and that's also the latest Podspec pushed to the Spec repo.However CocoaPods picks up
3.0.0-alpha.1
as the latest version, as also shown on https://cocoapods.org/?q=ReactiveCocoaThis causes some issues, especially with pods that go through a long beta period such as this one.
How's the latest version determined?
The text was updated successfully, but these errors were encountered: