packagecontrol.io icon indicating copy to clipboard operation
packagecontrol.io copied to clipboard

Semantic versions are compared as strings for aggregation, notably the pre-release segment

Open FichteFoll opened this issue 8 years ago • 3 comments

Apparently, the channel aggregation, which picks the latest releases for each major and the the latest minor releases (with their latest patch release) for inclusion in the distributed channel_v3.json, happens in postgres, where the semantic versions are compared by string and not how semantic versions should be compared. This is noticeable for versions such as 1.0.0-beta.33, which would be errorneously considered smaller than 1.0.0-beta.7.

FichteFoll avatar Oct 19 '17 17:10 FichteFoll

Just occured again with SublimeLinter, after previously happening for SublimeCodeIntel.

FichteFoll avatar Jan 07 '18 17:01 FichteFoll

Occured again with JSCustom. As soon as a package reaches 10 in a pre-release identifier, basically.

The workaround is to jump from 9 to 90 instead of 10.

FichteFoll avatar Jun 13 '20 10:06 FichteFoll

The workaround is to jump from 9 to 90 instead of 10.

Or to start off zero-padding the numbers (but this requires knowing you'll have the problem before getting there).

I also wonder if you can go from 1.0.0-beta.9 to 1.0.0-charlie.10 and use ASCII-incrementing pre-release identifiers each time the integer rolls over.

michaelblyons avatar Jun 13 '20 15:06 michaelblyons